|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.mortbay.util.jmx.ModelMBeanImpl
Model MBean Implementation. This implementation of the JMX Model MBean API is designed to allow easy creation of Model MBeans. From minimal descriptions of operations and attributes, reflection is used to determine the full signature and ResourceBundles are used to determine other meta data. This class is normally used in one of the following patterns:
Field Summary | |
static int |
IMPACT_ACTION
|
static int |
IMPACT_ACTION_INFO
|
static int |
IMPACT_INFO
|
static int |
IMPACT_UNKOWN
|
static java.lang.String |
INT
|
static java.lang.String[] |
NO_PARAMS
|
static java.lang.String |
OBJECT
|
static boolean |
ON_MBEAN
|
static boolean |
ON_OBJECT
|
static boolean |
READ_ONLY
|
static boolean |
READ_WRITE
|
static java.lang.String |
STRING
|
Constructor Summary | |
ModelMBeanImpl()
MBean Constructor. |
|
ModelMBeanImpl(java.lang.Object proxyObject)
Proxy MBean Constructor. |
Method Summary | |
void |
addAttributeChangeNotificationListener(javax.management.NotificationListener listener,
java.lang.String name,
java.lang.Object handback)
|
void |
addNotificationListener(javax.management.NotificationListener listener,
javax.management.NotificationFilter filter,
java.lang.Object handback)
|
void |
defineAttribute(javax.management.modelmbean.ModelMBeanAttributeInfo attrInfo)
Define an attribute. |
void |
defineAttribute(java.lang.String name)
Define an attribute on the managed object. |
void |
defineAttribute(java.lang.String name,
boolean writable)
Define an attribute on the managed object. |
void |
defineAttribute(java.lang.String name,
boolean writable,
boolean onMBean)
Define an attribute on the managed object. |
void |
defineOperation(javax.management.modelmbean.ModelMBeanOperationInfo opInfo)
Define an operation. |
void |
defineOperation(java.lang.String name,
int impact)
Define an operation on the managed object. |
void |
defineOperation(java.lang.String name,
java.lang.String[] signature,
int impact)
Define an operation on the managed object. |
void |
defineOperation(java.lang.String name,
java.lang.String[] signature,
int impact,
boolean onMBean)
Define an operation on the managed object. |
java.lang.Object |
getAttribute(java.lang.String name)
|
javax.management.AttributeList |
getAttributes(java.lang.String[] names)
|
java.lang.String |
getBaseObjectName()
|
static java.lang.String |
getDefaultDomain()
|
java.lang.Object |
getManagedResource()
|
javax.management.MBeanInfo |
getMBeanInfo()
|
javax.management.MBeanServer |
getMBeanServer()
|
javax.management.MBeanNotificationInfo[] |
getNotificationInfo()
|
javax.management.ObjectName |
getObjectName()
|
java.lang.Object |
invoke(java.lang.String name,
java.lang.Object[] params,
java.lang.String[] signature)
|
void |
load()
|
static javax.management.modelmbean.ModelMBean |
mbeanFor(java.lang.Object o)
Create MBean for Object. |
void |
postDeregister()
Post Deregister. |
void |
postRegister(java.lang.Boolean ok)
|
void |
preDeregister()
|
javax.management.ObjectName |
preRegister(javax.management.MBeanServer server,
javax.management.ObjectName oName)
Pre registration notification. |
void |
removeAttributeChangeNotificationListener(javax.management.NotificationListener listener,
java.lang.String name)
|
void |
removeNotificationListener(javax.management.NotificationListener listener)
|
void |
sendAttributeChangeNotification(javax.management.Attribute oldAttr,
javax.management.Attribute newAttr)
|
void |
sendAttributeChangeNotification(javax.management.AttributeChangeNotification notify)
|
void |
sendNotification(javax.management.Notification notify)
|
void |
sendNotification(java.lang.String notify)
|
void |
setAttribute(javax.management.Attribute attr)
|
javax.management.AttributeList |
setAttributes(javax.management.AttributeList attrs)
|
void |
setBaseObjectName(java.lang.String s)
|
static void |
setDefaultDomain(java.lang.String d)
|
void |
setManagedResource(java.lang.Object proxyObject,
java.lang.String type)
|
void |
setModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo info)
Not Supported. |
void |
store()
|
javax.management.ObjectName |
uniqueObjectName(javax.management.MBeanServer server,
java.lang.Object object,
java.lang.String objectName)
|
javax.management.ObjectName |
uniqueObjectName(javax.management.MBeanServer server,
java.lang.String objectName)
Add an id clause to a JMX object name. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int IMPACT_ACTION
public static final int IMPACT_ACTION_INFO
public static final int IMPACT_INFO
public static final int IMPACT_UNKOWN
public static final java.lang.String STRING
public static final java.lang.String OBJECT
public static final java.lang.String INT
public static final java.lang.String[] NO_PARAMS
public static final boolean READ_WRITE
public static final boolean READ_ONLY
public static final boolean ON_MBEAN
public static final boolean ON_OBJECT
Constructor Detail |
public ModelMBeanImpl()
public ModelMBeanImpl(java.lang.Object proxyObject)
proxyObject
- The actual object on which attributes and
operations are to be defined and called.Method Detail |
public static javax.management.modelmbean.ModelMBean mbeanFor(java.lang.Object o)
class com.acme.MyClass extends com.acme.util.BaseClassThen this method would look for the following classes:
o
- The object
public static java.lang.String getDefaultDomain()
public static void setDefaultDomain(java.lang.String d)
public javax.management.MBeanServer getMBeanServer()
public javax.management.ObjectName getObjectName()
public java.lang.Object getManagedResource()
public void setManagedResource(java.lang.Object proxyObject, java.lang.String type) throws javax.management.MBeanException, javax.management.RuntimeOperationsException, javax.management.InstanceNotFoundException, javax.management.modelmbean.InvalidTargetObjectTypeException
setManagedResource
in interface javax.management.modelmbean.ModelMBean
javax.management.MBeanException
javax.management.RuntimeOperationsException
javax.management.InstanceNotFoundException
javax.management.modelmbean.InvalidTargetObjectTypeException
public void setModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo info) throws javax.management.MBeanException, javax.management.RuntimeOperationsException
setModelMBeanInfo
in interface javax.management.modelmbean.ModelMBean
javax.management.MBeanException
javax.management.RuntimeOperationsException
public void defineAttribute(java.lang.String name)
name
- The name of the attribute. Normal java bean
capitlization is enforced on this name.public void defineAttribute(java.lang.String name, boolean writable)
name
- The name of the attribute. Normal java bean
capitlization is enforced on this name.writable
- If false, do not look for a setter.public void defineAttribute(java.lang.String name, boolean writable, boolean onMBean)
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
- .public void defineAttribute(javax.management.modelmbean.ModelMBeanAttributeInfo attrInfo)
attrInfo
- ModelMBeanAttributeInfo.public void defineOperation(java.lang.String name, int impact)
name
- Name of the method callimpact
- Impact as defined in MBeanOperationInfopublic void defineOperation(java.lang.String name, java.lang.String[] signature, int impact)
name
- The name of the method call.signature
- The types of the operation parameters.impact
- Impact as defined in MBeanOperationInfopublic void defineOperation(java.lang.String name, java.lang.String[] signature, int impact, boolean onMBean)
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 mbeanpublic void defineOperation(javax.management.modelmbean.ModelMBeanOperationInfo opInfo)
opInfo
- public javax.management.MBeanInfo getMBeanInfo()
getMBeanInfo
in interface javax.management.DynamicMBean
public java.lang.Object getAttribute(java.lang.String name) throws javax.management.AttributeNotFoundException, javax.management.MBeanException, javax.management.ReflectionException
getAttribute
in interface javax.management.DynamicMBean
javax.management.AttributeNotFoundException
javax.management.MBeanException
javax.management.ReflectionException
public javax.management.AttributeList getAttributes(java.lang.String[] names)
getAttributes
in interface javax.management.DynamicMBean
public void setAttribute(javax.management.Attribute attr) throws javax.management.AttributeNotFoundException, javax.management.InvalidAttributeValueException, javax.management.MBeanException, javax.management.ReflectionException
setAttribute
in interface javax.management.DynamicMBean
javax.management.AttributeNotFoundException
javax.management.InvalidAttributeValueException
javax.management.MBeanException
javax.management.ReflectionException
public javax.management.AttributeList setAttributes(javax.management.AttributeList attrs)
setAttributes
in interface javax.management.DynamicMBean
public java.lang.Object invoke(java.lang.String name, 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 void load() throws javax.management.MBeanException, javax.management.RuntimeOperationsException, javax.management.InstanceNotFoundException
load
in interface javax.management.PersistentMBean
javax.management.MBeanException
javax.management.RuntimeOperationsException
javax.management.InstanceNotFoundException
public void store() throws javax.management.MBeanException, javax.management.RuntimeOperationsException, javax.management.InstanceNotFoundException
store
in interface javax.management.PersistentMBean
javax.management.MBeanException
javax.management.RuntimeOperationsException
javax.management.InstanceNotFoundException
public void addNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback) throws java.lang.IllegalArgumentException
addNotificationListener
in interface javax.management.NotificationBroadcaster
java.lang.IllegalArgumentException
public javax.management.MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo
in interface javax.management.NotificationBroadcaster
public void removeNotificationListener(javax.management.NotificationListener listener) throws javax.management.ListenerNotFoundException
removeNotificationListener
in interface javax.management.NotificationBroadcaster
javax.management.ListenerNotFoundException
public void addAttributeChangeNotificationListener(javax.management.NotificationListener listener, java.lang.String name, java.lang.Object handback) throws javax.management.MBeanException, javax.management.RuntimeOperationsException, java.lang.IllegalArgumentException
addAttributeChangeNotificationListener
in interface javax.management.modelmbean.ModelMBeanNotificationBroadcaster
javax.management.MBeanException
javax.management.RuntimeOperationsException
java.lang.IllegalArgumentException
public void removeAttributeChangeNotificationListener(javax.management.NotificationListener listener, java.lang.String name) throws javax.management.MBeanException, javax.management.RuntimeOperationsException, javax.management.ListenerNotFoundException
removeAttributeChangeNotificationListener
in interface javax.management.modelmbean.ModelMBeanNotificationBroadcaster
javax.management.MBeanException
javax.management.RuntimeOperationsException
javax.management.ListenerNotFoundException
public void sendAttributeChangeNotification(javax.management.Attribute oldAttr, javax.management.Attribute newAttr) throws javax.management.MBeanException, javax.management.RuntimeOperationsException
sendAttributeChangeNotification
in interface javax.management.modelmbean.ModelMBeanNotificationBroadcaster
javax.management.MBeanException
javax.management.RuntimeOperationsException
public void sendAttributeChangeNotification(javax.management.AttributeChangeNotification notify) throws javax.management.MBeanException, javax.management.RuntimeOperationsException
sendAttributeChangeNotification
in interface javax.management.modelmbean.ModelMBeanNotificationBroadcaster
javax.management.MBeanException
javax.management.RuntimeOperationsException
public void sendNotification(java.lang.String notify) throws javax.management.MBeanException, javax.management.RuntimeOperationsException
sendNotification
in interface javax.management.modelmbean.ModelMBeanNotificationBroadcaster
javax.management.MBeanException
javax.management.RuntimeOperationsException
public void sendNotification(javax.management.Notification notify) throws javax.management.MBeanException, javax.management.RuntimeOperationsException
sendNotification
in interface javax.management.modelmbean.ModelMBeanNotificationBroadcaster
javax.management.MBeanException
javax.management.RuntimeOperationsException
public void setBaseObjectName(java.lang.String s)
public java.lang.String getBaseObjectName()
public javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName oName)
preRegister
in interface javax.management.MBeanRegistration
server
- oName
-
public void postRegister(java.lang.Boolean ok)
postRegister
in interface javax.management.MBeanRegistration
public void preDeregister()
preDeregister
in interface javax.management.MBeanRegistration
public void postDeregister()
postDeregister
in interface javax.management.MBeanRegistration
public javax.management.ObjectName uniqueObjectName(javax.management.MBeanServer server, java.lang.String objectName)
objectName
-
public javax.management.ObjectName uniqueObjectName(javax.management.MBeanServer server, java.lang.Object object, java.lang.String objectName)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |