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.jboss.mx.server
Class AbstractMBeanInvoker

    java.lang.Object
      org.jboss.mx.server.AbstractMBeanInvoker

All Implemented Interfaces:
  DynamicMBean, MBeanInvoker, MBeanRegistration, NotificationBroadcaster, NotificationEmitter, Suspendable

Direct Known Subclasses:
  ModelMBeanInvoker, RawDynamicInvoker

public abstract class AbstractMBeanInvoker
extends Object
implements MBeanInvoker

A base MBeanInvoker class that provides common state as well as

Version:
  $Revision: 1.34.2.1 $
Author:
  Juha Lindfors., Scott.Stark@jboss.org

Nested Class Summary
`protected class` | `AbstractMBeanInvoker.OperationKey`

Field Summary
`protected Map` | `attributeContextMap`
`protected Map` | `constructorContextMap`
`protected boolean` | `dynamicResource` Whether this is a dynamic resource
`protected InvocationContext` | `getMBeanInfoCtx`
`protected MBeanInfo` | `info` The metadata describing this MBean.
`protected org.jboss.logging.Logger` | `log`
`protected Map` | `operationContextMap`
`protected InvocationContext` | `postDeregisterCtx`
`protected InvocationContext` | `postRegisterCtx`
`protected InvocationContext` | `preDeregisterCtx`
`protected InvocationContext` | `preRegisterCtx`
`protected MBeanEntry` | `resourceEntry` The mbean server register entry used for the TCL

Constructor Summary
`AbstractMBeanInvoker()` Constructs a new invoker.
`AbstractMBeanInvoker(MBeanEntry resourceEntry)` Constructs an invoker with the target resource entry.
`AbstractMBeanInvoker(Object resource)` Constructs a new invoker with a given target resource.

Method Summary
`void` | `addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)` Add a listener to an MBean.
`protected void` | `addNotificationListenerToResource(NotificationListener listener, NotificationFilter filter, Object handback)`
`Object` | `getAttribute(String attribute)` Returns an attribte value.
`AttributeList` | `getAttributes(String[] attributes)` Returns the values of the attributes with names matching the passed string array.
`long` | `getInvocationTimeout()`
`static MBeanEntry` | `getMBeanEntry()` An accessor for the MBeanEntry thread local
`MBeanInfo` | `getMBeanInfo()` Returns the management interface that describes this dynamic resource.
`MBeanInfo` | `getMetaData()`
`MBeanNotificationInfo[]` | `getNotificationInfo()` Returns the notification metadata associated with the MBean.
`protected MBeanNotificationInfo[]` | `getNotificationInfoFromResource()`
`ObjectName` | `getObjectName()`
`Object` | `getResource()`
`MBeanServer` | `getServer()`
`protected String` | `getSignatureString(String[] signature)`
`protected void` | `initAttributeContexts(MBeanAttributeInfo[] attributes)`
`protected void` | `initDispatchers()`
`protected void` | `initOperationContexts(MBeanOperationInfo[] operations)`
`protected void` | `inject(String type, String name, Class argType, Object value)` Inject context from the xmbean layer to the resource
`Object` | `invoke(String operationName, Object[] args, String[] signature)` Invokes the target resource.
`protected void` | `invokePostDeregister()`
`protected void` | `invokePostRegister(Boolean b)`
`protected void` | `invokePreDeregister()`
`protected ObjectName` | `invokePreRegister(MBeanServer server, ObjectName name)`
`boolean` | `isSuspended()`
`protected void` | `override(Invocation invocation)` Placeholder to allow subclasses to override the invocation
`void` | `postDeregister()` This method is called by the MBeanServer after deregistration takes place.
`void` | `postRegister(Boolean registrationSuccessful)` This method is called by the MBeanServer after registration takes place or when registration fails.
`void` | `preDeregister()` This method is called by the MBeanServer before deregistration takes place.
`ObjectName` | `preRegister(MBeanServer server, ObjectName name)` Initializes this invoker.
`void` | `removeNotificationListener(NotificationListener listener)` Removes a listener from an MBean.
`void` | `removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)` Removes a listener from the Emitter.
`protected void` | `removeNotificationListenerFromResource(NotificationListener listener)`
`protected void` | `removeNotificationListenerFromResource(NotificationListener listener, NotificationFilter filter, Object handback)`
`void` | `resume()`
`void` | `setAttribute(Attribute attribute)` Sets an attribute value.
`AttributeList` | `setAttributes(AttributeList attributes)` Sets the values of the attributes passed as an `AttributeList` of name and new value pairs.
`void` | `setInvocationTimeout(long time)`
`static void` | `setMBeanEntry(MBeanEntry entry)` Set the MBeanEntry thread local value.
`void` | `setResource(Object resource)` Sets the XMBean resource and optionally allows the resource to interact with the jmx microkernel via the following injection points: #ModelMBeanConstants.MBEAN_SERVER_INJECTION_TYPE #ModelMBeanConstants.MBEAN_INFO_INJECTION_TYPE #ModelMBeanConstants.OBJECT_NAME_INJECTION_TYPE
`void` | `suspend()`
`void` | `suspend(boolean force)`
`void` | `suspend(long wait)`
`void` | `updateAttributeInfo(Descriptor attrDesc)`

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

