org.apache.felix.mosgi.jmx.agent.mx4j.server.interceptor
Class SecurityMBeanServerInterceptor

java.lang.Object
  extended by org.apache.felix.mosgi.jmx.agent.mx4j.server.interceptor.DefaultMBeanServerInterceptor
      extended by org.apache.felix.mosgi.jmx.agent.mx4j.server.interceptor.SecurityMBeanServerInterceptor
All Implemented Interfaces:
DefaultMBeanServerInterceptorMBean, MBeanServerInterceptor, SecurityMBeanServerInterceptorMBean

public class SecurityMBeanServerInterceptor
extends DefaultMBeanServerInterceptor
implements SecurityMBeanServerInterceptorMBean

Interceptor that takes care of performing security checks (in case the SecurityManager is installed) for MBeanServer to MBean calls.

Version:
$Revision: 1.1.1.1 $
Author:
Simone Bordet

Field Summary
 
Fields inherited from interface org.apache.felix.mosgi.jmx.agent.mx4j.server.interceptor.MBeanServerInterceptor
POST_DEREGISTER, POST_REGISTER_FALSE, POST_REGISTER_TRUE, PRE_DEREGISTER, PRE_REGISTER
 
Constructor Summary
SecurityMBeanServerInterceptor()
           
 
Method Summary
 void addNotificationListener(MBeanMetaData metadata, NotificationListener listener, NotificationFilter filter, Object handback)
          Adds the given notification listener to the MBean, along with the given filter and handback
 Object getAttribute(MBeanMetaData metadata, String attribute)
          Gets the specified attribute value from the MBean instance.
 AttributeList getAttributes(MBeanMetaData metadata, String[] attributes)
          Gets the specified attributes values from the MBean instance.
 MBeanInfo getMBeanInfo(MBeanMetaData metadata)
          Calls getMBeanInfo on the MBean instance (only on DynamicMBeans).
 String getType()
          Returns the type of this interceptor
 void instantiate(MBeanMetaData metadata, String className, String[] params, Object[] args)
          Instantiate the given className passing the given arguments to the constructor with the given signature
 Object invoke(MBeanMetaData metadata, String method, String[] params, 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, NotificationListener listener)
          Removes the given notification listener from the MBean.
 void removeNotificationListener(MBeanMetaData metadata, NotificationListener listener, NotificationFilter filter, Object handback)
          Removes the given notification listener from the MBean, specified by the given filter and handback.
 void setAttribute(MBeanMetaData metadata, Attribute attribute)
          Sets the specified attribute value on the MBean instance.
 AttributeList setAttributes(MBeanMetaData metadata, AttributeList attributes)
          Sets the specified attributes values on the MBean instance.
 
Methods inherited from class org.apache.felix.mosgi.jmx.agent.mx4j.server.interceptor.DefaultMBeanServerInterceptor
getLogger, getNext, setChain, setEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecurityMBeanServerInterceptor

public SecurityMBeanServerInterceptor()
Method Detail

getType

public String getType()
Description copied from class: DefaultMBeanServerInterceptor
Returns the type of this interceptor

Specified by:
getType in interface DefaultMBeanServerInterceptorMBean
Specified by:
getType in interface MBeanServerInterceptor
Specified by:
getType in interface SecurityMBeanServerInterceptorMBean
Specified by:
getType in class DefaultMBeanServerInterceptor

isEnabled

public boolean isEnabled()
Description copied from class: DefaultMBeanServerInterceptor
Returns whether this interceptor is enabled

Specified by:
isEnabled in interface DefaultMBeanServerInterceptorMBean
Specified by:
isEnabled in interface SecurityMBeanServerInterceptorMBean
Overrides:
isEnabled in class DefaultMBeanServerInterceptor
See Also:
DefaultMBeanServerInterceptor.setEnabled(boolean)

addNotificationListener

