| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jboss.mx.server.AbstractMBeanInvoker
A base MBeanInvoker class that provides common state as well as
| Nested Class Summary | |
| protected static class | AbstractMBeanInvoker.OperationKey | 
| Field Summary | |
| protected  Map | attributeContextMap | 
| protected  Map | constructorContextMap | 
| protected  InvocationContext | getMBeanInfoCtx | 
| protected  MBeanInfo | infoThe metadata describing this MBean. | 
| protected  org.jboss.logging.Logger | log | 
| protected  Map | operationContextMap | 
| protected  InvocationContext | postDeregisterCtx | 
| protected  InvocationContext | postRegisterCtx | 
| protected  InvocationContext | preDeregisterCtx | 
| protected  InvocationContext | preRegisterCtx | 
| protected  MBeanEntry | resourceEntryThe mbean server register entry used for the TCL | 
| Constructor Summary | |
| AbstractMBeanInvoker()Constructs a new invoker. | |
| AbstractMBeanInvoker(MBeanEntry resourceEntry)Constructs an invoker with the target resource entry. | |
| AbstractMBeanInvoker(Object resource)Constructs a new invoker with a given target resource. | |
| Method Summary | |
|  void | addNotificationListener(NotificationListener listener,
                        NotificationFilter filter,
                        Object handback)Add a listener to an MBean. | 
| protected  void | addNotificationListenerToResource(NotificationListener listener,
                                  NotificationFilter filter,
                                  Object handback) | 
|  Object | getAttribute(String attribute)Returns an attribte value. | 
|  AttributeList | getAttributes(String[] attributes)Returns the values of the attributes with names matching the passed string array. | 
|  long | getInvocationTimeout() | 
| static MBeanEntry | getMBeanEntry()An accessor for the MBeanEntry thread local | 
|  MBeanInfo | getMBeanInfo()Returns the management interface that describes this dynamic resource. | 
|  MBeanInfo | getMetaData() | 
|  MBeanNotificationInfo[] | getNotificationInfo()Returns the notification metadata associated with the MBean. | 
| protected  MBeanNotificationInfo[] | getNotificationInfoFromResource() | 
|  Object | getResource() | 
|  MBeanServer | getServer() | 
| protected  String | getSignatureString(String[] signature) | 
| protected  void | initAttributeContexts(MBeanAttributeInfo[] attributes) | 
| protected  void | initDispatchers() | 
| protected  void | initOperationContexts(MBeanOperationInfo[] operations) | 
| protected  void | inject(String type,
       String name,
       Class argType,
       Object value)Inject context from the xmbean layer to the resource | 
|  Object | invoke(String operationName,
       Object[] args,
       String[] signature)Invokes the target resource. | 
| protected  void | invokePostDeregister() | 
| protected  void | invokePostRegister(Boolean b) | 
| protected  void | invokePreDeregister() | 
| protected  ObjectName | invokePreRegister(MBeanServer server,
                  ObjectName name) | 
|  boolean | isSuspended() | 
|  void | postDeregister()This method is called by the MBeanServer after deregistration takes place. | 
|  void | postRegister(Boolean registrationSuccessful)This method is called by the MBeanServer after registration takes place or when registration fails. | 
|  void | preDeregister()This method is called by the MBeanServer before deregistration takes place. | 
|  ObjectName | preRegister(MBeanServer server,
            ObjectName name)Initializes this invoker. | 
|  void | removeNotificationListener(NotificationListener listener)Removes a listener from an MBean. | 
|  void | removeNotificationListener(NotificationListener listener,
                           NotificationFilter filter,
                           Object handback)Removes a listener from the Emitter. | 
| protected  void | removeNotificationListenerFromResource(NotificationListener listener) | 
| protected  void | removeNotificationListenerFromResource(NotificationListener listener,
                                       NotificationFilter filter,
                                       Object handback) | 
|  void | resume() | 
|  void | setAttribute(Attribute attribute)Sets an attribute value. | 
|  AttributeList | setAttributes(AttributeList attributes)Sets the values of the attributes passed as an AttributeListof name and new value pairs. | 
|  void | setInvocationTimeout(long time) | 
| static void | setMBeanEntry(MBeanEntry entry)Set the MBeanEntry thread local value. | 
|  void | setResource(Object resource) | 
|  void | suspend() | 
|  void | suspend(boolean force) | 
|  void | suspend(long wait) | 
|  void | updateAttributeInfo(Descriptor attrDesc) | 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
protected MBeanEntry resourceEntry
protected MBeanInfo info
protected Map attributeContextMap
protected Map operationContextMap
protected Map constructorContextMap
protected InvocationContext getMBeanInfoCtx
protected InvocationContext preRegisterCtx
protected InvocationContext postRegisterCtx
protected InvocationContext preDeregisterCtx
protected InvocationContext postDeregisterCtx
protected org.jboss.logging.Logger log
| Constructor Detail | 
public AbstractMBeanInvoker()
public AbstractMBeanInvoker(Object resource)
public AbstractMBeanInvoker(MBeanEntry resourceEntry)
resourceEntry - | Method Detail | 
public static void setMBeanEntry(MBeanEntry entry)
entry - - the entry that will be used on successful registrationpublic static MBeanEntry getMBeanEntry()
public void updateAttributeInfo(Descriptor attrDesc)
                         throws MBeanException
updateAttributeInfo in interface MBeanInvokerMBeanException
public Object invoke(String operationName,
                     Object[] args,
                     String[] signature)
              throws MBeanException,
                     ReflectionException
invoke in interface DynamicMBeanoperationName - name of the target methodargs - argumetns for the target methodsignature - signature of the target method
MBeanException - if the target method raised a hecked exception
ReflectionException - if there was an error trying to resolve or
         invoke the target method
