public final class LifecycleAwareConfigurationInstance extends Object implements org.mule.runtime.extension.api.runtime.config.ConfigurationInstance, org.mule.runtime.api.lifecycle.Lifecycle
ConfigurationInstance which propagates dependency injection and lifecycle phases into the contained
configuration value and connectionProvider (if present).
In the case of the connectionProvider being present, then it also binds the value to the
ConnectionProvider by the means of ConnectionManager.bind(Object, ConnectionProvider) when the
initialise() phase is executed. That bound will be broken on the stop() phase by using
ConnectionManager.unbind(Object)
| Constructor and Description |
|---|
LifecycleAwareConfigurationInstance(String name,
org.mule.runtime.api.meta.model.config.ConfigurationModel model,
Object value,
org.mule.runtime.extension.api.runtime.config.ConfigurationState configurationState,
Optional<org.mule.runtime.api.connection.ConnectionProvider> connectionProvider)
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Propagates this lifecycle phase into the the
value. |
Optional<org.mule.runtime.api.connection.ConnectionProvider> |
getConnectionProvider() |
org.mule.runtime.api.meta.model.config.ConfigurationModel |
getModel() |
String |
getName() |
org.mule.runtime.extension.api.runtime.config.ConfigurationState |
getState() |
org.mule.runtime.extension.api.runtime.config.ConfigurationStats |
getStatistics() |
Object |
getValue() |
void |
initialise() |
void |
start() |
void |
stop()
Propagates this lifecycle phase into the the
value. |
protected void |
unbindConnection() |
public LifecycleAwareConfigurationInstance(String name, org.mule.runtime.api.meta.model.config.ConfigurationModel model, Object value, org.mule.runtime.extension.api.runtime.config.ConfigurationState configurationState, Optional<org.mule.runtime.api.connection.ConnectionProvider> connectionProvider)
name - this configuration's namemodel - the ConfigurationModel for this instancevalue - the actual configuration instanceconnectionProvider - an Optional containing the ConnectionProvider to usepublic void initialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
initialise in interface org.mule.runtime.api.lifecycle.Initialisableorg.mule.runtime.api.lifecycle.InitialisationExceptionpublic void start()
throws org.mule.runtime.api.exception.MuleException
start in interface org.mule.runtime.api.lifecycle.Startableorg.mule.runtime.api.exception.MuleExceptionpublic void stop()
throws org.mule.runtime.api.exception.MuleException
value. Also triggers a ConfigurationInstanceNotification that
is being stopped.stop in interface org.mule.runtime.api.lifecycle.Stoppableorg.mule.runtime.api.exception.MuleException - if an exception is foundprotected void unbindConnection()
throws org.mule.runtime.api.exception.MuleException
org.mule.runtime.api.exception.MuleExceptionpublic void dispose()
value.dispose in interface org.mule.runtime.api.lifecycle.Disposablepublic String getName()
getName in interface org.mule.runtime.extension.api.runtime.config.ConfigurationInstancepublic Optional<org.mule.runtime.api.connection.ConnectionProvider> getConnectionProvider()
getConnectionProvider in interface org.mule.runtime.extension.api.runtime.config.ConfigurationInstancepublic org.mule.runtime.api.meta.model.config.ConfigurationModel getModel()
getModel in interface org.mule.runtime.extension.api.runtime.config.ConfigurationInstancepublic Object getValue()
getValue in interface org.mule.runtime.extension.api.runtime.config.ConfigurationInstancepublic org.mule.runtime.extension.api.runtime.config.ConfigurationStats getStatistics()
getStatistics in interface org.mule.runtime.extension.api.runtime.config.ConfigurationInstanceIllegalStateException - if invoked before initialise()public org.mule.runtime.extension.api.runtime.config.ConfigurationState getState()
getState in interface org.mule.runtime.extension.api.runtime.config.ConfigurationInstanceCopyright © 2003–2022 MuleSoft, Inc.. All rights reserved.