public class ModelMBeanImpl extends Object implements ModelMBean, MBeanRegistration
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
ModelMBeanImpl()
MBean Constructor.
|
ModelMBeanImpl(Object proxyObject)
Proxy MBean Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
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
public ModelMBeanImpl()
public ModelMBeanImpl(Object proxyObject)
proxyObject - The actual object on which attributes and
operations are to be defined and called.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 objectpublic 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 ModelMBeanMBeanExceptionRuntimeOperationsExceptionInstanceNotFoundExceptionInvalidTargetObjectTypeExceptionprotected void defineManagedResource()
public void setModelMBeanInfo(ModelMBeanInfo info) throws MBeanException, RuntimeOperationsException
setModelMBeanInfo in interface ModelMBeanMBeanExceptionRuntimeOperationsExceptionpublic 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 MBeanOperationInfopublic 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 MBeanOperationInfopublic 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 DynamicMBeanpublic Object getAttribute(String name) throws AttributeNotFoundException, MBeanException, ReflectionException
getAttribute in interface DynamicMBeanAttributeNotFoundExceptionMBeanExceptionReflectionExceptionpublic AttributeList getAttributes(String[] names)
getAttributes in interface DynamicMBeanpublic void setAttribute(Attribute attr) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException
setAttribute in interface DynamicMBeanAttributeNotFoundExceptionInvalidAttributeValueExceptionMBeanExceptionReflectionExceptionpublic AttributeList setAttributes(AttributeList attrs)
setAttributes in interface DynamicMBeanpublic Object invoke(String name, Object[] params, String[] signature) throws MBeanException, ReflectionException
invoke in interface DynamicMBeanMBeanExceptionReflectionExceptionpublic void load()
throws MBeanException,
RuntimeOperationsException,
InstanceNotFoundException
load in interface PersistentMBeanMBeanExceptionRuntimeOperationsExceptionInstanceNotFoundExceptionpublic void store()
throws MBeanException,
RuntimeOperationsException,
InstanceNotFoundException
store in interface PersistentMBeanMBeanExceptionRuntimeOperationsExceptionInstanceNotFoundExceptionpublic void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws IllegalArgumentException
addNotificationListener in interface NotificationBroadcasterIllegalArgumentExceptionpublic MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo in interface NotificationBroadcasterpublic void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException
removeNotificationListener in interface NotificationBroadcasterListenerNotFoundExceptionpublic void addAttributeChangeNotificationListener(NotificationListener listener, String name, Object handback) throws MBeanException, RuntimeOperationsException, IllegalArgumentException
addAttributeChangeNotificationListener in interface ModelMBeanNotificationBroadcasterMBeanExceptionRuntimeOperationsExceptionIllegalArgumentExceptionpublic void removeAttributeChangeNotificationListener(NotificationListener listener, String name) throws MBeanException, RuntimeOperationsException, ListenerNotFoundException
removeAttributeChangeNotificationListener in interface ModelMBeanNotificationBroadcasterMBeanExceptionRuntimeOperationsExceptionListenerNotFoundExceptionpublic void sendAttributeChangeNotification(Attribute oldAttr, Attribute newAttr) throws MBeanException, RuntimeOperationsException
sendAttributeChangeNotification in interface ModelMBeanNotificationBroadcasterMBeanExceptionRuntimeOperationsExceptionpublic void sendAttributeChangeNotification(AttributeChangeNotification notify) throws MBeanException, RuntimeOperationsException
sendAttributeChangeNotification in interface ModelMBeanNotificationBroadcasterMBeanExceptionRuntimeOperationsExceptionpublic void sendNotification(String notify) throws MBeanException, RuntimeOperationsException
sendNotification in interface ModelMBeanNotificationBroadcasterMBeanExceptionRuntimeOperationsExceptionpublic void sendNotification(Notification notify) throws MBeanException, RuntimeOperationsException
sendNotification in interface ModelMBeanNotificationBroadcasterMBeanExceptionRuntimeOperationsExceptionprotected 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 MBeanRegistrationpublic 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 - Copyright © 2014. All rights reserved.