public class RegistryLookupValueResolver<T> extends Object implements ValueResolver<T>
ValueResolver
which accesses the mule registry
and returns the value associated with key
.
Because the registry is mutable, isDynamic()
will always return
true
even though the odds are that the same value will always be returned.
In case you want to prevent accessing the registry every time (this requires
some confidence on your end about the registry value not changing) you could use
this resolver in conjunction with CachingValueResolverWrapper
The registry is accessed through the MuleContext
that is exposed in
the MuleEvent
that is passed to the resolve(MuleEvent)
methodConstructor and Description |
---|
RegistryLookupValueResolver(String key)
Construct a new instance and set the
key that will be used
to access the registry |
public T resolve(MuleEvent event) throws MuleException
key
resolve
in interface ValueResolver<T>
event
- a MuleEvent
key
Exception
MuleException
- if the resolution of the value failspublic boolean isDynamic()
ValueResolver
false
if subsequent invocations to
ValueResolver.resolve(MuleEvent)
will return the same value.
Notice that if it returns true
, then it might return different
values per invocation but that's not guaranteed.isDynamic
in interface ValueResolver<T>
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.