public class DefaultMuleContext extends Object implements MuleContext
| Modifier and Type | Field and Description |
|---|---|
protected LifecycleManager |
lifecycleManager
LifecycleManager for the MuleContext.
|
protected ServerNotificationManager |
notificationManager |
PHASE_NAMEPHASE_NAMEPHASE_NAMEPHASE_NAME| Constructor and Description |
|---|
DefaultMuleContext(MuleConfiguration config,
WorkManager workManager,
javax.resource.spi.work.WorkListener workListener,
LifecycleManager lifecycleManager,
ServerNotificationManager notificationManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
applyLifecycle(Object object)
Apply current phase of the LifecycleManager.
|
protected void |
checkLifecycleForPropertySet(String propertyName,
String phase) |
void |
dispose()
A lifecycle method where implementor should free up any resources.
|
void |
fireNotification(ServerNotification notification)
Fires a server notification to all registered
org.mule.api.context.notification.listener.CustomNotificationListener notificationManager. |
MuleConfiguration |
getConfiguration() |
ThreadingProfile |
getDefaultComponentThreadingProfile() |
ConnectionStrategy |
getDefaultConnectionStrategy()
Returns a clone of the default Connection strategy.
|
ThreadingProfile |
getDefaultMessageDispatcherThreadingProfile() |
ThreadingProfile |
getDefaultMessageReceiverThreadingProfile() |
ThreadingProfile |
getDefaultMessageRequesterThreadingProfile() |
ThreadingProfile |
getDefaultThreadingProfile() |
LifecycleManager |
getLifecycleManager() |
ServerNotificationManager |
getNotificationManager() |
QueueManager |
getQueueManager()
Gets the queue manager used by mule for queuing events.
|
Registry |
getRegistry()
Resolve and return a handle to the registry.
|
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 statisitcs for this instance
|
TransactionManager |
getTransactionManager()
Returns the Jta transaction manager used by this Mule server instance.
|
javax.resource.spi.work.WorkListener |
getWorkListener() |
WorkManager |
getWorkManager()
Obtains a workManager instance that can be used to schedule work in a
thread pool.
|
void |
initialise()
Method used to perform any initialisation work.
|
boolean |
isDisposed() |
boolean |
isDisposing() |
boolean |
isInitialised()
Determines if the server has been initialised
|
boolean |
isInitialising()
Determines if the server is being initialised
|
boolean |
isStarted()
Determines if the server has been started
|
protected boolean |
isStarting() |
protected boolean |
isStopped() |
protected 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 |
setQueueManager(QueueManager queueManager)
Sets the queue manager used by mule for queuing events.
|
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 |
start() |
void |
stop()
Stops the
MuleManager which stops all sessions and
connectors |
void |
unregisterListener(ServerNotificationListener l)
Unregisters a previously registered listener.
|
protected LifecycleManager lifecycleManager
protected ServerNotificationManager notificationManager
public DefaultMuleContext(MuleConfiguration config, WorkManager workManager, javax.resource.spi.work.WorkListener workListener, LifecycleManager lifecycleManager, ServerNotificationManager notificationManager)
public void initialise()
throws InitialisationException
InitialisableInitialisationException should be thrown,
causing the Mule instance to shutdown. If the error is recoverable, say by
retrying to connect, a RecoverableException should be thrown.
There is no guarantee that by throwing a Recoverable exception that the Mule
instance will not shut down.initialise in interface InitialisableInitialisationException - if a fatal error occurs causing the Mule instance to shutdownRecoverableException - if an error occurs that can be recovered frompublic void start()
throws MuleException
start in interface StartableMuleExceptionpublic void stop()
throws MuleException
MuleManager which stops all sessions and
connectorsstop in interface StoppableMuleException - if either any of the sessions or connectors fail to
stoppublic void dispose()
Disposabledispose in interface Disposablepublic boolean isInitialised()
isInitialised in interface MuleContextpublic boolean isInitialising()
isInitialising in interface MuleContextprotected boolean isStopped()
protected boolean isStopping()
public boolean isStarted()
isStarted in interface MuleContextprotected boolean isStarting()
public 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)
org.mule.api.context.notification.listener.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 WorkManager getWorkManager()
initialise() method has been called a default
MuleWorkManager will be created using the
DefaultThreadingProfile on the MuleConfiguration
object.getWorkManager in interface MuleContextThreadingProfile,
DefaultMuleConfigurationpublic javax.resource.spi.work.WorkListener getWorkListener()
getWorkListener in interface MuleContextpublic QueueManager getQueueManager()
MuleContextgetQueueManager in interface MuleContextpublic 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 useExceptionRegistrationExceptionpublic TransactionManager getTransactionManager()
getTransactionManager in interface MuleContextprotected void checkLifecycleForPropertySet(String propertyName, String phase) throws IllegalStateException
IllegalStateExceptionpublic Registry getRegistry()
getRegistry in interface MuleContextpublic void applyLifecycle(Object object) throws MuleException
applyLifecycle in interface MuleContextMuleExceptionpublic ThreadingProfile getDefaultMessageDispatcherThreadingProfile()
getDefaultMessageDispatcherThreadingProfile in interface MuleContextpublic ThreadingProfile getDefaultMessageRequesterThreadingProfile()
getDefaultMessageRequesterThreadingProfile in interface MuleContextpublic ThreadingProfile getDefaultMessageReceiverThreadingProfile()
getDefaultMessageReceiverThreadingProfile in interface MuleContextpublic ThreadingProfile getDefaultComponentThreadingProfile()
getDefaultComponentThreadingProfile in interface MuleContextpublic ThreadingProfile getDefaultThreadingProfile()
getDefaultThreadingProfile in interface MuleContextpublic ConnectionStrategy getDefaultConnectionStrategy()
getDefaultConnectionStrategy in interface MuleContextpublic long getStartDate()
getStartDate in interface MuleContextCopyright © 2003-2012 MuleSource, Inc.. All Rights Reserved.