org.apache.camel.management
Class MaskRequiredModelMBean
java.lang.Object
javax.management.modelmbean.RequiredModelMBean
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.
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 |
MaskRequiredModelMBean
public MaskRequiredModelMBean()
throws MBeanException,
RuntimeOperationsException
- Throws:
MBeanException
RuntimeOperationsException
MaskRequiredModelMBean
public MaskRequiredModelMBean(ModelMBeanInfo mbi,
boolean mask)
throws MBeanException,
RuntimeOperationsException
- Throws:
MBeanException
RuntimeOperationsException
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 invokedvalue
- the current value
- Returns:
- the masked value
Apache Camel