org.mule.umo.model
Interface UMOModel

All Superinterfaces:
Disposable, Initialisable, Lifecycle, Startable, Stoppable
All Known Implementing Classes:
MuleModel

public interface UMOModel
extends Lifecycle, Initialisable

The UMOModel encapsulates and manages the runtime behaviour of a Mule Server instance. It is responsible for maintaining the UMOs instances and their configuration.

Version:
$Revision: 1.5 $
Author:
Ross Mason

Method Summary
 UMOComponentFactory getComponentFactory()
          Returns the factory used to create component wrappers that are registered on the Model
 java.util.Iterator getComponentNames()
          Gets an iterator of all component names registered in the model
 UMOSession getComponentSession(java.lang.String muleName)
          Returns the Component for the given Mule name.
 UMODescriptor getDescriptor(java.lang.String name)
          Returns a descriptor for the given component name
 UMOEntryPointResolver getEntryPointResolver()
          The entry point resolver is used to determine the method to be called on a component when an event is received for it.
 java.beans.ExceptionListener getExceptionListener()
          The exception strategy to use by components managed by the model.
 UMOLifecycleAdapterFactory getLifecycleAdapterFactory()
          The lifecycle adapter is used by the model to translate Mule lifecycle event to events that UMO components registered with the model understand.
 java.lang.String getName()
          The model's name.
 boolean isComponentRegistered(java.lang.String name)
          Determines if a UMO component descriptor by the given name is regestered with the model
 void pauseComponent(java.lang.String name)
          Pauses event processing for a single Mule Component.
 UMOComponent registerComponent(UMODescriptor descriptor)
          Registers a UMODescriptor with the MuleManager.
 void resumeComponent(java.lang.String name)
          Resumes a single Mule Component that has been paused.
 void setComponentFactory(UMOComponentFactory factory)
          Sets the factory used to create component wrappers that are registered on the Model
 void setComponents(java.util.List descriptors)
          A convenience method to set a list of components on the model.
 void setEntryPointResolver(UMOEntryPointResolver entryPointResolver)
          This will be used to build entry points on the components registered with the model.
 void setExceptionListener(java.beans.ExceptionListener listener)
          The exception strategy to use by components managed by the model.
 void setLifecycleAdapterFactory(UMOLifecycleAdapterFactory lifecycleAdapterFactory)
          Sets the lifecycleAdapterFactory on the model.
 void setName(java.lang.String name)
          Sets the model's name.
 void startComponent(java.lang.String name)
          Starts a single Mule Component.
 void stopComponent(java.lang.String name)
          Stops a single Mule Component.
 void unregisterComponent(UMODescriptor descriptor)
          Unregisters a component From the model
 
Methods inherited from interface org.mule.umo.lifecycle.Startable
start
 
Methods inherited from interface org.mule.umo.lifecycle.Stoppable
stop
 
Methods inherited from interface org.mule.umo.lifecycle.Disposable
dispose
 
Methods inherited from interface org.mule.umo.lifecycle.Initialisable
initialise
 

Method Detail

setName

public void setName(java.lang.String name)
Sets the model's name. It is poosible to configure more than one model in a config file. The name can then be used to reference the Model use when starting the server

Parameters:
name - the model's name

getName

public java.lang.String getName()
The model's name. It is poosible to configure more than one model in a config file. The name can then be used to reference the Model use when starting the server

Returns:
the model's name

getEntryPointResolver

public UMOEntryPointResolver getEntryPointResolver()
The entry point resolver is used to determine the method to be called on a component when an event is received for it.

Returns:
Returns the entryPointResolver.

setEntryPointResolver

public void setEntryPointResolver(UMOEntryPointResolver entryPointResolver)
This will be used to build entry points on the components registered with the model.

Parameters:
entryPointResolver - The entryPointResolver to set. This will be used to build entry points on the components registered with the model.

registerComponent

public UMOComponent registerComponent(UMODescriptor descriptor)
                               throws UMOException
Registers a UMODescriptor with the MuleManager. The manager will take care of creating the Mule UMO and, it's component and proxies.

Parameters:
descriptor - the UMODescriptor to register
Throws:
UMOException

unregisterComponent

public void unregisterComponent(UMODescriptor descriptor)
                         throws UMOException
Unregisters a component From the model

Parameters:
descriptor - the descriptor of the componnt to remove
Throws:
UMOException - if the compoennt is not registered or it failed to be disposing or the descriptor is null

isComponentRegistered

public boolean isComponentRegistered(java.lang.String name)
Determines if a UMO component descriptor by the given name is regestered with the model

Parameters:
name - the name of the UMO
Returns:
true if the UMO's descriptor has benn registered with the model
See Also:
UMODescriptor

getLifecycleAdapterFactory

public UMOLifecycleAdapterFactory getLifecycleAdapterFactory()
The lifecycle adapter is used by the model to translate Mule lifecycle event to events that UMO components registered with the model understand. The UMOLifecycleAdapterFactory is used by the model to instanciate LifecycleAdapters.

Returns:
Returns the lifecycleAdapterFactory used by this Model.
See Also:
@UMOLifecycleAdapter

setLifecycleAdapterFactory

public void setLifecycleAdapterFactory(UMOLifecycleAdapterFactory lifecycleAdapterFactory)
Sets the lifecycleAdapterFactory on the model.

Parameters:
lifecycleAdapterFactory - The lifecycleAdapterFactory to set on this model.
See Also:
UMOLifecycleAdapterFactory, UMOLifecycleAdapter

getComponentSession

public UMOSession getComponentSession(java.lang.String muleName)
Returns the Component for the given Mule name.

Parameters:
muleName - the Name of the Mule Component to obtain a session for
Returns:
a UMOSession for the given name or null if the component is not registered

setComponents

public void setComponents(java.util.List descriptors)
                   throws UMOException
A convenience method to set a list of components on the model. This method will most likely be used when the model is being constructed from an IoC container

Parameters:
descriptors -
Throws:
UMOException

getExceptionListener

public java.beans.ExceptionListener getExceptionListener()
The exception strategy to use by components managed by the model. The exception strategy is used when an exception occurs while processing the current event for a component. A component can define it's own exception strategy, but if it doesn't this implmentation will be used.

Returns:
the default exception strategy for this model.
See Also:
ExceptionListener

setExceptionListener

public void setExceptionListener(java.beans.ExceptionListener listener)
The exception strategy to use by components managed by the model. The exception strategy is used when an exception occurs while processing the current event for a component. A component can define it's own exception strategy, but if it doesn't this implmentation will be used.

Parameters:
listener - the default exception strategy for this model.
See Also:
ExceptionListener

getDescriptor

public UMODescriptor getDescriptor(java.lang.String name)
Returns a descriptor for the given component name

Parameters:
name - the name of the component
Returns:
a descriptor for the given component name or null if there is no component registered by that name
See Also:
UMODescriptor

stopComponent

public void stopComponent(java.lang.String name)
                   throws UMOException
Stops a single Mule Component. This can be useful when stopping and starting some Mule UMOs while letting others continue. When a component is stopped all listeners for that component are unregistered.

Parameters:
name - the name of the Mule UMO to stop
Throws:
UMOException - if the MuleUMO is not registered or the component failed to stop

startComponent

public void startComponent(java.lang.String name)
                    throws UMOException
Starts a single Mule Component. This can be useful when stopping and starting some Mule UMOs while letting others continue.

Parameters:
name - the name of the Mule UMO to start
Throws:
UMOException - if the MuleUMO is not registered or the component failed to start

pauseComponent

public void pauseComponent(java.lang.String name)
                    throws UMOException
Pauses event processing for a single Mule Component. Unlike stopComponent(), a paused component will still consume messages from the underlying transport, but those messages will be queued until the component is resumed. In order to persist these queued messages you can set the 'recoverableMode' property on the Muleconfiguration to true. this causes all internal queues to store their state.

Parameters:
name - the name of the Mule UMO to stop
Throws:
UMOException - if the MuleUMO is not registered or the component failed to pause.
See Also:
MuleConfiguration

resumeComponent

public void resumeComponent(java.lang.String name)
                     throws UMOException
Resumes a single Mule Component that has been paused. If the component is not paused nothing is executed.

Parameters:
name - the name of the Mule UMO to resume
Throws:
UMOException - if the MuleUMO is not registered or the component failed to resume

getComponentNames

public java.util.Iterator getComponentNames()
Gets an iterator of all component names registered in the model

Returns:
an iterator of all component names

setComponentFactory

public void setComponentFactory(UMOComponentFactory factory)
Sets the factory used to create component wrappers that are registered on the Model

Parameters:
factory - the factory used to create component wrappers that are registered on the Model

getComponentFactory

public UMOComponentFactory getComponentFactory()
Returns the factory used to create component wrappers that are registered on the Model

Returns:
the factory used to create component wrappers that are registered on the Model


Copyright © 2003-2005 SymphonySoft Limited. All Rights Reserved.