## mx4j.server.interceptor
Class DefaultMBeanServerInterceptor

    java.lang.Object
      mx4j.server.interceptor.DefaultMBeanServerInterceptor

All Implemented Interfaces:
  DefaultMBeanServerInterceptorMBean, MBeanServerInterceptor

Direct Known Subclasses:
  ContextClassLoaderMBeanServerInterceptor, InvokerMBeanServerInterceptor, NotificationListenerMBeanServerInterceptor, SecurityMBeanServerInterceptor

public abstract class DefaultMBeanServerInterceptor
extends java.lang.Object
implements MBeanServerInterceptor, DefaultMBeanServerInterceptorMBean

Base class for MBeanServer --> MBean interceptors.

Version:
  $Revision: 1.11 $

Field Summary

Fields inherited from interface mx4j.server.interceptor.MBeanServerInterceptor
`POST_DEREGISTER, POST_REGISTER_FALSE, POST_REGISTER_TRUE, PRE_DEREGISTER, PRE_REGISTER`

Constructor Summary
`protected` `DefaultMBeanServerInterceptor()`

Method Summary
`void` `addNotificationListener(MBeanMetaData metadata, javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)` Adds the given notification listener to the MBean, along with the given filter and handback
`java.lang.Object` `getAttribute(MBeanMetaData metadata, java.lang.String attribute)` Gets the specified attribute value from the MBean instance.
`javax.management.AttributeList` `getAttributes(MBeanMetaData metadata, java.lang.String[] attributes)` Gets the specified attributes values from the MBean instance.
`protected Logger` `getLogger()`
`javax.management.MBeanInfo` `getMBeanInfo(MBeanMetaData metadata)` Calls getMBeanInfo on the MBean instance (only on DynamicMBeans).
`protected MBeanServerInterceptor` `getNext()`
`abstract java.lang.String` `getType()` Returns the type of this interceptor
`void` `instantiate(MBeanMetaData metadata, java.lang.String className, java.lang.String[] params, java.lang.Object[] args)` Instantiate the given className passing the given arguments to the constructor with the given signature
`java.lang.Object` `invoke(MBeanMetaData metadata, java.lang.String method, java.lang.String[] params, java.lang.Object[] args)` Invokes the specified MBean operation on the MBean instance
`boolean` `isEnabled()` Returns whether this interceptor is enabled
`void` `registration(MBeanMetaData metadata, int operation)` Calls the specified `MBeanRegistration` method on the MBean instance.
`void` `removeNotificationListener(MBeanMetaData metadata, javax.management.NotificationListener listener)` Removes the given notification listener from the MBean.
`void` `removeNotificationListener(MBeanMetaData metadata, javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)` Removes the given notification listener from the MBean, specified by the given filter and handback.
`void` `setAttribute(MBeanMetaData metadata, javax.management.Attribute attribute)` Sets the specified attribute value on the MBean instance.
`javax.management.AttributeList` `setAttributes(MBeanMetaData metadata, javax.management.AttributeList attributes)` Sets the specified attributes values on the MBean instance.
`void` `setChain(java.util.List chain)` Sets the chain of interceptors on this interceptor.
`void` `setEnabled(boolean enabled)` Enables or disables this interceptor

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

Constructor Detail

### DefaultMBeanServerInterceptor

    protected DefaultMBeanServerInterceptor()

Method Detail

### isEnabled

    public boolean isEnabled()

  Returns whether this interceptor is enabled

  Specified by:
    `isEnabled` in interface `DefaultMBeanServerInterceptorMBean`
  See Also:
    `setEnabled(boolean)`

### setEnabled

    public void setEnabled(boolean enabled)

  Enables or disables this interceptor

  Specified by:
    `setEnabled` in interface `DefaultMBeanServerInterceptorMBean`
  See Also:
    `isEnabled()`

### getType

    public abstract java.lang.String getType()

  Returns the type of this interceptor

  Specified by:
    `getType` in interface `MBeanServerInterceptor`

### getNext

    protected MBeanServerInterceptor getNext()

### setChain

    public void setChain(java.util.List chain)

  Description copied from interface: `MBeanServerInterceptor`
  Sets the chain of interceptors on this interceptor. This interceptor will use this list to find the interceptor in the chain after itself

  Specified by:
    `setChain` in interface `MBeanServerInterceptor`
  Parameters:
    `chain` - The list of interceptors

### getLogger

    protected Logger getLogger()

### addNotificationListener

    public void addNotificationListener(MBeanMetaData metadata,
                                        javax.management.NotificationListener listener,
                                        javax.management.NotificationFilter filter,
                                        java.lang.Object handback)

  Description copied from interface: `MBeanServerInterceptor`
  Adds the given notification listener to the MBean, along with the given filter and handback

  Specified by:
    `addNotificationListener` in interface `MBeanServerInterceptor`

### removeNotificationListener

    public void removeNotificationListener(MBeanMetaData metadata,
                                           javax.management.NotificationListener listener)
                                    throws javax.management.ListenerNotFoundException

  Description copied from interface: `MBeanServerInterceptor`
  Removes the given notification listener from the MBean.

  Specified by:
    `removeNotificationListener` in interface `MBeanServerInterceptor`
  Throws:
    `javax.management.ListenerNotFoundException`

### removeNotificationListener

    public void removeNotificationListener(MBeanMetaData metadata,
                                           javax.management.NotificationListener listener,
                                           javax.management.NotificationFilter filter,
                                           java.lang.Object handback)
                                    throws javax.management.ListenerNotFoundException

  Description copied from interface: `MBeanServerInterceptor`
  Removes the given notification listener from the MBean, specified by the given filter and handback.

  Specified by:
    `removeNotificationListener` in interface `MBeanServerInterceptor`
  Throws:
    `javax.management.ListenerNotFoundException`

### instantiate

    public void instantiate(MBeanMetaData metadata,
                            java.lang.String className,
                            java.lang.String[] params,
                            java.lang.Object[] args)
                     throws javax.management.ReflectionException,
                            javax.management.MBeanException

  Description copied from interface: `MBeanServerInterceptor`
  Instantiate the given className passing the given arguments to the constructor with the given signature

  Specified by:
    `instantiate` in interface `MBeanServerInterceptor`
  Throws:
    `javax.management.ReflectionException`
    `javax.management.MBeanException`

### registration

    public void registration(MBeanMetaData metadata,
                             int operation)
                      throws javax.management.MBeanRegistrationException

  Description copied from interface: `MBeanServerInterceptor`
  Calls the specified `MBeanRegistration` method on the MBean instance.

  Specified by:
    `registration` in interface `MBeanServerInterceptor`
  Throws:
    `javax.management.MBeanRegistrationException`

### getMBeanInfo

    public javax.management.MBeanInfo getMBeanInfo(MBeanMetaData metadata)

  Description copied from interface: `MBeanServerInterceptor`
  Calls getMBeanInfo on the MBean instance (only on DynamicMBeans).

  Specified by:
    `getMBeanInfo` in interface `MBeanServerInterceptor`

### invoke

    public java.lang.Object invoke(MBeanMetaData metadata,
                                   java.lang.String method,
                                   java.lang.String[] params,
                                   java.lang.Object[] args)
                            throws javax.management.MBeanException,
                                   javax.management.ReflectionException

  Description copied from interface: `MBeanServerInterceptor`
  Invokes the specified MBean operation on the MBean instance

  Specified by:
    `invoke` in interface `MBeanServerInterceptor`
  Throws:
    `javax.management.MBeanException`
    `javax.management.ReflectionException`

### getAttributes

    public javax.management.AttributeList getAttributes(MBeanMetaData metadata,
                                                        java.lang.String[] attributes)

  Description copied from interface: `MBeanServerInterceptor`
  Gets the specified attributes values from the MBean instance.

  Specified by:
    `getAttributes` in interface `MBeanServerInterceptor`

### setAttributes

    public javax.management.AttributeList setAttributes(MBeanMetaData metadata,
                                                        javax.management.AttributeList attributes)

  Description copied from interface: `MBeanServerInterceptor`
  Sets the specified attributes values on the MBean instance.

  Specified by:
    `setAttributes` in interface `MBeanServerInterceptor`

### getAttribute

    public java.lang.Object getAttribute(MBeanMetaData metadata,
                                         java.lang.String attribute)
                                  throws javax.management.MBeanException,
                                         javax.management.AttributeNotFoundException,
                                         javax.management.ReflectionException

  Description copied from interface: `MBeanServerInterceptor`
  Gets the specified attribute value from the MBean instance.

  Specified by:
    `getAttribute` in interface `MBeanServerInterceptor`
  Throws:
    `javax.management.MBeanException`
    `javax.management.AttributeNotFoundException`
    `javax.management.ReflectionException`

### setAttribute

    public void setAttribute(MBeanMetaData metadata,
                             javax.management.Attribute attribute)
                      throws javax.management.MBeanException,
                             javax.management.AttributeNotFoundException,
                             javax.management.InvalidAttributeValueException,
                             javax.management.ReflectionException

  Description copied from interface: `MBeanServerInterceptor`
  Sets the specified attribute value on the MBean instance.

  Specified by:
    `setAttribute` in interface `MBeanServerInterceptor`
  Throws:
    `javax.management.MBeanException`
    `javax.management.AttributeNotFoundException`
    `javax.management.InvalidAttributeValueException`
    `javax.management.ReflectionException`

Copyright © 2001-2003 MX4J Team. All Rights Reserved.