Class MixinRequiredModelMBean
java.lang.Object
javax.management.modelmbean.RequiredModelMBean
org.apache.camel.support.management.MixinRequiredModelMBean
- All Implemented Interfaces:
DynamicMBean
,MBeanRegistration
,ModelMBean
,ModelMBeanNotificationBroadcaster
,NotificationBroadcaster
,NotificationEmitter
,PersistentMBean
A
RequiredModelMBean
which allows us to intercept invoking operations on the
MBean.
This allows us to intercept calls to custom mbeans where allows us to mix-in the standard set of mbean attributes and
operations that Camel provides out of the box.
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
ConstructorDescriptionMixinRequiredModelMBean
(ModelMBeanInfo mbi, boolean mask, ModelMBeanInfo defaultMbi, DynamicMBean defaultObject) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
isDefaultOperation
(String opName) boolean
isMask()
protected boolean
isMaskOperation
(String opName) protected String
Masks the returned value from invoking the operationMethods 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
-
Constructor Details
-
MixinRequiredModelMBean
-
MixinRequiredModelMBean
public MixinRequiredModelMBean(ModelMBeanInfo mbi, boolean mask, ModelMBeanInfo defaultMbi, DynamicMBean defaultObject) throws MBeanException, RuntimeOperationsException
-
-
Method Details
-
isMask
public boolean isMask() -
invoke
public Object invoke(String opName, Object[] opArgs, String[] sig) throws MBeanException, ReflectionException - Specified by:
invoke
in interfaceDynamicMBean
- Overrides:
invoke
in classRequiredModelMBean
- Throws:
MBeanException
ReflectionException
-
isDefaultOperation
-
isMaskOperation
-
mask
Masks the returned value from invoking the operation- Parameters:
opName
- the operation name invokedvalue
- the current value- Returns:
- the masked value
-