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

org.apache.avalon.phoenix.components.manager.AbstractSystemManager
  |
  +--org.apache.avalon.phoenix.components.manager.AbstractJMXManager
All Implemented Interfaces:
SystemManager

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

Fields inherited from interface org.apache.avalon.phoenix.interfaces.SystemManager
ROLE
 
Constructor Summary
AbstractJMXManager()
           
 
Method Summary
protected abstract  javax.management.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(javax.management.modelmbean.ModelMBeanInfo topic, Object target, String targetName)
          Exports the topic to the management repository.
protected  String getDomain()
           
protected  javax.management.MBeanServer getMBeanServer()
           
 void initialize()
           
protected  void setDomain(String domain)
           
protected  void setMBeanServer(javax.management.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
 

Constructor Detail

AbstractJMXManager

public AbstractJMXManager()
Method Detail

initialize

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

start

public void start()
           throws Exception

stop

public void stop()
          throws 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.
Overrides:
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.
Overrides:
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.
Overrides:
verifyInterface in class AbstractSystemManager
Parameters:
clazz - the interface class
Throws:
ManagerException - if verification fails

getMBeanServer

protected javax.management.MBeanServer getMBeanServer()

setMBeanServer

protected void setMBeanServer(javax.management.MBeanServer mBeanServer)

getDomain

protected String getDomain()

setDomain

protected void setDomain(String domain)

createMBeanServer

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

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

exportTopic

protected Object exportTopic(javax.management.modelmbean.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


Copyright © 2001 Apache Jakarta Project. All Rights Reserved.