Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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 Class Summary

Nested classes/interfaces inherited from interface org.picocontainer.ComponentAdapter
`org.picocontainer.ComponentAdapter.NOTHING`

Field Summary

Fields inherited from class org.picocontainer.behaviors.AbstractBehavior
`delegate`

Constructor Summary
`JMXExposed(org.picocontainer.ComponentAdapter<T> delegate, MBeanServer mBeanServer)` Construct a JMXExposed behaviour.
`JMXExposed(org.picocontainer.ComponentAdapter<T> delegate, MBeanServer mBeanServer, DynamicMBeanProvider[] providers)` Construct a JMXExposed behaviour

Method Summary
`void` | `dispose(Object component)`
`T` | `getComponentInstance(org.picocontainer.PicoContainer container, Type into)` Retrieve the component instance.
`String` | `getDescriptor()`
`boolean` | `hasLifecycle(Class<?> type)`

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`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### 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.

Method Detail

### 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>`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2009 Codehaus. All Rights Reserved.