public class DynamicMBeanDelegator<TRECEIVER>
extends java.lang.Object
implements javax.management.DynamicMBean
The dynamic method invocations and attribute access will be delegated on the internally held receiver object.
The generic type TRECEIVER represents the type of the internal object that is the target for all method invocations and attribute access.
Constructor and Description |
---|
DynamicMBeanDelegator(TRECEIVER receiver)
Initialize the new instance with the target object.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getAttribute(java.lang.String attrName)
Returns the value of the attribute with the given name.
|
javax.management.AttributeList |
getAttributes(java.lang.String[] attrNames)
Returns all the attributes with the specified names.
|
protected javax.management.MBeanInfo |
getManagedBeanInfo() |
javax.management.MBeanInfo |
getMBeanInfo()
Returns the meta data describing the supported attributes and methods.
|
TRECEIVER |
getReceiver() |
java.lang.Object |
invoke(java.lang.String methodName,
java.lang.Object[] params,
java.lang.String[] signature)
Executes the methods that are supported via JMX.
|
void |
setAttribute(javax.management.Attribute attr)
Sets the specified attribute.
|
javax.management.AttributeList |
setAttributes(javax.management.AttributeList attributes)
Sets all specified attributes.
|
void |
setManagedBeanInfo(javax.management.MBeanInfo newValue) |
void |
setReceiver(TRECEIVER newValue) |
public DynamicMBeanDelegator(TRECEIVER receiver)
public java.lang.Object invoke(java.lang.String methodName, java.lang.Object[] params, java.lang.String[] signature) throws javax.management.MBeanException, javax.management.ReflectionException
invoke
in interface javax.management.DynamicMBean
javax.management.MBeanException
javax.management.ReflectionException
public java.lang.Object getAttribute(java.lang.String attrName) throws javax.management.AttributeNotFoundException, javax.management.MBeanException, ReflectionException
getAttribute
in interface javax.management.DynamicMBean
attrName
- The name of the attribute to be returnedjavax.management.AttributeNotFoundException
- if the attribute with the given name cannot be found.javax.management.MBeanException
ReflectionException
public void setAttribute(javax.management.Attribute attr) throws javax.management.AttributeNotFoundException, javax.management.InvalidAttributeValueException, javax.management.MBeanException, ReflectionException
setAttribute
in interface javax.management.DynamicMBean
attr
- The attribute with name and value.javax.management.AttributeNotFoundException
- if the attribute with the given name cannot be found.javax.management.InvalidAttributeValueException
javax.management.MBeanException
ReflectionException
public javax.management.AttributeList getAttributes(java.lang.String[] attrNames)
getAttributes
in interface javax.management.DynamicMBean
IllegalArgument
- In any case of problem setting one of the attributes.
The original exception will be available via getCause().public javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
setAttributes
in interface javax.management.DynamicMBean
IllegalArgument
- In any case of problem setting one of the attributes.
The original exception will be available via getCause().public javax.management.MBeanInfo getMBeanInfo()
setManagedBeanInfo(MBeanInfo)
method can be used to set the
meta data.getMBeanInfo
in interface javax.management.DynamicMBean
public TRECEIVER getReceiver()
public void setReceiver(TRECEIVER newValue)
public void setManagedBeanInfo(javax.management.MBeanInfo newValue)
protected javax.management.MBeanInfo getManagedBeanInfo()