Field Detail

### resourceEntry

    protected MBeanEntry resourceEntry

  The mbean server register entry used for the TCL

### dynamicResource

    protected boolean dynamicResource

  Whether this is a dynamic resource

### info

    protected MBeanInfo info

  The metadata describing this MBean.

### attributeContextMap

    protected Map attributeContextMap

### operationContextMap

    protected Map operationContextMap

### constructorContextMap

    protected Map constructorContextMap

### getMBeanInfoCtx

    protected InvocationContext getMBeanInfoCtx

### preRegisterCtx

    protected InvocationContext preRegisterCtx

### postRegisterCtx

    protected InvocationContext postRegisterCtx

### preDeregisterCtx

    protected InvocationContext preDeregisterCtx

### postDeregisterCtx

    protected InvocationContext postDeregisterCtx

### log

    protected org.jboss.logging.Logger log

Constructor Detail

### AbstractMBeanInvoker

    public AbstractMBeanInvoker()

  Constructs a new invoker.

### AbstractMBeanInvoker

    public AbstractMBeanInvoker(Object resource)

  Constructs a new invoker with a given target resource.

### AbstractMBeanInvoker

    public AbstractMBeanInvoker(MBeanEntry resourceEntry)

  Constructs an invoker with the target resource entry.

Parameters:
  `resourceEntry` -

Method Detail

### setMBeanEntry

    public static void setMBeanEntry(MBeanEntry entry)

  Set the MBeanEntry thread local value.

  Parameters:
    `entry` - - the entry that will be used on successful registration

### getMBeanEntry

    public static MBeanEntry getMBeanEntry()

  An accessor for the MBeanEntry thread local

  Returns:

### updateAttributeInfo

    public void updateAttributeInfo(Descriptor attrDesc)
                             throws MBeanException

  Specified by:
    `updateAttributeInfo` in interface `MBeanInvoker`
  Throws:
    `MBeanException`

### invoke

    public Object invoke(String operationName,
                         Object[] args,
                         String[] signature)
                  throws MBeanException,
                         ReflectionException

  Invokes the target resource. The default invocation used by this invoker implement sends the invocation through a stack of interceptors before reaching the target method.

  Specified by:
    `invoke` in interface `DynamicMBean`
  Parameters:
    `operationName` - name of the target method
    `args` - argumetns for the target method
    `signature` - signature of the target method
  Returns:
    the result of the operation.
  Throws:
    `MBeanException` - if the target method raised a hecked exception
    `ReflectionException` - if there was an error trying to resolve or invoke the target method
    `RuntimeMBeanException` - if the target method raised an unchecked exception

### getAttribute

    public Object getAttribute(String attribute)
                        throws AttributeNotFoundException,
                               MBeanException,
                               ReflectionException

  Returns an attribte value. The request for the value is forced through a set of interceptors before the value is returned.

  Specified by:
    `getAttribute` in interface `DynamicMBean`
  Parameters:
    `attribute` - attribute name
  Returns:
    attribute value
  Throws:
    `AttributeNotFoundException` - if the requested attribute is not part of the MBean's management interface
    `MBeanException` - if retrieving the attribute value causes an application exception
    `ReflectionException` - if there was an error trying to retrieve the attribute value

