org.apache.camel.management
Class MaskRequiredModelMBean

java.lang.Object
  extended by javax.management.modelmbean.RequiredModelMBean
      extended by org.apache.camel.management.MaskRequiredModelMBean
All Implemented Interfaces:
DynamicMBean, MBeanRegistration, ModelMBean, ModelMBeanNotificationBroadcaster, NotificationBroadcaster, NotificationEmitter, PersistentMBean

public class MaskRequiredModelMBean
extends RequiredModelMBean

A RequiredModelMBean which allows us to intercept invoking operations on the MBean.

For example if mask has been enabled on JMX, then we use this implementation to hide sensitive information from the returned JMX attributes / operations.


Constructor Summary
MaskRequiredModelMBean()
           
MaskRequiredModelMBean(ModelMBeanInfo mbi, boolean mask)
           
 
Method Summary
 Object invoke(String opName, Object[] opArgs, String[] sig)
           
 boolean isMask()
           
protected  boolean isMaskOperation(String opName)
           
protected  String mask(String opName, String value)
          Masks the returned value from invoking the operation
 
Methods inherited from class javax.management.modelmbean.RequiredModelMBean
addAttributeChangeNotificationListener, addNotificationListener, getAttribute, getAttributes, getClassLoaderRepository, getMBeanInfo, getNotificationInfo, load, postDeregister, postRegister, preDeregister, preRegister, removeAttributeChangeNotificationListener, removeNotificationListener, removeNotificationListener, sendAttributeChangeNotification, sendAttributeChangeNotification, sendNotification, sendNotification, setAttribute, setAttributes, setManagedResource, setModelMBeanInfo, store
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MaskRequiredModelMBean

public MaskRequiredModelMBean()
                       throws MBeanException,
                              RuntimeOperationsException
Throws:
MBeanException
RuntimeOperationsException

MaskRequiredModelMBean

public MaskRequiredModelMBean(ModelMBeanInfo mbi,
                              boolean mask)
                       throws MBeanException,
                              RuntimeOperationsException
Throws:
MBeanException
RuntimeOperationsException
Method Detail

isMask

public boolean isMask()

invoke

public Object invoke(String opName,
                     Object[] opArgs,
                     String[] sig)
              throws MBeanException,
                     ReflectionException
Specified by:
invoke in interface DynamicMBean
Overrides:
invoke in class RequiredModelMBean
Throws:
MBeanException
ReflectionException

isMaskOperation

protected boolean isMaskOperation(String opName)

mask

protected String mask(String opName,
                      String value)
Masks the returned value from invoking the operation

Parameters:
opName - the operation name invoked
value - the current value
Returns:
the masked value


Apache Camel