public void addNotificationListener(MBeanMetaData metadata,
                                    NotificationListener listener,
                                    NotificationFilter filter,
                                    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
Overrides:
addNotificationListener in class DefaultMBeanServerInterceptor

removeNotificationListener

public void removeNotificationListener(MBeanMetaData metadata,
                                       NotificationListener listener)
                                throws ListenerNotFoundException
Description copied from interface: MBeanServerInterceptor
Removes the given notification listener from the MBean.

Specified by:
removeNotificationListener in interface MBeanServerInterceptor
Overrides:
removeNotificationListener in class DefaultMBeanServerInterceptor
Throws:
ListenerNotFoundException

removeNotificationListener

public void removeNotificationListener(MBeanMetaData metadata,
                                       NotificationListener listener,
                                       NotificationFilter filter,
                                       Object handback)
                                throws 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
Overrides:
removeNotificationListener in class DefaultMBeanServerInterceptor
Throws:
ListenerNotFoundException

instantiate

public void instantiate(MBeanMetaData metadata,
                        String className,
                        String[] params,
                        Object[] args)
                 throws ReflectionException,
                        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
Overrides:
instantiate in class DefaultMBeanServerInterceptor
Throws:
ReflectionException
MBeanException

getMBeanInfo

public MBeanInfo getMBeanInfo(MBeanMetaData metadata)
Description copied from interface: MBeanServerInterceptor
Calls getMBeanInfo on the MBean instance (only on DynamicMBeans).

Specified by:
getMBeanInfo in interface MBeanServerInterceptor
Overrides:
getMBeanInfo in class DefaultMBeanServerInterceptor

invoke

public Object invoke(MBeanMetaData metadata,
                     String method,
                     String[] params,
                     Object[] args)
              throws MBeanException,
                     ReflectionException
Description copied from interface: MBeanServerInterceptor
Invokes the specified MBean operation on the MBean instance

Specified by:
invoke in interface MBeanServerInterceptor
Overrides:
invoke in class DefaultMBeanServerInterceptor
Throws:
MBeanException
ReflectionException

getAttributes

public AttributeList getAttributes(MBeanMetaData metadata,
                                   String[] attributes)
Description copied from interface: MBeanServerInterceptor
Gets the specified attributes values from the MBean instance.

Specified by:
getAttributes in interface MBeanServerInterceptor
Overrides:
getAttributes in class DefaultMBeanServerInterceptor

setAttributes

public AttributeList setAttributes(MBeanMetaData metadata,
                                   AttributeList attributes)
Description copied from interface: MBeanServerInterceptor
Sets the specified attributes values on the MBean instance.

Specified by:
setAttributes in interface MBeanServerInterceptor
Overrides:
setAttributes in class DefaultMBeanServerInterceptor

getAttribute

public Object getAttribute(MBeanMetaData metadata,
                           String attribute)
                    throws MBeanException,
                           AttributeNotFoundException,
                           ReflectionException
Description copied from interface: MBeanServerInterceptor
Gets the specified attribute value from the MBean instance.

Specified by:
getAttribute in interface MBeanServerInterceptor
Overrides:
getAttribute in class DefaultMBeanServerInterceptor
Throws:
MBeanException
AttributeNotFoundException
ReflectionException

setAttribute

public void setAttribute(MBeanMetaData metadata,
                         Attribute attribute)
                  throws MBeanException,
                         AttributeNotFoundException,
                         InvalidAttributeValueException,
                         ReflectionException
Description copied from interface: MBeanServerInterceptor
Sets the specified attribute value on the MBean instance.

Specified by:
setAttribute in interface MBeanServerInterceptor
Overrides:
setAttribute in class DefaultMBeanServerInterceptor
Throws:
MBeanException
AttributeNotFoundException
InvalidAttributeValueException
ReflectionException

registration

public void registration(MBeanMetaData metadata,
                         int operation)
                  throws MBeanRegistrationException
Description copied from interface: MBeanServerInterceptor
Calls the specified MBeanRegistration method on the MBean instance.

Specified by:
registration in interface MBeanServerInterceptor
Overrides:
registration in class DefaultMBeanServerInterceptor
Throws:
MBeanRegistrationException


Copyright © 2011 Apache Software Foundation. All Rights Reserved.