|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mule.impl.model.AbstractModel
public abstract class AbstractModel
MuleModel
is the default implementation of the UMOModel. The model
encapsulates and manages the runtime behaviour of a Mule Server instance. It is
responsible for maintaining the UMOs instances and their configuration.
Field Summary | |
---|---|
protected Map |
descriptors
Collection for mule descriptors registered in this Manager |
protected Log |
logger
logger used by this class |
Constructor Summary | |
---|---|
AbstractModel()
Default constructor |
Method Summary | |
---|---|
protected abstract UMOComponent |
createComponent(UMODescriptor descriptor)
|
void |
dispose()
Destroys any current components |
UMOComponent |
getComponent(String name)
Returns the UMOComponent object for the given component name |
Iterator |
getComponentNames()
Gets an iterator of all component names registered in the model |
UMOSession |
getComponentSession(String muleName)
Returns a valid component for the given Mule name |
UMODescriptor |
getDescriptor(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. |
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. |
String |
getName()
The model's name. |
void |
initialise()
Method used to perform any initialisation work. |
boolean |
isComponentRegistered(String name)
Determines if a UMO component descriptor by the given name is regestered with the model |
void |
pauseComponent(String name)
Pauses event processing for a single Mule Component. |
UMOComponent |
registerComponent(UMODescriptor descriptor)
Registers a UMODescriptor with the MuleManager . |
void |
resumeComponent(String name)
Resumes a single Mule Component that has been paused. |
void |
setComponents(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(ExceptionListener exceptionListener)
The exception strategy to use by components managed by the model. |
void |
setLifecycleAdapterFactory(UMOLifecycleAdapterFactory lifecycleAdapterFactory)
Sets the lifecycleAdapterFactory on the model. |
void |
setName(String name)
Sets the model's name. |
void |
start()
Starts all registered components |
void |
startComponent(String name)
Starts a single Mule Component. |
void |
stop()
Stops any registered components |
void |
stopComponent(String name)
Stops a single Mule Component. |
void |
unregisterComponent(UMODescriptor descriptor)
Unregisters a component From the model |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.mule.umo.model.UMOModel |
---|
getType |
Field Detail |
---|
protected transient Log logger
protected Map descriptors
Constructor Detail |
---|
public AbstractModel()
Method Detail |
---|
public String getName()
UMOModel
getName
in interface UMOModel
public void setName(String name)
UMOModel
setName
in interface UMOModel
name
- the model's namepublic UMOEntryPointResolver getEntryPointResolver()
UMOModel
getEntryPointResolver
in interface UMOModel
public void setEntryPointResolver(UMOEntryPointResolver entryPointResolver)
UMOModel
setEntryPointResolver
in interface UMOModel
entryPointResolver
- The entryPointResolver to set. This will be used to
build entry points on the components registered with the model.public boolean isComponentRegistered(String name)
UMOModel
isComponentRegistered
in interface UMOModel
name
- the name of the UMO
UMODescriptor
public UMOComponent registerComponent(UMODescriptor descriptor) throws UMOException
UMOModel
UMODescriptor
with the MuleManager
.
The manager will take care of creating the Mule UMO and, it's component and
proxies.
registerComponent
in interface UMOModel
descriptor
- the UMODescriptor
to register
UMOException
public void unregisterComponent(UMODescriptor descriptor) throws UMOException
UMOModel
unregisterComponent
in interface UMOModel
descriptor
- the descriptor of the componnt to remove
UMOException
- if the component is not registered or it failed to be
disposing or the descriptor is nullpublic UMOLifecycleAdapterFactory getLifecycleAdapterFactory()
UMOModel
UMOLifecycleAdapterFactory
is used by the model to instanciate
LifecycleAdapters.
getLifecycleAdapterFactory
in interface UMOModel
UMOLifecycleAdapterFactory
,
UMOLifecycleAdapter
public void setLifecycleAdapterFactory(UMOLifecycleAdapterFactory lifecycleAdapterFactory)
UMOModel
setLifecycleAdapterFactory
in interface UMOModel
lifecycleAdapterFactory
- The lifecycleAdapterFactory to set on this
model.UMOLifecycleAdapterFactory
,
UMOLifecycleAdapter
public void dispose()
dispose
in interface Disposable
public UMOSession getComponentSession(String muleName)
getComponentSession
in interface UMOModel
muleName
- the Name of the Mule for which the component is required
public void stop() throws UMOException
stop
in interface Stoppable
UMOException
- if a Component fails tcomponentpublic void start() throws UMOException
start
in interface Startable
UMOException
- if any of the components fail to startpublic void startComponent(String name) throws UMOException
startComponent
in interface UMOModel
name
- the name of the Mule UMO to start
UMOException
- if the MuleUMO is not registered or the component failed
to startpublic void stopComponent(String name) throws UMOException
stopComponent
in interface UMOModel
name
- the name of the Mule UMO to stop
UMOException
- if the MuleUMO is not registeredpublic void pauseComponent(String name) throws UMOException
pauseComponent
in interface UMOModel
name
- the name of the Mule UMO to stop
UMOException
- if the MuleUMO is not registered or the
component failed to pause.MuleConfiguration
public void resumeComponent(String name) throws UMOException
resumeComponent
in interface UMOModel
name
- the name of the Mule UMO to resume
UMOException
- if the MuleUMO is not registered or the
component failed to resumepublic void setComponents(List descriptors) throws UMOException
UMOModel
setComponents
in interface UMOModel
UMOException
public void initialise() throws InitialisationException
Initialisable
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.
initialise
in interface Initialisable
InitialisationException
- if a fatal error occurs causing the Mule
instance to shutdown
RecoverableException
- if an error occurs that can be recovered frompublic ExceptionListener getExceptionListener()
UMOModel
getExceptionListener
in interface UMOModel
ExceptionListener
public void setExceptionListener(ExceptionListener exceptionListener)
UMOModel
setExceptionListener
in interface UMOModel
exceptionListener
- the default exception strategy for this model.ExceptionListener
public UMODescriptor getDescriptor(String name)
UMOModel
getDescriptor
in interface UMOModel
name
- the name of the component
UMODescriptor
public UMOComponent getComponent(String name)
UMOModel
getComponent
in interface UMOModel
name
- the name of the component
UMOComponent
public Iterator getComponentNames()
getComponentNames
in interface UMOModel
protected abstract UMOComponent createComponent(UMODescriptor descriptor)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |