org.picocontainer.gems.jmx
Class NamingConventionConstructingProvider

java.lang.Object
  extended by org.picocontainer.gems.jmx.AbstractConstructingProvider
      extended by org.picocontainer.gems.jmx.NamingConventionConstructingProvider
All Implemented Interfaces:
DynamicMBeanProvider

public class NamingConventionConstructingProvider
extends AbstractConstructingProvider

A DynamicMBeanProvider that constructs StandardMBean instances that follow the JMX naming conventions. The name of the management interface must follow the naming conventions with an MBean appended to the MBean's type. The implementation will use the registered MBeanInfoProvider instances of type ComponentKeyConventionMBeanInfoProvider and ComponentTypeConventionMBeanInfoProvider to provide a MBeanInfo for the component's MBean. If a MBeanInfo was found, the MBean's type is used from the MBeanInfo otherwise the type is the implementation class of the component.

Author:
Jörg Schaible

Constructor Summary
NamingConventionConstructingProvider(ObjectNameFactory factory)
          Construct a NamingConventionConstructingProvider.
 
Method Summary
protected  Class getManagementInterface(Class implementation, MBeanInfo mBeanInfo)
          Determin the default management interface using naming convetions of the JMX specification.
protected  DynamicMBeanFactory getMBeanFactory()
          Return a StandardMBeanFactory.
 MBeanInfoProvider[] getMBeanInfoProviders()
          Return an array with an instance of type ComponentKeyConventionMBeanInfoProvider and ComponentTypeConventionMBeanInfoProvider.
 ObjectNameFactory getObjectNameFactory()
          Deliver the ObjectNameFactory used to provide the ObjectName instances registering the MBeans.
 
Methods inherited from class org.picocontainer.gems.jmx.AbstractConstructingProvider
provide
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamingConventionConstructingProvider

public NamingConventionConstructingProvider(ObjectNameFactory factory)
Construct a NamingConventionConstructingProvider. Following MBeanInfoProvider instances are registered with this constructor:

Parameters:
factory - The ObjectNameFactory used to name the created MBeans.
Method Detail

getMBeanFactory

protected DynamicMBeanFactory getMBeanFactory()
Return a StandardMBeanFactory.

Specified by:
getMBeanFactory in class AbstractConstructingProvider
Returns:
Returns the DynamicMBeanFactory to use.
See Also:
AbstractConstructingProvider.getMBeanFactory()

getObjectNameFactory

public ObjectNameFactory getObjectNameFactory()
Description copied from class: AbstractConstructingProvider
Deliver the ObjectNameFactory used to provide the ObjectName instances registering the MBeans.

Specified by:
getObjectNameFactory in class AbstractConstructingProvider
Returns:
Return the ObjectNameFactory instance.
See Also:
AbstractConstructingProvider.getObjectNameFactory()

getMBeanInfoProviders

public MBeanInfoProvider[] getMBeanInfoProviders()
Return an array with an instance of type ComponentKeyConventionMBeanInfoProvider and ComponentTypeConventionMBeanInfoProvider.

Specified by:
getMBeanInfoProviders in class AbstractConstructingProvider
Returns:
Return an array of MBeanInfoProvider instances.
See Also:
AbstractConstructingProvider.getMBeanInfoProviders()

getManagementInterface

protected Class getManagementInterface(Class implementation,
                                       MBeanInfo mBeanInfo)
                                throws ClassNotFoundException
Determin the default management interface using naming convetions of the JMX specification.

Specified by:
getManagementInterface in class AbstractConstructingProvider
Parameters:
implementation - The type of the component's implementation.
mBeanInfo - The MBeanInfo to expose the component. May be null.
Returns:
Returns the management interface.
Throws:
ClassNotFoundException - Thrown if no interface can be determined.


Copyright © 2003-2010 Codehaus. All Rights Reserved.