### setAttribute

    public void setAttribute(Attribute attribute)
                      throws AttributeNotFoundException,
                             InvalidAttributeValueException,
                             MBeanException,
                             ReflectionException

  Sets an attribute value. The operation is forced through a set of interceptors before the new value for the attribute is set.

  Specified by:
    `setAttribute` in interface `DynamicMBean`
  Parameters:
    `attribute` - new attribute value
  Throws:
    `AttributeNotFoundException` - if the requested attribute is not part of the MBean's management interface
    `InvalidAttributeValueException` - if the attribute contains a value not suitable for the attribute
    `MBeanException` - if setting the attribute value causes an application exception
    `ReflectionException` - if there was an error trying to set the attribute value.
  See Also:
    `Attribute`

### getMBeanInfo

    public MBeanInfo getMBeanInfo()

  Description copied from interface: `DynamicMBean`
  Returns the management interface that describes this dynamic resource. It is the responsibility of the implementation to make sure the description is accurate.

  Specified by:
    `getMBeanInfo` in interface `DynamicMBean`
  Returns:
    the management interface.

### getAttributes

    public AttributeList getAttributes(String[] attributes)

  Description copied from interface: `DynamicMBean`
  Returns the values of the attributes with names matching the passed string array.

  Specified by:
    `getAttributes` in interface `DynamicMBean`
  Parameters:
    `attributes` - the names of the attribute.
  Returns:
    an `AttributeList` of name and value pairs.

### setAttributes

    public AttributeList setAttributes(AttributeList attributes)

  Description copied from interface: `DynamicMBean`
  Sets the values of the attributes passed as an `AttributeList` of name and new value pairs.

  Specified by:
    `setAttributes` in interface `DynamicMBean`
  Parameters:
    `attributes` - the name an new value pairs.
  Returns:
    an `AttributeList` of name and value pairs that were actually set.

### preRegister

    public ObjectName preRegister(MBeanServer server,
                                  ObjectName name)
                           throws Exception

  Initializes this invoker. At the registration time we can be sure that all of the metadata is available and initialize the invoker and cache the data accordingly.

  Subclasses that override the `preRegister` method must make sure they call `super.preRegister()` in their implementation to ensure proper initialization of the invoker.

  Specified by:
    `preRegister` in interface `MBeanRegistration`
  Returns:
    the actual ObjectName to register this MBean with.
  Throws:
    `Exception` - for any error, the MBean is not registered.

### postRegister

    public void postRegister(Boolean registrationSuccessful)

  Description copied from interface: `MBeanRegistration`
  This method is called by the MBeanServer after registration takes place or when registration fails.

  Specified by:
    `postRegister` in interface `MBeanRegistration`
  Parameters:
    `registrationSuccessful` - the MBeanServer passes true when the MBean was registered, false otherwise.

### preDeregister

    public void preDeregister()
                       throws Exception

  Description copied from interface: `MBeanRegistration`
  This method is called by the MBeanServer before deregistration takes place.

  The MBean can throw an exception, this will stop the deregistration. The exception is forwarded to the invoker wrapped in an MBeanRegistrationException.

  Specified by:
    `preDeregister` in interface `MBeanRegistration`
  Throws:
    `Exception`

### postDeregister

    public void postDeregister()

  Description copied from interface: `MBeanRegistration`
  This method is called by the MBeanServer after deregistration takes place.

  Specified by:
    `postDeregister` in interface `MBeanRegistration`

### addNotificationListener

    public void addNotificationListener(NotificationListener listener,
                                        NotificationFilter filter,
                                        Object handback)

  Description copied from interface: `NotificationBroadcaster`
  Add a listener to an MBean.

  Specified by:
    `addNotificationListener` in interface `NotificationBroadcaster`
  Parameters:
    `listener` - implementation of the listener object
    `filter` - implementation of the filter object or `null` if no filtering is required
    `handback` - A handback object associated with each notification sent by this notification broadcaster.

### addNotificationListenerToResource

    protected void addNotificationListenerToResource(NotificationListener listener,
                                                     NotificationFilter filter,
                                                     Object handback)

### removeNotificationListener

    public void removeNotificationListener(NotificationListener listener)
                                    throws ListenerNotFoundException

  Description copied from interface: `NotificationBroadcaster`
  Removes a listener from an MBean.

  Specified by:
    `removeNotificationListener` in interface `NotificationBroadcaster`
  Parameters:
    `listener` - the listener object to remove
  Throws:
    `ListenerNotFoundException` - if the listener was not found

### removeNotificationListenerFromResource

    protected void removeNotificationListenerFromResource(NotificationListener listener)
                                                   throws ListenerNotFoundException

  Throws:
    `ListenerNotFoundException`

