org.mule.management.agents
Class WrapperManagerAgent

java.lang.Object
  extended by org.mule.management.agents.WrapperManagerAgent
All Implemented Interfaces:
Disposable, Initialisable, Lifecycle, Startable, Stoppable, UMOAgent

public class WrapperManagerAgent
extends Object
implements UMOAgent

This agent integrates Java Service Wrapper into Mule. See http://wrapper.tanukisoftware.org for more details.


Field Summary
static String DEFAULT_WRAPPER_MBEAN_NAME
          For cases when Mule is embedded in another process and that external process had registered the MBean.
static String WRAPPER_OBJECT_NAME
          MBean name to register under.
 
Constructor Summary
WrapperManagerAgent()
           
 
Method Summary
 void dispose()
          A lifecycle method where implementor should free up any resources.
 String getDescription()
          Should be a 1 line description of the agent
 String getName()
          Gets the name of this agent
 void initialise()
          Method used to perform any initialisation work.
protected  void lazyInitWrapperManager()
           
 void registered()
           
 void setName(String name)
          Sets the name of this agent
 void start()
           
 void stop()
           
 void unregistered()
           
protected  void unregisterMBeansIfNecessary()
          Unregister all MBeans if there are any left over the old deployment
protected  void unregisterMeQuietly()
          Quietly unregister ourselves.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WRAPPER_OBJECT_NAME

public static final String WRAPPER_OBJECT_NAME
MBean name to register under.

See Also:
Constant Field Values

DEFAULT_WRAPPER_MBEAN_NAME

public static final String DEFAULT_WRAPPER_MBEAN_NAME
For cases when Mule is embedded in another process and that external process had registered the MBean.

See Also:
Constant Field Values
Constructor Detail

WrapperManagerAgent

public WrapperManagerAgent()
Method Detail

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 UMOException
Specified by:
start in interface Startable
Throws:
UMOException

stop

public void stop()
          throws UMOException
Specified by:
stop in interface Stoppable
Throws:
UMOException

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

registered

public void registered()
Specified by:
registered in interface UMOAgent

unregistered

public void unregistered()
Specified by:
unregistered in interface UMOAgent

getDescription

public String getDescription()
Description copied from interface: UMOAgent
Should be a 1 line description of the agent

Specified by:
getDescription in interface UMOAgent
Returns:

getName

public String getName()
Description copied from interface: UMOAgent
Gets the name of this agent

Specified by:
getName in interface UMOAgent
Returns:
the agent name

setName

public void setName(String name)
Description copied from interface: UMOAgent
Sets the name of this agent

Specified by:
setName in interface UMOAgent
Parameters:
name - the name of the agent

lazyInitWrapperManager

protected void lazyInitWrapperManager()

unregisterMBeansIfNecessary

protected void unregisterMBeansIfNecessary()
                                    throws javax.management.MalformedObjectNameException,
                                           javax.management.InstanceNotFoundException,
                                           javax.management.MBeanRegistrationException
Unregister all MBeans if there are any left over the old deployment

Throws:
javax.management.MalformedObjectNameException
javax.management.InstanceNotFoundException
javax.management.MBeanRegistrationException

unregisterMeQuietly

protected void unregisterMeQuietly()
Quietly unregister ourselves.



Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.