public final class DynamicConfigurationInstanceProvider<T> extends Object implements org.mule.extension.runtime.ConfigurationInstanceProvider<T>
ConfigurationInstanceProvider
which continuously evaluates the same
ResolverSet
and then uses the resulting ResolverSetResult
to build an instance of a given type.
Although each invocation to get(OperationContext, ConfigurationInstanceRegistrationCallback)
is guaranteed to end up in an invocation to #resolverSet#resolve(MuleEvent)
, the resulting
ResolverSetResult
might not end up generating a new instance. This is so because
ResolverSetResult
instances are put in a cache to
guarantee that equivalent evaluations of the resolverSet
return the same
instance.Constructor and Description |
---|
DynamicConfigurationInstanceProvider(String name,
org.mule.extension.introspection.Configuration configuration,
ConfigurationObjectBuilder configurationObjectBuilder,
ResolverSet resolverSet)
Creates a new instance
|
Modifier and Type | Method and Description |
---|---|
T |
get(org.mule.extension.runtime.OperationContext operationContext,
org.mule.extension.runtime.ConfigurationInstanceRegistrationCallback registrationCallback)
Evaluates
resolverSet using the given event and returns
an instance produced with the result. |
org.mule.extension.introspection.Configuration |
getConfiguration() |
String |
getName() |
public DynamicConfigurationInstanceProvider(String name, org.mule.extension.introspection.Configuration configuration, ConfigurationObjectBuilder configurationObjectBuilder, ResolverSet resolverSet)
name
- the name of the config definitionconfiguration
- the Configuration
modelconfigurationObjectBuilder
- the introspection model of the objects this resolver producesresolverSet
- the ResolverSet
that's going to be evaluatedpublic T get(org.mule.extension.runtime.OperationContext operationContext, org.mule.extension.runtime.ConfigurationInstanceRegistrationCallback registrationCallback)
resolverSet
using the given event
and returns
an instance produced with the result. For equivalent ResolverSetResult
s
it will return the same instance, for as long as the expirationInterval
and
expirationTimeUnit
were specified in the constructorget
in interface org.mule.extension.runtime.ConfigurationInstanceProvider<T>
operationContext
- a OperationContext
registrationCallback
- a ConfigurationInstanceRegistrationCallback
to be invoked when a new instance is producedpublic org.mule.extension.introspection.Configuration getConfiguration()
getConfiguration
in interface org.mule.extension.runtime.ConfigurationInstanceProvider<T>
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.