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 JMXVisitor

    java.lang.Object
      org.picocontainer.visitors.AbstractPicoVisitor
          org.picocontainer.visitors.TraversalCheckingVisitor
              org.picocontainer.gems.jmx.JMXVisitor

All Implemented Interfaces:
  org.picocontainer.PicoVisitor

    public class JMXVisitor

extends org.picocontainer.visitors.TraversalCheckingVisitor

A `PicoVisitor` to register JMX components for components of a `PicoContainer` tree in a `MBeanServer`.

Author:
  Michael Ward, Jörg Schaible

Nested Class Summary

Nested classes/interfaces inherited from class org.picocontainer.visitors.AbstractPicoVisitor
`org.picocontainer.visitors.AbstractPicoVisitor.PicoVisitorTraversalException`

Field Summary

Fields inherited from interface org.picocontainer.PicoVisitor
`ABORT_TRAVERSAL, CONTINUE_TRAVERSAL`

Constructor Summary
`JMXVisitor(MBeanServer server)` Construct a JMXVisitor.
`JMXVisitor(MBeanServer server, DynamicMBeanProvider[] providers)` Construct a JMXVisitor.

Method Summary
`protected ObjectInstance` | `register(DynamicMBean dynamicMBean, ObjectName objectName)` Register a MBean in the MBeanServer.
`Object` | `traverse(Object node)` Entry point for the visitor traversal.
`void` | `visitComponentAdapter(org.picocontainer.ComponentAdapter componentAdapter)` Register the component as MBean.
`boolean` | `visitContainer(org.picocontainer.PicoContainer pico)` Provides the PicoContainer, that can resolve the components to register as MBean.

Methods inherited from class org.picocontainer.visitors.TraversalCheckingVisitor
`visitComponentFactory, visitParameter`

Methods inherited from class org.picocontainer.visitors.AbstractPicoVisitor
`checkTraversal`

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

Constructor Detail

### JMXVisitor

    public JMXVisitor(MBeanServer server)

  Construct a JMXVisitor. This instance will register by default any component in the `MBeanServer`, that is already a `DynamicMBean`. The `ObjectName` will use the default domain of the MBeanServer and has a type key with the class name (without package name) as value.

  Parameters:
    `server` - The `MBeanServer`to use for registering the MBeans.

### JMXVisitor

    public JMXVisitor(MBeanServer server,
                      DynamicMBeanProvider[] providers)

  Construct a JMXVisitor.

  Parameters:
    `server` - The `MBeanServer` to use for registering the MBeans.
    `providers` - The providers to deliver the DynamicMBeans.

Method Detail

### traverse

    public Object traverse(Object node)

  Entry point for the visitor traversal.

  Specified by:
    `traverse` in interface `org.picocontainer.PicoVisitor`
  Overrides:
    `traverse` in class `org.picocontainer.visitors.AbstractPicoVisitor`
  Returns:
    Returns a `Set` with all ObjectInstance instances retrieved from the `MBeanServer` for the registered MBeans.
  See Also:
    `AbstractPicoVisitor.traverse(java.lang.Object)`

### visitContainer

    public boolean visitContainer(org.picocontainer.PicoContainer pico)

  Provides the PicoContainer, that can resolve the components to register as MBean.

  Specified by:
    `visitContainer` in interface `org.picocontainer.PicoVisitor`
  Overrides:
    `visitContainer` in class `org.picocontainer.visitors.TraversalCheckingVisitor`
  See Also:
    `PicoVisitor.visitContainer(org.picocontainer.PicoContainer)`

### visitComponentAdapter

    public void visitComponentAdapter(org.picocontainer.ComponentAdapter componentAdapter)

  Register the component as MBean. The implementation uses the known DynamicMBeanProvider instances to get the MBean from the component.

  Specified by:
    `visitComponentAdapter` in interface `org.picocontainer.PicoVisitor`
  Overrides:
    `visitComponentAdapter` in class `org.picocontainer.visitors.TraversalCheckingVisitor`
  See Also:
    `PicoVisitor.visitComponentAdapter(org.picocontainer.ComponentAdapter)`

### register

    protected ObjectInstance register(DynamicMBean dynamicMBean,
                                      ObjectName objectName)
                               throws JMXRegistrationException

  Register a MBean in the MBeanServer.

  Parameters:
    `dynamicMBean` - the `DynamicMBean` to register.
    `objectName` - the `ObjectName` of the MBean registered the `MBeanServer`.
  Returns:
    Returns the `ObjectInstance` returned from the MBeanServer after registration.
  Throws:
    `JMXRegistrationException` - Thrown if MBean cannot be registered.

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.