|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jboss.mx.server.AbstractMBeanInvoker
org.jboss.mx.modelmbean.ModelMBeanInvoker
An extension of the MBeanInvoker
that implements the base Model MBean functionality, essentially making the
Model MBean just another invoker of managed resources.
ModelMBean,
MBeanInvoker| Nested Class Summary |
| Nested classes inherited from class org.jboss.mx.server.AbstractMBeanInvoker |
AbstractMBeanInvoker.OperationKey |
| Field Summary | |
protected long |
attrNotifierSequence
Notification sequence number for attribute change notifications. |
protected JBossNotificationBroadcasterSupport |
notifier
Notification broadcaster for this Model MBean. |
protected long |
notifierSequence
Notification sequence number for generic Model MBean notifications. |
protected PersistenceManager |
persistence
Persistence manager. |
protected String |
resourceType
The resource type string of the managed resource, such as ModelMBeanConstants.OBJECT_REF or
XMBeanConstants.STANDARD_INTERFACE. |
| Fields inherited from class org.jboss.mx.server.AbstractMBeanInvoker |
attributeContextMap, constructorContextMap, dynamicResource, getMBeanInfoCtx, info, operationContextMap, postDeregisterCtx, postRegisterCtx, preDeregisterCtx, preRegisterCtx, resourceEntry |
| Constructor Summary | |
ModelMBeanInvoker()
Default constructor. |
|
ModelMBeanInvoker(ModelMBeanInfo info)
Creates a Model MBean instance and initializes it with the given Model MBean metadata. |
|
| Method Summary | |
void |
addAttributeChangeNotificationListener(NotificationListener listener,
String attributeName,
Object handback)
|
void |
addNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
Add a listener to an MBean. |
protected void |
configureInterceptorStack(ModelMBeanInfo info,
MBeanServer server,
ObjectName name)
Build the getMBeanInfo, operation, and attribute interceptor stacks and associated these with the corresponding InvocationContexts. |
protected List |
getInterceptors(Descriptor d)
|
MBeanNotificationInfo[] |
getNotificationInfo()
Returns the notification metadata associated with the MBean. |
protected void |
init(MBeanServer server,
ObjectName name)
|
protected void |
initAttributeContexts(MBeanAttributeInfo[] attributes)
|
protected void |
initOperationContexts(MBeanOperationInfo[] operations)
|
protected void |
initPersistence(MBeanServer server,
ObjectName name)
initializes the persistence manager based on the info for this bean. |
ObjectName |
invokePreRegister(MBeanServer server,
ObjectName name)
The default implementation of preRegister invokes the configureInterceptorStack(javax.management.modelmbean.ModelMBeanInfo, javax.management.MBeanServer, javax.management.ObjectName) method which sets up the interceptors
for this Model MBean instance. |
protected boolean |
isSupportedResourceType(Object resource,
String resourceType)
|
void |
load()
Retrieves the MBean's state from a persistence store. |
protected void |
override(Invocation invocation)
Placeholder to allow subclasses to override the invocation |
void |
removeAttributeChangeNotificationListener(NotificationListener listener,
String attributeName)
|
void |
removeNotificationListener(NotificationListener listener)
Removes a listener from an MBean. |
void |
removeNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
Removes a listener from the Emitter. |
void |
sendAttributeChangeNotification(Attribute oldValue,
Attribute newValue)
Sends an attribute change notification. |
void |
sendAttributeChangeNotification(AttributeChangeNotification notification)
Sends an attribute change notification. |
void |
sendNotification(Notification ntfyObj)
Sends a notification. |
void |
sendNotification(String ntfyText)
Sends a notification with a given string message. |
void |
setManagedResource(Object ref,
String resourceType)
Sets the managed resource for this Model MBean instance. |
void |
setModelMBeanInfo(ModelMBeanInfo info)
Sets the MBean metadata for this Model MBean instance. |
protected void |
setValuesFromMBeanInfo()
|
void |
store()
Stores the MBean's state to a persistence store. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.management.DynamicMBean |
getAttribute, getAttributes, getMBeanInfo, invoke, setAttribute, setAttributes |
| Field Detail |
protected String resourceType
ModelMBeanConstants.OBJECT_REF or
XMBeanConstants.STANDARD_INTERFACE. This type string can be
used by the invoker to determine the behavior implemented by the
invocation chain and how the managed resource is exposed to the client
programs.
protected PersistenceManager persistence
protected JBossNotificationBroadcasterSupport notifier
protected long notifierSequence
protected long attrNotifierSequence
| Constructor Detail |
public ModelMBeanInvoker()
public ModelMBeanInvoker(ModelMBeanInfo info) throws MBeanException
info - Model MBean metadata| Method Detail |
public void setModelMBeanInfo(ModelMBeanInfo info) throws MBeanException, RuntimeOperationsException
setModelMBeanInfo in interface ModelMBeaninfo - Model MBean metadata
MBeanException
RuntimeOperationsExceptionpublic void setManagedResource(Object ref, String resourceType) throws MBeanException, InstanceNotFoundException, InvalidTargetObjectTypeException
isSupportedResourceType(java.lang.Object, java.lang.String) for more information).
setManagedResource in interface ModelMBeanref - reference to the managed resourceresourceType - resource type identification string
MBeanException
InstanceNotFoundException
InvalidTargetObjectTypeExceptionpublic void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
NotificationBroadcaster
addNotificationListener in interface NotificationBroadcasteraddNotificationListener in class AbstractMBeanInvokerpublic void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException
NotificationBroadcaster
removeNotificationListener in interface NotificationBroadcasterremoveNotificationListener in class AbstractMBeanInvokerListenerNotFoundExceptionpublic void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException
NotificationEmitterOnly the listener, filter, handback triplet is removed
removeNotificationListener in interface NotificationEmitterremoveNotificationListener in class AbstractMBeanInvokerListenerNotFoundExceptionpublic void sendNotification(String ntfyText) throws MBeanException, RuntimeOperationsException
GENERIC_MODELMBEAN_NOTIFICATION.
sendNotification in interface ModelMBeanNotificationBroadcasterntfyText - notification message
MBeanException
RuntimeOperationsExceptionpublic void sendNotification(Notification ntfyObj) throws MBeanException, RuntimeOperationsException
sendNotification in interface ModelMBeanNotificationBroadcasterntfyObj - notification to send
MBeanException
RuntimeOperationsExceptionpublic void sendAttributeChangeNotification(AttributeChangeNotification notification) throws MBeanException
sendAttributeChangeNotification in interface ModelMBeanNotificationBroadcasternotification - attribute change notification to send
MBeanExceptionpublic void sendAttributeChangeNotification(Attribute oldValue, Attribute newValue) throws MBeanException, RuntimeOperationsException
sendAttributeChangeNotification in interface ModelMBeanNotificationBroadcasteroldValue - attribute with the old valuenewValue - attribute with the new value
IllegalArgumentException - - An Attribute object passed in parameter
is null or the names of the two Attribute objects in parameter are not
the same.
MBeanException
RuntimeOperationsExceptionpublic MBeanNotificationInfo[] getNotificationInfo()
NotificationBroadcaster
getNotificationInfo in interface NotificationBroadcastergetNotificationInfo in class AbstractMBeanInvokerpublic void addAttributeChangeNotificationListener(NotificationListener listener, String attributeName, Object handback) throws MBeanException
addAttributeChangeNotificationListener in interface ModelMBeanNotificationBroadcasterMBeanExceptionpublic void removeAttributeChangeNotificationListener(NotificationListener listener, String attributeName) throws MBeanException, ListenerNotFoundException
removeAttributeChangeNotificationListener in interface ModelMBeanNotificationBroadcaster
public void load()
throws MBeanException,
InstanceNotFoundException
PersistentMBean
load in interface PersistentMBeanMBeanException - wraps application exceptions from persistence store
InstanceNotFoundException - if the MBean's state could not be found
public void store()
throws MBeanException,
InstanceNotFoundException
PersistentMBean
store in interface PersistentMBeanInstanceNotFoundException - if the MBean's state could not be stored
MBeanException - wraps application exceptions from persistence storepublic ObjectName invokePreRegister(MBeanServer server, ObjectName name) throws Exception
configureInterceptorStack(javax.management.modelmbean.ModelMBeanInfo, javax.management.MBeanServer, javax.management.ObjectName) method which sets up the interceptors
for this Model MBean instance. Subclasses may override the
configureInterceptorStack() method to implement their own
interceptor stack configurations. See the JavaDoc for
configureInterceptorStack() for more information.
After the interceptor configuration, this implementation invokes the
load() method on this Model MBean instance. This will attempt
to load a pre-existing management attribute state for this Model MBean
instance. See the Javadoc for load() for more information.
invokePreRegister in class AbstractMBeanInvokerExceptionprotected void init(MBeanServer server, ObjectName name) throws Exception
server - name -
Exceptionprotected void initPersistence(MBeanServer server, ObjectName name) throws MBeanException, InstanceNotFoundException
protected void initOperationContexts(MBeanOperationInfo[] operations)
initOperationContexts in class AbstractMBeanInvokerprotected void initAttributeContexts(MBeanAttributeInfo[] attributes)
initAttributeContexts in class AbstractMBeanInvokerprotected void configureInterceptorStack(ModelMBeanInfo info, MBeanServer server, ObjectName name) throws Exception
info - - the ModelMBean metadataserver - - the MBeanServer the ModelMBean is registering withname - - the ModelMBean name
Exceptionprotected List getInterceptors(Descriptor d) throws Exception
d -
Exception
protected void setValuesFromMBeanInfo()
throws JMException
JMExceptionprotected boolean isSupportedResourceType(Object resource, String resourceType)
protected void override(Invocation invocation) throws MBeanException
AbstractMBeanInvoker
override in class AbstractMBeanInvokerinvocation - the invocation
MBeanException - for any error
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||