Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mule
Class DefaultMuleContext

    java.lang.Object
      org.mule.DefaultMuleContext

All Implemented Interfaces:
  Disposable, Initialisable, Lifecycle, Startable, Stoppable, MuleContext

    public class DefaultMuleContext

extends Object
implements MuleContext

Field Summary
`protected SystemExceptionHandler` | `exceptionListener` Global exception handler which handles "system" exceptions (i.e., when no message is involved).
`protected MuleContextLifecycleManager` | `lifecycleManager` LifecycleManager for the MuleContext.
`protected LocalMuleClient` | `localMuleClient`
`protected ServerNotificationManager` | `notificationManager`

Fields inherited from interface org.mule.api.lifecycle.Initialisable
`PHASE_NAME`

Fields inherited from interface org.mule.api.lifecycle.Startable
`PHASE_NAME`

Fields inherited from interface org.mule.api.lifecycle.Stoppable
`PHASE_NAME`

Fields inherited from interface org.mule.api.lifecycle.Disposable
`PHASE_NAME`

Constructor Summary
`DefaultMuleContext(MuleConfiguration config, WorkManager workManager, javax.resource.spi.work.WorkListener workListener, MuleContextLifecycleManager lifecycleManager, ServerNotificationManager notificationManager)`

Method Summary
`void` | `addRegistry(Registry registry)`
`protected SplashScreen` | `buildShutdownSplash()`
`protected SplashScreen` | `buildStartupSplash()`
`protected void` | `checkLifecycleForPropertySet(String propertyName, String phase)`
`protected DefaultRegistryBroker` | `createRegistryBroker()`
`protected MuleRegistry` | `createRegistryHelper(DefaultRegistryBroker registry)`
`void` | `dispose()` A lifecycle method where implementor should free up any resources.
`void` | `fireNotification(ServerNotification notification)` Fires a server notification to all registered `CustomNotificationListener` notificationManager.
`LocalMuleClient` | `getClient()`
`MuleConfiguration` | `getConfiguration()`
`ThreadingProfile` | `getDefaultMessageDispatcherThreadingProfile()`
`ThreadingProfile` | `getDefaultMessageReceiverThreadingProfile()`
`ThreadingProfile` | `getDefaultMessageRequesterThreadingProfile()`
`ThreadingProfile` | `getDefaultServiceThreadingProfile()`
`ThreadingProfile` | `getDefaultThreadingProfile()`
`SystemExceptionHandler` | `getExceptionListener()`
`ClassLoader` | `getExecutionClassLoader()`
`ExpressionManager` | `getExpressionManager()` Returns the Expression Manager configured for this instance of Mule
`LifecycleManager` | `getLifecycleManager()`
`ServerNotificationManager` | `getNotificationManager()`
`QueueManager` | `getQueueManager()` Gets the queue manager used by mule for queuing events.
`MuleRegistry` | `getRegistry()`
`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
`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
`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)`
`void` | `setExceptionListener(SystemExceptionHandler exceptionListener)`
`void` | `setExecutionClassLoader(ClassLoader cl)`
`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 `MuleContext` which stops all sessions and connectors
`void` | `unregisterListener(ServerNotificationListener l)` Unregisters a previously registered listener.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### lifecycleManager

    protected MuleContextLifecycleManager lifecycleManager

  LifecycleManager for the MuleContext. Note: this is NOT the same lifecycle manager as the one in the Registry.

### notificationManager

    protected ServerNotificationManager notificationManager

### localMuleClient

    protected LocalMuleClient localMuleClient

### exceptionListener

    protected SystemExceptionHandler exceptionListener

  Global exception handler which handles "system" exceptions (i.e., when no message is involved).

Constructor Detail

### DefaultMuleContext

    public DefaultMuleContext(MuleConfiguration config,
                              WorkManager workManager,
                              javax.resource.spi.work.WorkListener workListener,
                              MuleContextLifecycleManager lifecycleManager,
                              ServerNotificationManager notificationManager)

Method Detail

### createRegistryBroker

    protected DefaultRegistryBroker createRegistryBroker()

### createRegistryHelper

    protected MuleRegistry createRegistryHelper(DefaultRegistryBroker registry)

### initialise

    public void initialise()
                    throws InitialisationException

  Description copied from interface: `Initialisable`
  Method used to perform any initialisation work. If a fatal error occurs during initialisation an `InitialisationException` 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.

  Specified by:
    `initialise` in interface `Initialisable`
  Throws:
    `InitialisationException` - if a fatal error occurs causing the Mule instance to shutdown
    `RecoverableException` - if an error occurs that can be recovered from

### start

    public void start()
               throws MuleException

  Specified by:
    `start` in interface `Startable`
  Throws:
    `MuleException`

### stop

    public void stop()
              throws MuleException

  Stops the `MuleContext` which stops all sessions and connectors

  Specified by:
    `stop` in interface `Stoppable`
  Throws:
    `MuleException` - if either any of the sessions or connectors fail to stop

### dispose

    public void dispose()

  Description copied from interface: `Disposable`
  A lifecycle method where implementor should free up any resources. If an exception is thrown it should just be logged and processing should continue. This method should not throw Runtime exceptions.

  Specified by:
    `dispose` in interface `Disposable`

### isInitialised

    public boolean isInitialised()

  Determines if the server has been initialised

  Specified by:
    `isInitialised` in interface `MuleContext`
  Returns:
    true if the server has been initialised

### isInitialising

    public boolean isInitialising()

  Determines if the server is being initialised

  Specified by:
    `isInitialising` in interface `MuleContext`
  Returns:
    true if the server is beening initialised

### isStopped

    public boolean isStopped()

  Specified by:
    `isStopped` in interface `MuleContext`

### isStopping

    public boolean isStopping()

  Specified by:
    `isStopping` in interface `MuleContext`

### isStarted

    public boolean isStarted()

  Determines if the server has been started

  Specified by:
    `isStarted` in interface `MuleContext`
  Returns:
    true if the server has been started

### isStarting

    public boolean isStarting()

  Specified by:
    `isStarting` in interface `MuleContext`

### isDisposed

    public boolean isDisposed()

  Specified by:
    `isDisposed` in interface `MuleContext`

### isDisposing

    public boolean isDisposing()

  Specified by:
    `isDisposing` in interface `MuleContext`

### getLifecycleManager

    public LifecycleManager getLifecycleManager()

  Specified by:
    `getLifecycleManager` in interface `MuleContext`

### getStatistics

    public AllStatistics getStatistics()

  Gets all statistics for this instance

  Specified by:
    `getStatistics` in interface `MuleContext`
  Returns:
    all statistics for this instance

### registerListener

    public void registerListener(ServerNotificationListener l)
                          throws NotificationException

  Description copied from interface: `MuleContext`
  Registers an intenal server event listener. The listener will be notified when a particular event happens within the server. Typically this is not an event in the same sense as an MuleEvent (although there is nothing stopping the implementation of this class triggering listeners when a MuleEvent is received).

  The types of notifications fired is entirely defined by the implementation of this class

  Specified by:
    `registerListener` in interface `MuleContext`
  Parameters:
    `l` - the listener to register
  Throws:
    `NotificationException`

### registerListener

    public void registerListener(ServerNotificationListener l,
                                 String resourceIdentifier)
                          throws NotificationException

  Description copied from interface: `MuleContext`
  Registers an intenal server event listener. The listener will be notified when a particular event happens within the server. Typically this is not an event in the same sense as an MuleEvent (although there is nothing stopping the implementation of this class triggering listeners when a MuleEvent is received).

  The types of notifications fired is entirely defined by the implementation of this class

  Specified by:
    `registerListener` in interface `MuleContext`
  Parameters:
    `l` - the listener to register
    `resourceIdentifier` - 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 ServiceNotificationListener
  Throws:
    `NotificationException`

### unregisterListener

    public void unregisterListener(ServerNotificationListener l)

  Description copied from interface: `MuleContext`
  Unregisters a previously registered listener. If the listener has not already been registered, this method should return without exception

  Specified by:
    `unregisterListener` in interface `MuleContext`
  Parameters:
    `l` - the listener to unregister

### fireNotification

    public void fireNotification(ServerNotification notification)

  Fires a server notification to all registered `CustomNotificationListener` notificationManager.

  Specified by:
    `fireNotification` in interface `MuleContext`
  Parameters:
    `notification` - the notification to fire. This must be of type `CustomNotification` otherwise an exception will be thrown.
  Throws:
    `UnsupportedOperationException` - if the notification fired is not a `CustomNotification`

### setSecurityManager

    public void setSecurityManager(SecurityManager securityManager)
                            throws RegistrationException

  Sets the security manager used by this Mule instance to authenticate and authorise incoming and outgoing event traffic and service invocations

  Specified by:
    `setSecurityManager` in interface `MuleContext`
  Parameters:
    `securityManager` - the security manager used by this Mule instance to authenticate and authorise incoming and outgoing event traffic and service invocations
  Throws:
    `RegistrationException`

### getSecurityManager

    public SecurityManager getSecurityManager()

  Gets the security manager used by this Mule instance to authenticate and authorise incoming and outgoing event traffic and service invocations

  Specified by:
    `getSecurityManager` in interface `MuleContext`
  Returns:
    he security manager used by this Mule instance to authenticate and authorise incoming and outgoing event traffic and service invocations

### getWorkManager

    public WorkManager getWorkManager()

  Obtains a workManager instance that can be used to schedule work in a thread pool. This will be used primarially by Agents wanting to schedule work. This work Manager must never be used by provider implementations as they have their own workManager accible on the connector.

  If a workManager has not been set by the time the `initialise()` method has been called a default `MuleWorkManager` will be created using the DefaultThreadingProfile on the `MuleConfiguration` object.

  Specified by:
    `getWorkManager` in interface `MuleContext`
  Returns:
    a workManager instance used by the current MuleManager
  See Also:
    `ThreadingProfile`, `DefaultMuleConfiguration`

### getWorkListener

    public javax.resource.spi.work.WorkListener getWorkListener()

  Specified by:
    `getWorkListener` in interface `MuleContext`

### getQueueManager

    public QueueManager getQueueManager()

  Description copied from interface: `MuleContext`
  Gets the queue manager used by mule for queuing events. This is used for service queues.

  Specified by:
    `getQueueManager` in interface `MuleContext`

### setQueueManager

    public void setQueueManager(QueueManager queueManager)
                         throws RegistrationException

  Description copied from interface: `MuleContext`
  Sets the queue manager used by mule for queuing events. This is used for service queues

  Specified by:
    `setQueueManager` in interface `MuleContext`
  Throws:
    `RegistrationException`

### getConfiguration

    public MuleConfiguration getConfiguration()

  Specified by:
    `getConfiguration` in interface `MuleContext`
  Returns:
    the MuleConfiguration for this MuleManager. This object is immutable once the manager has initialised.

### getNotificationManager

    public ServerNotificationManager getNotificationManager()

  Specified by:
    `getNotificationManager` in interface `MuleContext`

### setTransactionManager

    public void setTransactionManager(TransactionManager manager)
                               throws RegistrationException

  Sets the JTA Transaction Manager to use with this Mule server instance

  Specified by:
    `setTransactionManager` in interface `MuleContext`
  Parameters:
    `manager` - the manager to use
  Throws:
    `RegistrationException` - if a transaction manager has already been set

### getTransactionManager

    public TransactionManager getTransactionManager()

  Returns the Jta transaction manager used by this Mule server instance. or null if a transaction manager has not been set

  Specified by:
    `getTransactionManager` in interface `MuleContext`
  Returns:
    the Jta transaction manager used by this Mule server instance. or null if a transaction manager has not been set

### checkLifecycleForPropertySet

    protected void checkLifecycleForPropertySet(String propertyName,
                                                String phase)
                                         throws IllegalStateException

  Throws:
    `IllegalStateException`

### getRegistry

    public MuleRegistry getRegistry()

  Specified by:
    `getRegistry` in interface `MuleContext`

### getDefaultMessageDispatcherThreadingProfile

    public ThreadingProfile getDefaultMessageDispatcherThreadingProfile()

  Specified by:
    `getDefaultMessageDispatcherThreadingProfile` in interface `MuleContext`

### getDefaultMessageRequesterThreadingProfile

    public ThreadingProfile getDefaultMessageRequesterThreadingProfile()

  Specified by:
    `getDefaultMessageRequesterThreadingProfile` in interface `MuleContext`

### getDefaultMessageReceiverThreadingProfile

    public ThreadingProfile getDefaultMessageReceiverThreadingProfile()

  Specified by:
    `getDefaultMessageReceiverThreadingProfile` in interface `MuleContext`

### getDefaultServiceThreadingProfile

    public ThreadingProfile getDefaultServiceThreadingProfile()

  Specified by:
    `getDefaultServiceThreadingProfile` in interface `MuleContext`

### getDefaultThreadingProfile

    public ThreadingProfile getDefaultThreadingProfile()

  Specified by:
    `getDefaultThreadingProfile` in interface `MuleContext`

### getStartDate

    public long getStartDate()

  Returns the long date when the server was started

  Specified by:
    `getStartDate` in interface `MuleContext`
  Returns:
    the long date when the server was started

### getExpressionManager

    public ExpressionManager getExpressionManager()

  Returns the Expression Manager configured for this instance of Mule

  Specified by:
    `getExpressionManager` in interface `MuleContext`
  Returns:
    the Expression Manager configured for this instance of Mule
  See Also:
    `ExpressionManager`

### setExecutionClassLoader

    public void setExecutionClassLoader(ClassLoader cl)

  Specified by:
    `setExecutionClassLoader` in interface `MuleContext`

### getExecutionClassLoader

    public ClassLoader getExecutionClassLoader()

  Specified by:
    `getExecutionClassLoader` in interface `MuleContext`

### addRegistry

    public void addRegistry(Registry registry)

  Specified by:
    `addRegistry` in interface `MuleContext`

### removeRegistry

    public void removeRegistry(Registry registry)

  Specified by:
    `removeRegistry` in interface `MuleContext`

### buildStartupSplash

    protected SplashScreen buildStartupSplash()

### buildShutdownSplash

    protected SplashScreen buildShutdownSplash()

### getClient

    public LocalMuleClient getClient()

  Specified by:
    `getClient` in interface `MuleContext`

### getExceptionListener

    public SystemExceptionHandler getExceptionListener()

  Specified by:
    `getExceptionListener` in interface `MuleContext`

### setExceptionListener

    public void setExceptionListener(SystemExceptionHandler exceptionListener)

  Specified by:
    `setExceptionListener` in interface `MuleContext`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2010 MuleSoft, Inc.. All Rights Reserved.