org.apache.avalon.phoenix.components.manager
Class AbstractJMXManager

java.lang.Object
  |
  +--AbstractLogEnabled
        |
        +--org.apache.avalon.phoenix.components.manager.AbstractSystemManager
              |
              +--org.apache.avalon.phoenix.components.manager.AbstractJMXManager
All Implemented Interfaces:
SystemManager
Direct Known Subclasses:
MX4JSystemManager

public abstract class AbstractJMXManager
extends AbstractSystemManager

An abstract class via which JMX Managers can extend.

Version:
$Revision: 1.5 $ $Date: 2002/08/06 11:57:40 $
Author:
Peter Donald, Huw Roberts
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.apache.avalon.phoenix.interfaces.SystemManager
ROLE
 
Constructor Summary
AbstractJMXManager()
           
 
Method Summary
protected abstract  MBeanServer createMBeanServer()
          Creates a new MBeanServer.
protected  Target createTarget(String name, Object object, Class[] interfaces)
          Creates a target that can then be exported for management.
 void dispose()
           
protected  Object export(String name, Object object, Class[] interfaces)
          Export the object to the particular management medium using the supplied object and interfaces.
protected  void exportTarget(Target target)
          Exports the target to the management repository.
protected  Object exportTopic(ModelMBeanInfo topic, Object target, String targetName)
          Exports the topic to the management repository.
protected  String getDomain()
           
protected  MBeanServer getMBeanServer()
           
 void initialize()
           
protected  void setDomain(String domain)
           
protected  void setMBeanServer(MBeanServer mBeanServer)
           
 void start()
           
 void stop()
           
protected  void unexport(String name, Object exportedObject)
          Stop the exported object from being managed.
protected  void verifyInterface(Class clazz)
          Verify that an interface conforms to the requirements of management medium.
 
Methods inherited from class org.apache.avalon.phoenix.components.manager.AbstractSystemManager
getSubContext, register, register, unregister, verifyName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractJMXManager

public AbstractJMXManager()
Method Detail

initialize

public void initialize()
                throws Exception
Overrides:
initialize in class AbstractSystemManager
Exception

start

public void start()
           throws Exception
Exception

stop

public void stop()
          throws Exception
Exception

dispose

public void dispose()

export

protected Object export(String name,
                        Object object,
                        Class[] interfaces)
                 throws ManagerException
Export the object to the particular management medium using the supplied object and interfaces. This needs to be implemented by subclasses.

Specified by:
export in class AbstractSystemManager
Parameters:
name - the name of object
object - the object
interfaces - the interfaces
Returns:
the exported object
Throws:
ManagerException - if an error occurs

unexport

protected void unexport(String name,
                        Object exportedObject)
                 throws ManagerException
Stop the exported object from being managed.

Specified by:
unexport in class AbstractSystemManager
Parameters:
name - the name of object
exportedObject - the object return by export
Throws:
ManagerException - if an error occurs

verifyInterface

protected void verifyInterface(Class clazz)
                        throws ManagerException
Verify that an interface conforms to the requirements of management medium.

Specified by:
verifyInterface in class AbstractSystemManager
Parameters:
clazz - the interface class
Throws:
ManagerException - if verification fails

getMBeanServer

protected MBeanServer getMBeanServer()

setMBeanServer

protected void setMBeanServer(MBeanServer mBeanServer)

getDomain

protected String getDomain()

setDomain

protected void setDomain(String domain)

createMBeanServer

protected abstract MBeanServer createMBeanServer()
                                          throws Exception
Creates a new MBeanServer. The subclass should implement this to create specific MBeanServer.

Exception

createTarget

protected Target createTarget(String name,
                              Object object,
                              Class[] interfaces)
Creates a target that can then be exported for management. A topic is created for each interface and for topics specified in the mxinfo file, if present

Parameters:
name - name of the target
object - managed object
interfaces - interfaces to be exported
Returns:
the management target

exportTarget

protected void exportTarget(Target target)
                     throws Exception
Exports the target to the management repository. This is done by exporting each topic in the target.

Parameters:
target - the management target
Exception

exportTopic

protected Object exportTopic(ModelMBeanInfo topic,
                             Object target,
                             String targetName)
                      throws Exception
Exports the topic to the management repository. The name of the topic in the management repository will be the target name + the topic name

Parameters:
topic - the descriptor for the topic
target - to be managed
targetName - the target's name
Exception


Copyright © 2001 Apache Jakarta Project. All Rights Reserved.