### removeNotificationListener

    public void removeNotificationListener(NotificationListener listener,
                                           NotificationFilter filter,
                                           Object handback)
                                    throws ListenerNotFoundException

  Description copied from interface: `NotificationEmitter`
  Removes a listener from the Emitter.

  Only the listener, filter, handback triplet is removed

  Specified by:
    `removeNotificationListener` in interface `NotificationEmitter`
  Parameters:
    `listener` - the listener object to remove
    `filter` - the filter registered with the listener
    `handback` - the handback object associated with the registered listener
  Throws:
    `ListenerNotFoundException` - if the listener was not found

### removeNotificationListenerFromResource

    protected void removeNotificationListenerFromResource(NotificationListener listener,
                                                          NotificationFilter filter,
                                                          Object handback)
                                                   throws ListenerNotFoundException

  Throws:
    `ListenerNotFoundException`

### getNotificationInfo

    public MBeanNotificationInfo[] getNotificationInfo()

  Description copied from interface: `NotificationBroadcaster`
  Returns the notification metadata associated with the MBean.

  Specified by:
    `getNotificationInfo` in interface `NotificationBroadcaster`
  Returns:
    MBean's notification metadata
  See Also:
    `MBeanNotificationInfo`

### getNotificationInfoFromResource

    protected MBeanNotificationInfo[] getNotificationInfoFromResource()

### getResource

    public Object getResource()

  Specified by:
    `getResource` in interface `MBeanInvoker`

### setResource

    public void setResource(Object resource)

  Sets the XMBean resource and optionally allows the resource to interact with the jmx microkernel via the following injection points: #ModelMBeanConstants.MBEAN_SERVER_INJECTION_TYPE #ModelMBeanConstants.MBEAN_INFO_INJECTION_TYPE #ModelMBeanConstants.OBJECT_NAME_INJECTION_TYPE

  Specified by:
    `setResource` in interface `MBeanInvoker`
  Parameters:
    `resource` - - the model mbean resource

### getMetaData

    public MBeanInfo getMetaData()

  Specified by:
    `getMetaData` in interface `MBeanInvoker`

### getObjectName

    public ObjectName getObjectName()

  Specified by:
    `getObjectName` in interface `MBeanInvoker`

### suspend

    public void suspend()

  Specified by:
    `suspend` in interface `Suspendable`

### suspend

    public void suspend(long wait)
                 throws TimeoutException

  Specified by:
    `suspend` in interface `Suspendable`
  Throws:
    `TimeoutException`

### suspend

    public void suspend(boolean force)

  Specified by:
    `suspend` in interface `Suspendable`

### isSuspended

    public boolean isSuspended()

  Specified by:
    `isSuspended` in interface `Suspendable`

### setInvocationTimeout

    public void setInvocationTimeout(long time)

  Specified by:
    `setInvocationTimeout` in interface `Suspendable`

### getInvocationTimeout

    public long getInvocationTimeout()

  Specified by:
    `getInvocationTimeout` in interface `Suspendable`

### resume

    public void resume()

  Specified by:
    `resume` in interface `Suspendable`

### getServer

    public MBeanServer getServer()

### inject

    protected void inject(String type,
                          String name,
                          Class argType,
                          Object value)

  Inject context from the xmbean layer to the resource

  Parameters:
    `type` - - the type of injection
    `name` - - the setter method name of the resource
    `argType` - - the injection data type
    `value` - - the injection data value to pass to the setter

### invokePreRegister

    protected ObjectName invokePreRegister(MBeanServer server,
                                           ObjectName name)
                                    throws Exception

  Throws:
    `Exception`

### invokePostRegister

    protected void invokePostRegister(Boolean b)

### invokePreDeregister

    protected void invokePreDeregister()
                                throws Exception

  Throws:
    `Exception`

### invokePostDeregister

    protected void invokePostDeregister()

### initAttributeContexts

    protected void initAttributeContexts(MBeanAttributeInfo[] attributes)

### initOperationContexts

    protected void initOperationContexts(MBeanOperationInfo[] operations)

### initDispatchers

    protected void initDispatchers()

### override

    protected void override(Invocation invocation)
                     throws MBeanException

  Placeholder to allow subclasses to override the invocation

  Parameters:
    `invocation` - the invocation
  Throws:
    `MBeanException` - for any error

### getSignatureString

    protected String getSignatureString(String[] signature)

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 © 2002 JBoss Group, LLC. All Rights Reserved.