|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.mx.server.AbstractMBeanInvoker
A base MBeanInvoker class that provides common state as well as
Nested Class Summary | |
protected class |
AbstractMBeanInvoker.OperationKey
|
Field Summary | |
protected Map |
attributeContextMap
|
protected Map |
constructorContextMap
|
protected boolean |
dynamicResource
Whether this is a dynamic resource |
protected InvocationContext |
getMBeanInfoCtx
|
protected MBeanInfo |
info
The 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 |
resourceEntry
The 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()
|
ObjectName |
getObjectName()
|
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()
|
protected void |
override(Invocation invocation)
Placeholder to allow subclasses to override the invocation |
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 AttributeList of name and new value pairs. |
void |
setInvocationTimeout(long time)
|
static void |
setMBeanEntry(MBeanEntry entry)
Set the MBeanEntry thread local value. |
void |
setResource(Object resource)
Sets the XMBean resource and optionally allows the resource to interact with the jmx microkernel via the following injection points: #ModelMBeanConstants.MBEAN_SERVER_INJECTION_TYPE #ModelMBeanConstants.MBEAN_INFO_INJECTION_TYPE #ModelMBeanConstants.OBJECT_NAME_INJECTION_TYPE |
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 boolean dynamicResource
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 MBeanInvoker
MBeanException
public Object invoke(String operationName, Object[] args, String[] signature) throws MBeanException, ReflectionException
invoke
in interface DynamicMBean
operationName
- 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
exceptionpublic Object getAttribute(String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException
getAttribute
in interface DynamicMBean
attribute
- 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 valuepublic void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException
setAttribute
in interface DynamicMBean
attribute
- 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.Attribute
public MBeanInfo getMBeanInfo()
DynamicMBean
getMBeanInfo
in interface DynamicMBean
public AttributeList getAttributes(String[] attributes)
DynamicMBean
getAttributes
in interface DynamicMBean
attributes
- the names of the attribute.
AttributeList
of name and value pairs.public AttributeList setAttributes(AttributeList attributes)
DynamicMBean
AttributeList
of name and new value pairs.
setAttributes
in interface DynamicMBean
attributes
- 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 MBeanRegistration
Exception
- for any error, the MBean is not registered.public void postRegister(Boolean registrationSuccessful)
MBeanRegistration
postRegister
in interface MBeanRegistration
registrationSuccessful
- the MBeanServer passes true when the
MBean was registered, false otherwise.public void preDeregister() throws Exception
MBeanRegistration
The MBean can throw an exception, this will stop the deregistration. The exception is forwarded to the invoker wrapped in an MBeanRegistrationException.
preDeregister
in interface MBeanRegistration
Exception
public void postDeregister()
MBeanRegistration
postDeregister
in interface MBeanRegistration
public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
NotificationBroadcaster
addNotificationListener
in interface NotificationBroadcaster
listener
- 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 NotificationBroadcaster
listener
- the listener object to remove
ListenerNotFoundException
- if the listener was not foundprotected void removeNotificationListenerFromResource(NotificationListener listener) throws ListenerNotFoundException
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
listener
- 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 foundprotected void removeNotificationListenerFromResource(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException
ListenerNotFoundException
public MBeanNotificationInfo[] getNotificationInfo()
NotificationBroadcaster
getNotificationInfo
in interface NotificationBroadcaster
MBeanNotificationInfo
protected MBeanNotificationInfo[] getNotificationInfoFromResource()
public Object getResource()
getResource
in interface MBeanInvoker
public void setResource(Object resource)
setResource
in interface MBeanInvoker
resource
- - the model mbean resourcepublic MBeanInfo getMetaData()
getMetaData
in interface MBeanInvoker
public ObjectName getObjectName()
getObjectName
in interface MBeanInvoker
public void suspend()
suspend
in interface Suspendable
public void suspend(long wait) throws TimeoutException
suspend
in interface Suspendable
TimeoutException
public void suspend(boolean force)
suspend
in interface Suspendable
public boolean isSuspended()
isSuspended
in interface Suspendable
public void setInvocationTimeout(long time)
setInvocationTimeout
in interface Suspendable
public long getInvocationTimeout()
getInvocationTimeout
in interface Suspendable
public void resume()
resume
in interface Suspendable
public 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 setterprotected ObjectName invokePreRegister(MBeanServer server, ObjectName name) throws Exception
Exception
protected void invokePostRegister(Boolean b)
protected void invokePreDeregister() throws Exception
Exception
protected void invokePostDeregister()
protected void initAttributeContexts(MBeanAttributeInfo[] attributes)
protected void initOperationContexts(MBeanOperationInfo[] operations)
protected void initDispatchers()
protected void override(Invocation invocation) throws MBeanException
invocation
- the invocation
MBeanException
- for any errorprotected String getSignatureString(String[] signature)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |