public class DefaultMuleContext extends Object implements MuleContext
| Modifier and Type | Field and Description |
|---|---|
protected SystemExceptionHandler |
exceptionListener
Global exception handler which handles "system" exceptions (i.e., when no message is involved).
|
protected MuleContextLifecycleManager |
lifecycleManager
LifecycleManager for the MuleContext.
|
static String |
LOCAL_OBJECT_STORE_MANAGER_KEY |
static String |
LOCAL_PERSISTENT_OBJECT_STORE_KEY |
static String |
LOCAL_QUEUE_MANAGER_KEY |
static String |
LOCAL_TRANSIENT_OBJECT_STORE_KEY
TODO: Remove these constants.
|
protected MuleClient |
localMuleClient |
protected ServerNotificationManager |
notificationManager |
| Constructor and Description |
|---|
DefaultMuleContext() |
DefaultMuleContext(MuleConfiguration config,
MuleContextLifecycleManager lifecycleManager,
ServerNotificationManager notificationManager)
Deprecated.
Use empty constructor instead and use setter for dependencies.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRegistry(Registry registry)
Deprecated.
|
protected void |
checkLifecycleForPropertySet(String propertyName,
String phase) |
protected DefaultRegistryBroker |
createRegistryBroker() |
protected MuleRegistry |
createRegistryHelper(DefaultRegistryBroker registry) |
void |
dispose() |
void |
fireNotification(ServerNotification notification)
Fires a server notification to all registered
CustomNotificationListener notificationManager. |
ArtifactType |
getArtifactType()
The
ArtifactType indicating if this configuration object is for an application or a domain. |
MuleClient |
getClient() |
String |
getClusterId() |
int |
getClusterNodeId() |
MuleConfiguration |
getConfiguration() |
Map<QName,Set<Object>> |
getConfigurationAnnotations()
Return all annotations seen in the configuration
|
ConfigurationComponentLocator |
getConfigurationComponentLocator() |
org.mule.runtime.api.config.custom.CustomizationService |
getCustomizationService()
Provides access to a
CustomizationService to change the default services provided by the MuleContext. |
DataTypeConversionResolver |
getDataTypeConverterResolver() |
MessagingExceptionHandler |
getDefaultErrorHandler() |
ErrorTypeLocator |
getErrorTypeLocator() |
ErrorTypeRepository |
getErrorTypeRepository() |
Collection<ExceptionContextProvider> |
getExceptionContextProviders() |
SystemExceptionHandler |
getExceptionListener() |
ClassLoader |
getExecutionClassLoader() |
ExtendedExpressionManager |
getExpressionManager() |
ExtensionManager |
getExtensionManager() |
FlowTraceManager |
getFlowTraceManager() |
String |
getId() |
Injector |
getInjector()
Returns a
Injector capable of injecting dependencies into objects |
LifecycleManager |
getLifecycleManager() |
org.mule.runtime.api.store.ObjectStoreManager |
getLocalObjectStoreManager()
When running in clustered mode, it returns a
ObjectStoreManager that creates ObjectStore instances which are
only local to the current node. |
QueueManager |
getLocalQueueManager()
When running in clustered mode, it returns a
QueueManager that creates Queue instances which are only local
to the current node. |
org.mule.runtime.api.lock.LockFactory |
getLockFactory()
Factory for creating locks for synchronizing mule components.
|
ServerNotificationManager |
getNotificationManager() |
ObjectSerializer |
getObjectSerializer()
The instance of
ObjectSerializer to be used to serialize/deserealize objects |
org.mule.runtime.api.store.ObjectStoreManager |
getObjectStoreManager() |
ProcessorInterceptorProvider |
getProcessorInterceptorManager() |
ProcessingTimeWatcher |
getProcessorTimeWatcher() |
QueueManager |
getQueueManager()
Gets the queue manager used by mule for queuing events.
|
MuleRegistry |
getRegistry() |
BootstrapServiceDiscoverer |
getRegistryBootstrapServiceDiscoverer() |
SchedulerConfig |
getSchedulerBaseConfig() |
SchedulerService |
getSchedulerService() |
SecurityManager |
getSecurityManager()
Gets the security manager used by this Mule instance to authenticate and authorise incoming and outgoing event traffic and
service invocations
|
long |
getStartDate()
Returns the long date when the server was started
|
AllStatistics |
getStatistics()
Gets all statistics for this instance
|
StreamCloserService |
getStreamCloserService()
Returns the configured
StreamCloserService |
SingleResourceTransactionFactoryManager |
getTransactionFactoryManager() |
TransactionManager |
getTransactionManager()
Returns the Jta transaction manager used by this Mule server instance.
|
TransformationService |
getTransformationService()
Gets application wide instance of
TransformationService used for applying
Transformer's to a Message and for obtaining different representations
of the message payload. |
String |
getUniqueIdString()
Generate a unique ID string; this will begin with the cluster node ID followed by a dash, e.g.
|
void |
handleException(Exception e) |
void |
handleException(Exception e,
RollbackSourceCallback rollbackMethod) |
void |
initialise() |
boolean |
isDisposed() |
boolean |
isDisposing() |
boolean |
isInitialised()
Determines if the server has been initialised
|
boolean |
isInitialising()
Determines if the server is being initialised
|
boolean |
isPrimaryPollingInstance() |
boolean |
isStarted()
Determines if the server has been started
|
boolean |
isStarting() |
boolean |
isStopped() |
boolean |
isStopping() |
void |
registerListener(ServerNotificationListener l)
Registers an intenal server event listener.
|
void |
registerListener(ServerNotificationListener l,
String resourceIdentifier)
Registers an intenal server event listener.
|
void |
removeRegistry(Registry registry)
Deprecated.
|
void |
setArtifactType(ArtifactType artifactType) |
void |
setBootstrapServiceDiscoverer(BootstrapServiceDiscoverer bootstrapServiceDiscoverer)
Sets application wide instance of
BootstrapServiceDiscoverer |
void |
setErrorTypeLocator(ErrorTypeLocator errorTypeLocator) |
void |
setErrorTypeRepository(ErrorTypeRepository errorTypeRepository) |
void |
setExceptionListener(SystemExceptionHandler exceptionListener) |
void |
setExecutionClassLoader(ClassLoader cl) |
void |
setExtensionManager(ExtensionManager extensionManager) |
void |
setInjector(Injector injector) |
void |
setLifecycleManager(MuleContextLifecycleManager lifecyleManager) |
void |
setLocalMuleClient(MuleClient muleClient) |
void |
setMuleConfiguration(MuleConfiguration muleConfiguration) |
void |
setMuleRegistry(MuleRegistryHelper muleRegistry) |
void |
setNotificationManager(ServerNotificationManager notificationManager) |
void |
setObjectSerializer(ObjectSerializer objectSerializer) |
void |
setObjectStore(String name,
ListableObjectStore<Serializable> store) |
void |
setProcessorInterceptorManager(ProcessorInterceptorProvider processorInterceptorManager) |
void |
setQueueManager(QueueManager queueManager)
Sets the queue manager used by mule for queuing events.
|
void |
setRegistryBroker(DefaultRegistryBroker registryBroker) |
void |
setSchedulerController(SchedulerController schedulerController) |
void |
setSecurityManager(SecurityManager securityManager)
Sets the security manager used by this Mule instance to authenticate and authorise incoming and outgoing event traffic and
service invocations
|
void |
setTransactionManager(TransactionManager manager)
Sets the JTA Transaction Manager to use with this Mule server instance
|
void |
setTransformationService(TransformationService transformationService)
Sets application wide instance of
TransformationService |
void |
start() |
void |
stop()
Stops the
MuleContext which stops all sessions and connectors |
void |
unregisterListener(ServerNotificationListener l)
Unregisters a previously registered listener.
|
boolean |
waitUntilStarted(int timeout)
Makes the caller wait until the
MuleContext was started |
public static final String LOCAL_TRANSIENT_OBJECT_STORE_KEY
public static final String LOCAL_PERSISTENT_OBJECT_STORE_KEY
public static final String LOCAL_OBJECT_STORE_MANAGER_KEY
public static final String LOCAL_QUEUE_MANAGER_KEY
protected MuleContextLifecycleManager lifecycleManager
protected ServerNotificationManager notificationManager
protected MuleClient localMuleClient
protected SystemExceptionHandler exceptionListener
@Deprecated public DefaultMuleContext(MuleConfiguration config, MuleContextLifecycleManager lifecycleManager, ServerNotificationManager notificationManager)
public DefaultMuleContext()
protected DefaultRegistryBroker createRegistryBroker()
protected MuleRegistry createRegistryHelper(DefaultRegistryBroker registry)
public 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
MuleContext which stops all sessions and connectorsstop in interface org.mule.runtime.api.lifecycle.Stoppableorg.mule.runtime.api.exception.MuleException - if either any of the sessions or connectors fail to stoppublic void dispose()
dispose in interface org.mule.runtime.api.lifecycle.Disposablepublic boolean isInitialised()
isInitialised in interface MuleContextpublic boolean isInitialising()
isInitialising in interface MuleContextpublic boolean isStopped()
isStopped in interface MuleContextpublic boolean isStopping()
isStopping in interface MuleContextpublic boolean isStarted()
isStarted in interface MuleContextpublic boolean isStarting()
isStarting in interface MuleContextpublic boolean isDisposed()
isDisposed in interface MuleContextpublic boolean isDisposing()
isDisposing in interface MuleContextpublic LifecycleManager getLifecycleManager()
getLifecycleManager in interface MuleContextpublic AllStatistics getStatistics()
getStatistics in interface MuleContextpublic void registerListener(ServerNotificationListener l) throws NotificationException
MuleContextregisterListener in interface MuleContextl - the listener to registerNotificationExceptionpublic void registerListener(ServerNotificationListener l, String resourceIdentifier) throws NotificationException
MuleContextregisterListener in interface MuleContextl - the listener to registerresourceIdentifier - a particular resource name for the given type of listener For example, the resourceName could be
the name of a service if the listener was a ServiceNotificationListenerNotificationExceptionpublic void unregisterListener(ServerNotificationListener l)
MuleContextunregisterListener in interface MuleContextl - the listener to unregisterpublic void fireNotification(ServerNotification notification)
CustomNotificationListener notificationManager.fireNotification in interface MuleContextnotification - the notification to fire. This must be of type
CustomNotification otherwise an exception will be thrown.UnsupportedOperationException - if the notification fired is not a
CustomNotificationpublic void setSecurityManager(SecurityManager securityManager) throws RegistrationException
setSecurityManager in interface MuleContextsecurityManager - the security manager used by this Mule instance to authenticate and authorise incoming and outgoing
event traffic and service invocationsRegistrationExceptionpublic SecurityManager getSecurityManager()
getSecurityManager in interface MuleContextpublic SchedulerService getSchedulerService()
getSchedulerService in interface MuleContextpublic SchedulerConfig getSchedulerBaseConfig()
getSchedulerBaseConfig in interface MuleContextpublic QueueManager getQueueManager()
MuleContextgetQueueManager in interface MuleContextpublic ExtensionManager getExtensionManager()
getExtensionManager in interface MuleContextpublic org.mule.runtime.api.store.ObjectStoreManager getObjectStoreManager()
getObjectStoreManager in interface MuleContextpublic ObjectSerializer getObjectSerializer()
ObjectSerializer to be used to serialize/deserealize objectsgetObjectSerializer in interface MuleContextObjectSerializerpublic org.mule.runtime.api.store.ObjectStoreManager getLocalObjectStoreManager()
ObjectStoreManager that creates ObjectStore instances which are
only local to the current node. This is just a workaround until we introduce a solution for durable persistent stores in HA.
This is not part of Mule's API and you should not use this in your apps or extensionsObjectStoreManagerpublic QueueManager getLocalQueueManager()
QueueManager that creates Queue instances which are only local
to the current node. This is just a workaround until we introduce a solution for durable persistent queues in HA. This is not
part of Mule's API and you should not use this in your apps or extensionsQueueManagerpublic void setQueueManager(QueueManager queueManager) throws RegistrationException
MuleContextsetQueueManager in interface MuleContextRegistrationExceptionpublic MuleConfiguration getConfiguration()
getConfiguration in interface MuleContextpublic ServerNotificationManager getNotificationManager()
getNotificationManager in interface MuleContextpublic void setTransactionManager(TransactionManager manager) throws RegistrationException
setTransactionManager in interface MuleContextmanager - the manager to useRegistrationException - if a transaction manager has already been setpublic TransactionManager getTransactionManager()
getTransactionManager in interface MuleContextprotected void checkLifecycleForPropertySet(String propertyName, String phase) throws IllegalStateException
IllegalStateExceptionpublic MuleRegistry getRegistry()
getRegistry in interface MuleContextpublic Injector getInjector()
Injector capable of injecting dependencies into objectsgetInjector in interface MuleContextInjectorpublic StreamCloserService getStreamCloserService()
StreamCloserServicegetStreamCloserService in interface MuleContextStreamCloserServicepublic long getStartDate()
getStartDate in interface MuleContextpublic void setExecutionClassLoader(ClassLoader cl)
setExecutionClassLoader in interface MuleContextpublic ClassLoader getExecutionClassLoader()
getExecutionClassLoader in interface MuleContext@Deprecated public void addRegistry(Registry registry)
addRegistry in interface MuleContext@Deprecated public void removeRegistry(Registry registry)
removeRegistry in interface MuleContextpublic MuleClient getClient()
getClient in interface MuleContextpublic void handleException(Exception e, RollbackSourceCallback rollbackMethod)
handleException in interface MuleContextpublic void handleException(Exception e)
handleException in interface MuleContextpublic SystemExceptionHandler getExceptionListener()
getExceptionListener in interface MuleContextpublic void setExceptionListener(SystemExceptionHandler exceptionListener)
setExceptionListener in interface MuleContextpublic void setObjectStore(String name, ListableObjectStore<Serializable> store) throws RegistrationException
setObjectStore in interface MuleContextRegistrationExceptionpublic String getClusterId()
getClusterId in interface MuleContextpublic int getClusterNodeId()
getClusterNodeId in interface MuleContextpublic void setSchedulerController(SchedulerController schedulerController)
public boolean isPrimaryPollingInstance()
isPrimaryPollingInstance in interface MuleContextpublic String getUniqueIdString()
MuleContextgetUniqueIdString in interface MuleContextpublic Map<QName,Set<Object>> getConfigurationAnnotations()
MuleContextgetConfigurationAnnotations in interface MuleContextpublic MessagingExceptionHandler getDefaultErrorHandler()
getDefaultErrorHandler in interface MuleContextpublic SingleResourceTransactionFactoryManager getTransactionFactoryManager()
getTransactionFactoryManager in interface MuleContextpublic DataTypeConversionResolver getDataTypeConverterResolver()
getDataTypeConverterResolver in interface MuleContextDataTypeConversionResolver instance to resolve implicit data type conversionspublic ExtendedExpressionManager getExpressionManager()
getExpressionManager in interface MuleContextExtendedExpressionManager for evaluating expressions using Mule as the contextpublic org.mule.runtime.api.lock.LockFactory getLockFactory()
MuleContextgetLockFactory in interface MuleContextpublic ProcessingTimeWatcher getProcessorTimeWatcher()
getProcessorTimeWatcher in interface MuleContextpublic boolean waitUntilStarted(int timeout)
throws InterruptedException
MuleContextMuleContext was startedwaitUntilStarted in interface MuleContexttimeout - maximum number of milliseconds that will be waitingInterruptedException - if the current thread is interrupted while waitingpublic void setMuleConfiguration(MuleConfiguration muleConfiguration)
public void setNotificationManager(ServerNotificationManager notificationManager)
public void setLifecycleManager(MuleContextLifecycleManager lifecyleManager)
public void setRegistryBroker(DefaultRegistryBroker registryBroker)
public void setInjector(Injector injector)
public void setMuleRegistry(MuleRegistryHelper muleRegistry)
public void setLocalMuleClient(MuleClient muleClient)
public void setExtensionManager(ExtensionManager extensionManager)
public void setObjectSerializer(ObjectSerializer objectSerializer)
public ArtifactType getArtifactType()
MuleContextArtifactType indicating if this configuration object is for an application or a domain.getArtifactType in interface MuleContextpublic void setArtifactType(ArtifactType artifactType)
public FlowTraceManager getFlowTraceManager()
getFlowTraceManager in interface MuleContextpublic Collection<ExceptionContextProvider> getExceptionContextProviders()
getExceptionContextProviders in interface MuleContextpublic TransformationService getTransformationService()
MuleContextTransformationService used for applying
Transformer's to a Message and for obtaining different representations
of the message payload.getTransformationService in interface MuleContextpublic void setTransformationService(TransformationService transformationService)
MuleContextTransformationServicesetTransformationService in interface MuleContexttransformationService - transformation service instancepublic BootstrapServiceDiscoverer getRegistryBootstrapServiceDiscoverer()
getRegistryBootstrapServiceDiscoverer in interface MuleContextBootstrapServiceDiscoverer used to bootstrap this MuleContextpublic org.mule.runtime.api.config.custom.CustomizationService getCustomizationService()
CustomizationService to change the default services provided by the MuleContext.
Any usage of this service after the MuleContext initialization will be disregarded.getCustomizationService in interface MuleContextpublic void setBootstrapServiceDiscoverer(BootstrapServiceDiscoverer bootstrapServiceDiscoverer)
MuleContextBootstrapServiceDiscoverersetBootstrapServiceDiscoverer in interface MuleContextbootstrapServiceDiscoverer - bootstrap service discoverer instance. Non null.public ConfigurationComponentLocator getConfigurationComponentLocator()
getConfigurationComponentLocator in interface MuleContextpublic String getId()
getId in interface MuleContextpublic void setErrorTypeLocator(ErrorTypeLocator errorTypeLocator)
public ErrorTypeLocator getErrorTypeLocator()
getErrorTypeLocator in interface MuleContextErrorTypes related to exceptions and components.public ErrorTypeRepository getErrorTypeRepository()
getErrorTypeRepository in interface MuleContextErrorType instances of this
artifact.public ProcessorInterceptorProvider getProcessorInterceptorManager()
getProcessorInterceptorManager in interface MuleContextpublic void setProcessorInterceptorManager(ProcessorInterceptorProvider processorInterceptorManager)
public void setErrorTypeRepository(ErrorTypeRepository errorTypeRepository)
Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.