RuntimeMBeanException - if the target method raised an unchecked
         exception
ReflectionException - if the target method raised an error
public Object getAttribute(String attribute)
                    throws AttributeNotFoundException,
                           MBeanException,
                           ReflectionException
getAttribute in interface DynamicMBeanattribute - attribute name
AttributeNotFoundException - if the requested attribute is not
         part of the MBean's management interface
MBeanException - if retrieving the attribute value causes an
         application exception
ReflectionException - if there was an error trying to retrieve
         the attribute value
public void setAttribute(Attribute attribute)
                  throws AttributeNotFoundException,
                         InvalidAttributeValueException,
                         MBeanException,
                         ReflectionException
setAttribute in interface DynamicMBeanattribute - new attribute value
AttributeNotFoundException - if the requested attribute is not part
         of the MBean's management interface
InvalidAttributeValueException - if the attribute contains a value
         not suitable for the attribute
MBeanException - if setting the attribute value causes an application
         exception
ReflectionException - if there was an error trying to set the
         attribute value.Attributepublic MBeanInfo getMBeanInfo()
DynamicMBean
getMBeanInfo in interface DynamicMBeanpublic AttributeList getAttributes(String[] attributes)
DynamicMBean
getAttributes in interface DynamicMBeanattributes - the names of the attribute.
AttributeList of name and value pairs.public AttributeList setAttributes(AttributeList attributes)
DynamicMBeanAttributeList of name and new value pairs.
setAttributes in interface DynamicMBeanattributes - the name an new value pairs.
AttributeList of name and value pairs 
 that were actually set.
public ObjectName preRegister(MBeanServer server,
                              ObjectName name)
                       throws Exception
Subclasses that override the preRegister method must make sure they call super.preRegister() in their implementation to ensure proper initialization of the invoker.
preRegister in interface MBeanRegistrationException - for any error, the MBean is not registered.public void postRegister(Boolean registrationSuccessful)
MBeanRegistration
postRegister in interface MBeanRegistrationregistrationSuccessful - the MBeanServer passes true when the
 MBean was registered, false otherwise.
public void preDeregister()
                   throws Exception
MBeanRegistrationThe MBean can throw an exception, this will stop the deregistration. The exception is forwarded to the invoker wrapped in an MBeanRegistrationException.
preDeregister in interface MBeanRegistrationExceptionpublic void postDeregister()
MBeanRegistration
postDeregister in interface MBeanRegistration
public void addNotificationListener(NotificationListener listener,
                                    NotificationFilter filter,
                                    Object handback)
NotificationBroadcaster
addNotificationListener in interface NotificationBroadcasterlistener - implementation of the listener objectfilter - implementation of the filter object or null
                      if no filtering is requiredhandback - A handback object associated with each notification
                      sent by this notification broadcaster.
protected void addNotificationListenerToResource(NotificationListener listener,
                                                 NotificationFilter filter,
                                                 Object handback)
public void removeNotificationListener(NotificationListener listener)
                                throws ListenerNotFoundException
NotificationBroadcaster
removeNotificationListener in interface NotificationBroadcasterlistener - the listener object to remove
ListenerNotFoundException - if the listener was not found
protected void removeNotificationListenerFromResource(NotificationListener listener)
                                               throws ListenerNotFoundException
ListenerNotFoundException
public void removeNotificationListener(NotificationListener listener,
                                       NotificationFilter filter,
                                       Object handback)
                                throws ListenerNotFoundException
NotificationEmitterOnly the listener, filter, handback triplet is removed
removeNotificationListener in interface NotificationEmitterlistener - the listener object to removefilter - the filter registered with the listenerhandback - the handback object associated with the registered listener
ListenerNotFoundException - if the listener was not found
protected void removeNotificationListenerFromResource(NotificationListener listener,
                                                      NotificationFilter filter,
                                                      Object handback)
                                               throws ListenerNotFoundException
ListenerNotFoundExceptionpublic MBeanNotificationInfo[] getNotificationInfo()
NotificationBroadcaster
getNotificationInfo in interface NotificationBroadcasterMBeanNotificationInfoprotected MBeanNotificationInfo[] getNotificationInfoFromResource()
public Object getResource()
getResource in interface MBeanInvokerpublic void setResource(Object resource)
setResource in interface MBeanInvokerpublic MBeanInfo getMetaData()
getMetaData in interface MBeanInvokerpublic void suspend()
suspend in interface Suspendable
public void suspend(long wait)
             throws TimeoutException
suspend in interface SuspendableTimeoutExceptionpublic void suspend(boolean force)
suspend in interface Suspendablepublic boolean isSuspended()
isSuspended in interface Suspendablepublic void setInvocationTimeout(long time)
setInvocationTimeout in interface Suspendablepublic long getInvocationTimeout()
getInvocationTimeout in interface Suspendablepublic void resume()
resume in interface Suspendablepublic MBeanServer getServer()
protected void inject(String type,
                      String name,
                      Class argType,
                      Object value)
type - - the type of injectionname - - the setter method name of the resourceargType - - the injection data typevalue - - the injection data value to pass to the setter
protected ObjectName invokePreRegister(MBeanServer server,
                                       ObjectName name)
                                throws Exception
Exceptionprotected void invokePostRegister(Boolean b)
protected void invokePreDeregister()
                            throws Exception
Exceptionprotected void invokePostDeregister()
protected void initAttributeContexts(MBeanAttributeInfo[] attributes)
protected void initOperationContexts(MBeanOperationInfo[] operations)
protected void initDispatchers()
protected String getSignatureString(String[] signature)
| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||