|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openqa.jetty.util.jmx.ModelMBeanImpl
public class 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 | |
|---|---|
protected ModelMBeanInfoSupport |
_beanInfo
|
static int |
IMPACT_ACTION
|
static int |
IMPACT_ACTION_INFO
|
static int |
IMPACT_INFO
|
static int |
IMPACT_UNKOWN
|
static String |
INT
|
static String[] |
NO_PARAMS
|
static String |
OBJECT
|
static boolean |
ON_MBEAN
|
static boolean |
ON_OBJECT
|
static boolean |
READ_ONLY
|
static boolean |
READ_WRITE
|
static String |
STRING
|
| Constructor Summary | |
|---|---|
ModelMBeanImpl()
MBean Constructor. |
|
ModelMBeanImpl(Object proxyObject)
Proxy MBean Constructor. |
|
| Method Summary | |
|---|---|
void |
addAttributeChangeNotificationListener(NotificationListener listener,
String name,
Object handback)
|
void |
addNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
|
void |
defineAttribute(ModelMBeanAttributeInfo attrInfo)
Define an attribute. |
void |
defineAttribute(String name)
Define an attribute on the managed object. |
void |
defineAttribute(String name,
boolean writable)
Define an attribute on the managed object. |
void |
defineAttribute(String name,
boolean writable,
boolean onMBean)
Define an attribute on the managed object. |
protected void |
defineManagedResource()
Define the Managed Resource. |
void |
defineOperation(ModelMBeanOperationInfo opInfo)
Define an operation. |
void |
defineOperation(String name,
int impact)
Define an operation on the managed object. |
void |
defineOperation(String name,
String[] signature,
int impact)
Define an operation on the managed object. |
void |
defineOperation(String name,
String[] signature,
int impact,
boolean onMBean)
Define an operation on the managed object. |
protected void |
destroyComponentMBeans(Map map)
Unregister mbeans for already registered components |
Object |
getAttribute(String name)
|
AttributeList |
getAttributes(String[] names)
|
String |
getBaseObjectName()
|
protected ObjectName[] |
getComponentMBeans(Object[] components,
Map map)
Get Component MBeans. |
static String |
getDefaultDomain()
|
Object |
getManagedResource()
|
MBeanInfo |
getMBeanInfo()
|
MBeanServer |
getMBeanServer()
|
MBeanNotificationInfo[] |
getNotificationInfo()
|
ObjectName |
getObjectName()
|
Object |
invoke(String name,
Object[] params,
String[] signature)
|
void |
load()
|
static ModelMBean |
mbeanFor(Object o)
Create MBean for Object. |
protected ObjectName |
newObjectName(MBeanServer server)
Create a new ObjectName. |
void |
postDeregister()
Post Deregister. |
void |
postRegister(Boolean ok)
|
void |
preDeregister()
|
ObjectName |
preRegister(MBeanServer server,
ObjectName oName)
Pre registration notification. |
void |
removeAttributeChangeNotificationListener(NotificationListener listener,
String name)
|
void |
removeNotificationListener(NotificationListener listener)
|
void |
sendAttributeChangeNotification(Attribute oldAttr,
Attribute newAttr)
|
void |
sendAttributeChangeNotification(AttributeChangeNotification notify)
|
void |
sendNotification(Notification notify)
|
void |
sendNotification(String notify)
|
void |
setAttribute(Attribute attr)
|
AttributeList |
setAttributes(AttributeList attrs)
|
void |
setBaseObjectName(String s)
|
static void |
setDefaultDomain(String d)
|
void |
setManagedResource(Object proxyObject,
String type)
|
void |
setModelMBeanInfo(ModelMBeanInfo info)
Not Supported. |
void |
store()
|
ObjectName |
uniqueObjectName(MBeanServer server,
Object object,
String objectName)
|
ObjectName |
uniqueObjectName(MBeanServer server,
String objectName)
Add an id clause to a JMX object name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, 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 String STRING
public static final String OBJECT
public static final String INT
public static final 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
protected ModelMBeanInfoSupport _beanInfo
| Constructor Detail |
|---|
public ModelMBeanImpl()
public ModelMBeanImpl(Object proxyObject)
proxyObject - The actual object on which attributes and
operations are to be defined and called.| Method Detail |
|---|
public static ModelMBean mbeanFor(Object o)
class com.acme.MyClass extends com.acme.util.BaseClassThen this method would look for the following classes:
o - The object
public static String getDefaultDomain()
public static void setDefaultDomain(String d)
public MBeanServer getMBeanServer()
public ObjectName getObjectName()
public Object getManagedResource()
public void setManagedResource(Object proxyObject,
String type)
throws MBeanException,
RuntimeOperationsException,
InstanceNotFoundException,
InvalidTargetObjectTypeException
setManagedResource in interface ModelMBeanMBeanException
RuntimeOperationsException
InstanceNotFoundException
InvalidTargetObjectTypeExceptionprotected void defineManagedResource()
public void setModelMBeanInfo(ModelMBeanInfo info)
throws MBeanException,
RuntimeOperationsException
setModelMBeanInfo in interface ModelMBeanMBeanException
RuntimeOperationsExceptionpublic void defineAttribute(String name)
name - The name of the attribute. Normal java bean
capitlization is enforced on this name.
public void defineAttribute(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(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(ModelMBeanAttributeInfo attrInfo)
attrInfo - ModelMBeanAttributeInfo.
public void defineOperation(String name,
int impact)
name - Name of the method callimpact - Impact as defined in MBeanOperationInfo
public void defineOperation(String name,
String[] signature,
int impact)
name - The name of the method call.signature - The types of the operation parameters.impact - Impact as defined in MBeanOperationInfo
public void defineOperation(String name,
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(ModelMBeanOperationInfo opInfo)
opInfo - public MBeanInfo getMBeanInfo()
getMBeanInfo in interface DynamicMBean
public Object getAttribute(String name)
throws AttributeNotFoundException,
MBeanException,
ReflectionException
getAttribute in interface DynamicMBeanAttributeNotFoundException
MBeanException
ReflectionExceptionpublic AttributeList getAttributes(String[] names)
getAttributes in interface DynamicMBean
public void setAttribute(Attribute attr)
throws AttributeNotFoundException,
InvalidAttributeValueException,
MBeanException,
ReflectionException
setAttribute in interface DynamicMBeanAttributeNotFoundException
InvalidAttributeValueException
MBeanException
ReflectionExceptionpublic AttributeList setAttributes(AttributeList attrs)
setAttributes in interface DynamicMBean
public Object invoke(String name,
Object[] params,
String[] signature)
throws MBeanException,
ReflectionException
invoke in interface DynamicMBeanMBeanException
ReflectionException
public void load()
throws MBeanException,
RuntimeOperationsException,
InstanceNotFoundException
load in interface PersistentMBeanMBeanException
RuntimeOperationsException
InstanceNotFoundException
public void store()
throws MBeanException,
RuntimeOperationsException,
InstanceNotFoundException
store in interface PersistentMBeanMBeanException
RuntimeOperationsException
InstanceNotFoundException
public void addNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
throws IllegalArgumentException
addNotificationListener in interface NotificationBroadcasterIllegalArgumentExceptionpublic MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo in interface NotificationBroadcaster
public void removeNotificationListener(NotificationListener listener)
throws ListenerNotFoundException
removeNotificationListener in interface NotificationBroadcasterListenerNotFoundException
public void addAttributeChangeNotificationListener(NotificationListener listener,
String name,
Object handback)
throws MBeanException,
RuntimeOperationsException,
IllegalArgumentException
addAttributeChangeNotificationListener in interface ModelMBeanNotificationBroadcasterMBeanException
RuntimeOperationsException
IllegalArgumentException
public void removeAttributeChangeNotificationListener(NotificationListener listener,
String name)
throws MBeanException,
RuntimeOperationsException,
ListenerNotFoundException
removeAttributeChangeNotificationListener in interface ModelMBeanNotificationBroadcasterMBeanException
RuntimeOperationsException
ListenerNotFoundException
public void sendAttributeChangeNotification(Attribute oldAttr,
Attribute newAttr)
throws MBeanException,
RuntimeOperationsException
sendAttributeChangeNotification in interface ModelMBeanNotificationBroadcasterMBeanException
RuntimeOperationsException
public void sendAttributeChangeNotification(AttributeChangeNotification notify)
throws MBeanException,
RuntimeOperationsException
sendAttributeChangeNotification in interface ModelMBeanNotificationBroadcasterMBeanException
RuntimeOperationsException
public void sendNotification(String notify)
throws MBeanException,
RuntimeOperationsException
sendNotification in interface ModelMBeanNotificationBroadcasterMBeanException
RuntimeOperationsException
public void sendNotification(Notification notify)
throws MBeanException,
RuntimeOperationsException
sendNotification in interface ModelMBeanNotificationBroadcasterMBeanException
RuntimeOperationsExceptionprotected ObjectName newObjectName(MBeanServer server)
public void setBaseObjectName(String s)
public String getBaseObjectName()
public ObjectName preRegister(MBeanServer server,
ObjectName oName)
preRegister in interface MBeanRegistrationserver - oName -
public void postRegister(Boolean ok)
postRegister in interface MBeanRegistrationpublic void preDeregister()
preDeregister in interface MBeanRegistrationpublic void postDeregister()
postDeregister in interface MBeanRegistration
public ObjectName uniqueObjectName(MBeanServer server,
String objectName)
objectName -
public ObjectName uniqueObjectName(MBeanServer server,
Object object,
String objectName)
protected ObjectName[] getComponentMBeans(Object[] components,
Map map)
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.
protected void destroyComponentMBeans(Map map)
map -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||