IMPACT_ACTION
public static final int IMPACT_ACTION
IMPACT_ACTION_INFO
public static final int IMPACT_ACTION_INFO
IMPACT_INFO
public static final int IMPACT_INFO
IMPACT_UNKOWN
public static final int IMPACT_UNKOWN
INT
public static final String INT
NO_PARAMS
public static final String[] NO_PARAMS
OBJECT
public static final String OBJECT
ON_MBEAN
public static final boolean ON_MBEAN
ON_OBJECT
public static final boolean ON_OBJECT
READ_ONLY
public static final boolean READ_ONLY
READ_WRITE
public static final boolean READ_WRITE
STRING
public static final String STRING
_beanInfo
protected ModelMBeanInfoSupport _beanInfo
addAttributeChangeNotificationListener
public void addAttributeChangeNotificationListener(NotificationListener listener,
String name,
Object handback)
throws MBeanException,
RuntimeOperationsException,
IllegalArgumentException
addNotificationListener
public void addNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
throws IllegalArgumentException
defineAttribute
public void defineAttribute(ModelMBeanAttributeInfo attrInfo)
Define an attribute.
Explicit definition of an attribute. Reflection is used to
locate the actual getter and setter methods.
attrInfo
- ModelMBeanAttributeInfo.
defineAttribute
public void defineAttribute(String name)
Define an attribute on the managed object.
The meta data is defined by looking for standard getter and
setter methods. Descriptions are obtained with a call to
findDescription with the attribute name.
name
- The name of the attribute. Normal java bean
capitlization is enforced on this name.
defineAttribute
public void defineAttribute(String name,
boolean writable)
Define an attribute on the managed object.
The meta data is defined by looking for standard getter and
setter methods. Descriptions are obtained with a call to
findDescription with the attribute name.
name
- The name of the attribute. Normal java bean
capitlization is enforced on this name.writable
- If false, do not look for a setter.
defineAttribute
public void defineAttribute(String name,
boolean writable,
boolean onMBean)
Define an attribute on the managed object.
The meta data is defined by looking for standard getter and
setter methods. Descriptions are obtained with a call to
findDescription with the attribute name.
name
- The name of the attribute. Normal java bean
capitlization is enforced on this name.writable
- If false, do not look for a setter.onMBean
- .
defineManagedResource
protected void defineManagedResource()
Define the Managed Resource.
This method is called the first time setManagedResource is
called with a non-null object. It should be implemented by a
derived ModelMBean to define the attributes and operations
after an initial object has been set.
defineOperation
public void defineOperation(ModelMBeanOperationInfo opInfo)
Define an operation.
Explicit definition of an operation. Reflection is used to
locate method called.
defineOperation
public void defineOperation(String name,
String[] signature,
int impact)
Define an operation on the managed object.
Defines an operation with parameters. Refection is used to
determine find the method and it's return type. The description
of the method is found with a call to findDescription on
"name(signature)". The name and description of each parameter
is found with a call to findDescription with
"name(partialSignature", the returned description is for the
last parameter of the partial signature and is assumed to start
with the parameter name, followed by a colon.
name
- The name of the method call.signature
- The types of the operation parameters.impact
- Impact as defined in MBeanOperationInfo
defineOperation
public void defineOperation(String name,
String[] signature,
int impact,
boolean onMBean)
Define an operation on the managed object.
Defines an operation with parameters. Refection is used to
determine find the method and it's return type. The description
of the method is found with a call to findDescription on
"name(signature)". The name and description of each parameter
is found with a call to findDescription with
"name(partialSignature", the returned description is for the
last parameter of the partial signature and is assumed to start
with the parameter name, followed by a colon.
name
- The name of the method call.signature
- The types of the operation parameters.impact
- Impact as defined in MBeanOperationInfoonMBean
- true if the operation is defined on the mbean
defineOperation
public void defineOperation(String name,
int impact)
Define an operation on the managed object.
Defines an operation with no parameters. Refection is used to
determine the return type and the description is found with a
call to findDescription on "name()".
name
- Name of the method callimpact
- Impact as defined in MBeanOperationInfo
destroyComponentMBeans
protected void destroyComponentMBeans(Map map)
Unregister mbeans for already registered components
getAttribute
public Object getAttribute(String name)
throws AttributeNotFoundException,
MBeanException,
ReflectionException
getAttributes
public AttributeList getAttributes(String[] names)
getBaseObjectName
public String getBaseObjectName()
getComponentMBeans
protected ObjectName[] getComponentMBeans(Object[] components,
Map map)
Get Component MBeans.
Creates, registers and deregisters MBeans for an array of components.
On each call the passed map is used to determine components that have
already been registers and those that need to be deregistered.
components
- the components.map
- A map of previously registered components to object
name. If null is passed, a default map for the mbean is used.
- An array of ObjectNames for each component.
getDefaultDomain
public static String getDefaultDomain()
getMBeanInfo
public MBeanInfo getMBeanInfo()
getMBeanServer
public MBeanServer getMBeanServer()
getManagedResource
public Object getManagedResource()
getNotificationInfo
public MBeanNotificationInfo[] getNotificationInfo()
getObjectName
public ObjectName getObjectName()
invoke
public Object invoke(String name,
Object[] params,
String[] signature)
throws MBeanException,
ReflectionException
load
public void load()
throws MBeanException,
RuntimeOperationsException,
InstanceNotFoundException
mbeanFor
public static ModelMBean mbeanFor(Object o)
Create MBean for Object.
Attempts to create an MBean for the object by searching the
package and class name space. For example an object of the
type
class com.acme.MyClass extends com.acme.util.BaseClass
Then this method would look for the following
classes:
- com.acme.MyClassMBean
- com.acme.jmx.MyClassMBean
- com.acme.util.BaseClassMBean
- com.acme.util.jmx.BaseClassMBean
- A new instance of an MBean for the object or null.
newObjectName
protected ObjectName newObjectName(MBeanServer server)
Create a new ObjectName.
Return a new object name. The default implementation is the
results of uniqueObjectName(baseObjectName), if baseObjectName
is not set, then the results of uniqueObjectName(defaultDomain+":");
postDeregister
public void postDeregister()
Post Deregister.
This implementation destroys this MBean and it cannot be used again.
postRegister
public void postRegister(Boolean ok)
preDeregister
public void preDeregister()
preRegister
public ObjectName preRegister(MBeanServer server,
ObjectName oName)
Pre registration notification.
If this method is specialized by a derived class that may set
the objectName, then it should call this implementation with
the new objectName.
removeAttributeChangeNotificationListener
public void removeAttributeChangeNotificationListener(NotificationListener listener,
String name)
throws MBeanException,
RuntimeOperationsException,
ListenerNotFoundException
removeNotificationListener
public void removeNotificationListener(NotificationListener listener)
throws ListenerNotFoundException
sendAttributeChangeNotification
public void sendAttributeChangeNotification(Attribute oldAttr,
Attribute newAttr)
throws MBeanException,
RuntimeOperationsException
sendAttributeChangeNotification
public void sendAttributeChangeNotification(AttributeChangeNotification notify)
throws MBeanException,
RuntimeOperationsException
sendNotification
public void sendNotification(Notification notify)
throws MBeanException,
RuntimeOperationsException
sendNotification
public void sendNotification(String notify)
throws MBeanException,
RuntimeOperationsException
setAttribute
public void setAttribute(Attribute attr)
throws AttributeNotFoundException,
InvalidAttributeValueException,
MBeanException,
ReflectionException
setAttributes
public AttributeList setAttributes(AttributeList attrs)
setBaseObjectName
public void setBaseObjectName(String s)
setDefaultDomain
public static void setDefaultDomain(String d)
setManagedResource
public void setManagedResource(Object proxyObject,
String type)
throws MBeanException,
RuntimeOperationsException,
InstanceNotFoundException,
InvalidTargetObjectTypeException
setModelMBeanInfo
public void setModelMBeanInfo(ModelMBeanInfo info)
throws MBeanException,
RuntimeOperationsException
Not Supported.
Use RequiredModelMBean for this style of MBean creation.
store
public void store()
throws MBeanException,
RuntimeOperationsException,
InstanceNotFoundException
uniqueObjectName
public ObjectName uniqueObjectName(MBeanServer server,
Object object,
String objectName)
uniqueObjectName
public ObjectName uniqueObjectName(MBeanServer server,
String objectName)
Add an id clause to a JMX object name.
Used to make unique objectnames when there are no other
distinguishing attributes.
If the passed object name ends with '=', just a unique ID is
added. Otherwise and classname= clause is added.
- objectName with id= class.