|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 metadataMethod Detail |
public void setModelMBeanInfo(ModelMBeanInfo info) throws MBeanException, RuntimeOperationsException
setModelMBeanInfo
in interface ModelMBean
info
- Model MBean metadata
MBeanException
RuntimeOperationsException
public void setManagedResource(Object ref, String resourceType) throws MBeanException, InstanceNotFoundException, InvalidTargetObjectTypeException
isSupportedResourceType(java.lang.Object, java.lang.String)
for more information).
setManagedResource
in interface ModelMBean
ref
- reference to the managed resourceresourceType
- resource type identification string
MBeanException
InstanceNotFoundException
InvalidTargetObjectTypeException
public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
NotificationBroadcaster
addNotificationListener
in interface NotificationBroadcaster
addNotificationListener
in class AbstractMBeanInvoker
public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException
NotificationBroadcaster
removeNotificationListener
in interface NotificationBroadcaster
removeNotificationListener
in class AbstractMBeanInvoker
ListenerNotFoundException
public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException
NotificationEmitter
Only the listener, filter, handback triplet is removed
removeNotificationListener
in interface NotificationEmitter
removeNotificationListener
in class AbstractMBeanInvoker
ListenerNotFoundException
public void sendNotification(String ntfyText) throws MBeanException, RuntimeOperationsException
GENERIC_MODELMBEAN_NOTIFICATION
.
sendNotification
in interface ModelMBeanNotificationBroadcaster
ntfyText
- notification message
MBeanException
RuntimeOperationsException
public void sendNotification(Notification ntfyObj) throws MBeanException, RuntimeOperationsException
sendNotification
in interface ModelMBeanNotificationBroadcaster
ntfyObj
- notification to send
MBeanException
RuntimeOperationsException
public void sendAttributeChangeNotification(AttributeChangeNotification notification) throws MBeanException
sendAttributeChangeNotification
in interface ModelMBeanNotificationBroadcaster
notification
- attribute change notification to send
MBeanException
public void sendAttributeChangeNotification(Attribute oldValue, Attribute newValue) throws MBeanException, RuntimeOperationsException
sendAttributeChangeNotification
in interface ModelMBeanNotificationBroadcaster
oldValue
- 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
RuntimeOperationsException
public MBeanNotificationInfo[] getNotificationInfo()
NotificationBroadcaster
getNotificationInfo
in interface NotificationBroadcaster
getNotificationInfo
in class AbstractMBeanInvoker
public void addAttributeChangeNotificationListener(NotificationListener listener, String attributeName, Object handback) throws MBeanException
addAttributeChangeNotificationListener
in interface ModelMBeanNotificationBroadcaster
MBeanException
public void removeAttributeChangeNotificationListener(NotificationListener listener, String attributeName) throws MBeanException, ListenerNotFoundException
removeAttributeChangeNotificationListener
in interface ModelMBeanNotificationBroadcaster
public void load() throws MBeanException, InstanceNotFoundException
PersistentMBean
load
in interface PersistentMBean
MBeanException
- wraps application exceptions from persistence store
InstanceNotFoundException
- if the MBean's state could not be foundpublic void store() throws MBeanException, InstanceNotFoundException
PersistentMBean
store
in interface PersistentMBean
InstanceNotFoundException
- 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 AbstractMBeanInvoker
Exception
protected void init(MBeanServer server, ObjectName name) throws Exception
server
- name
-
Exception
protected void initPersistence(MBeanServer server, ObjectName name) throws MBeanException, InstanceNotFoundException
protected void initOperationContexts(MBeanOperationInfo[] operations)
initOperationContexts
in class AbstractMBeanInvoker
protected void initAttributeContexts(MBeanAttributeInfo[] attributes)
initAttributeContexts
in class AbstractMBeanInvoker
protected void configureInterceptorStack(ModelMBeanInfo info, MBeanServer server, ObjectName name) throws Exception
info
- - the ModelMBean metadataserver
- - the MBeanServer the ModelMBean is registering withname
- - the ModelMBean name
Exception
protected List getInterceptors(Descriptor d) throws Exception
d
-
Exception
protected void setValuesFromMBeanInfo() throws JMException
JMException
protected boolean isSupportedResourceType(Object resource, String resourceType)
protected void override(Invocation invocation) throws MBeanException
AbstractMBeanInvoker
override
in class AbstractMBeanInvoker
invocation
- the invocation
MBeanException
- for any error
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |