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) method| Constructor and Description |
|---|
RegistryLookupValueResolver(String key)
Construct a new instance and set the
key that will be used
to access the registry |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isDynamic()
returns
false if subsequent invocations to
ValueResolver.resolve(MuleEvent) will return the same value. |
T |
resolve(MuleEvent event)
Returns the registry value associated with
key |
public T resolve(MuleEvent event) throws MuleException
keyresolve in interface ValueResolver<T>event - a MuleEventkeyExceptionMuleException - if the resolution of the value failspublic boolean isDynamic()
ValueResolverfalse 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–2023 MuleSoft, Inc.. All rights reserved.