org.picocontainer.gems.jmx
Class JMXExposed<T>
java.lang.Object
org.picocontainer.behaviors.AbstractBehavior<T>
org.picocontainer.gems.jmx.JMXExposed<T>
- All Implemented Interfaces:
- Serializable, org.picocontainer.Behavior<T>, org.picocontainer.ComponentAdapter<T>, org.picocontainer.ComponentLifecycle<T>, org.picocontainer.ComponentMonitorStrategy, org.picocontainer.LifecycleStrategy
public class JMXExposed<T>
- extends org.picocontainer.behaviors.AbstractBehavior<T>
ComponentAdapter that is exposing a component as MBean in a MBeanServer.
- Author:
- Jörg Schaible
- See Also:
- Serialized Form
| Nested classes/interfaces inherited from interface org.picocontainer.ComponentAdapter |
org.picocontainer.ComponentAdapter.NOTHING |
| Fields inherited from class org.picocontainer.behaviors.AbstractBehavior |
delegate |
| Methods inherited from class org.picocontainer.behaviors.AbstractBehavior |
accept, changeMonitor, componentHasLifecycle, currentMonitor, dispose, findAdapterOfType, getComponentImplementation, getComponentInstance, getComponentKey, getDelegate, isStarted, start, start, stop, stop, toString, verify |
JMXExposed
public JMXExposed(org.picocontainer.ComponentAdapter<T> delegate,
MBeanServer mBeanServer,
DynamicMBeanProvider[] providers)
throws NullPointerException
- Construct a JMXExposed behaviour
- Parameters:
delegate - The delegated ComponentAdapter.mBeanServer - The MBeanServer used for registering the MBean.providers - An array with providers for converting the component instance into a
DynamicMBean.
- Throws:
NullPointerException - Thrown if the MBeanServer or the array with the DynamicMBeanProvider
instances is null.
JMXExposed
public JMXExposed(org.picocontainer.ComponentAdapter<T> delegate,
MBeanServer mBeanServer)
throws NullPointerException
- Construct a JMXExposed behaviour. This instance uses a
DynamicMBeanComponentProvider as default to
register any component instance in the MBeanServer, that is already a
DynamicMBean.
- Parameters:
delegate - The delegated ComponentAdapter.mBeanServer - The MBeanServer used for registering the MBean.
- Throws:
NullPointerException - Thrown if the MBeanServer or the array with the DynamicMBeanProvider
instances is null.
getComponentInstance
public T getComponentInstance(org.picocontainer.PicoContainer container,
Type into)
throws org.picocontainer.PicoCompositionException
- Retrieve the component instance. The implementation will automatically register it in the
MBeanServer,
if a provider can return a DynamicMBean for it.
Note, that you will have to wrap this ComponentAdapter with a Cached to avoid
the registration of the same component again.
- Specified by:
getComponentInstance in interface org.picocontainer.ComponentAdapter<T>- Overrides:
getComponentInstance in class org.picocontainer.behaviors.AbstractBehavior<T>
- Throws:
org.picocontainer.PicoCompositionException - Thrown by the delegate or if the registering of the
DynamicMBean in the MBeanServer fails.- See Also:
AbstractBehavior#getComponentInstance(org.picocontainer.PicoContainer, java.lang.Class)
getDescriptor
public String getDescriptor()
dispose
public void dispose(Object component)
- Specified by:
dispose in interface org.picocontainer.LifecycleStrategy- Overrides:
dispose in class org.picocontainer.behaviors.AbstractBehavior<T>
hasLifecycle
public boolean hasLifecycle(Class<?> type)
- Specified by:
hasLifecycle in interface org.picocontainer.LifecycleStrategy- Overrides:
hasLifecycle in class org.picocontainer.behaviors.AbstractBehavior<T>
Copyright © 2003-2009 Codehaus. All Rights Reserved.