|
||||||||||
PREV CLASS NEXT CLASS (src) | 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 class |
AbstractMBeanInvoker.OperationKey (src)
|
Field Summary | |
protected java.util.Map |
attributeContextMap
|
protected java.util.Map |
constructorContextMap
|
protected boolean |
dynamicResource
Whether this is a dynamic resource |
protected InvocationContext (src) |
getMBeanInfoCtx
|
protected MBeanInfo (src) |
info
The metadata describing this MBean. |
protected Logger (src) |
log
|
protected java.util.Map |
operationContextMap
|
protected InvocationContext (src) |
postDeregisterCtx
|
protected InvocationContext (src) |
postRegisterCtx
|
protected InvocationContext (src) |
preDeregisterCtx
|
protected InvocationContext (src) |
preRegisterCtx
|
protected MBeanEntry (src) |
resourceEntry
The mbean server register entry used for the TCL |
Constructor Summary | |
AbstractMBeanInvoker()
Constructs a new invoker. |
|
AbstractMBeanInvoker(MBeanEntry (src) resourceEntry)
Constructs an invoker with the target resource entry. |
|
AbstractMBeanInvoker(java.lang.Object resource)
Constructs a new invoker with a given target resource. |
Method Summary | |
void |
addNotificationListener(NotificationListener (src) listener,
NotificationFilter (src) filter,
java.lang.Object handback)
Add a listener to an MBean. |
protected void |
addNotificationListenerToResource(NotificationListener (src) listener,
NotificationFilter (src) filter,
java.lang.Object handback)
|
java.lang.Object |
getAttribute(java.lang.String attribute)
Returns an attribte value. |
AttributeList (src) |
getAttributes(java.lang.String[] attributes)
Returns the values of the attributes with names matching the passed string array. |
long |
getInvocationTimeout()
|
static MBeanEntry (src) |
getMBeanEntry()
An accessor for the MBeanEntry thread local |
MBeanInfo (src) |
getMBeanInfo()
Returns the management interface that describes this dynamic resource. |
MBeanInfo (src) |
getMetaData()
|
MBeanNotificationInfo (src) [] |
getNotificationInfo()
Returns the notification metadata associated with the MBean. |
protected MBeanNotificationInfo (src) [] |
getNotificationInfoFromResource()
|
ObjectName (src) |
getObjectName()
|
java.lang.Object |
getResource()
|
MBeanServer (src) |
getServer()
|
protected java.lang.String |
getSignatureString(java.lang.String[] signature)
|
protected void |
initAttributeContexts(MBeanAttributeInfo (src) [] attributes)
|
protected void |
initDispatchers()
|
protected void |
initOperationContexts(MBeanOperationInfo (src) [] operations)
|
protected void |
inject(java.lang.String type,
java.lang.String name,
java.lang.Class argType,
java.lang.Object value)
Inject context from the xmbean layer to the resource |
java.lang.Object |
invoke(java.lang.String operationName,
java.lang.Object[] args,
java.lang.String[] signature)
Invokes the target resource. |
protected void |
invokePostDeregister()
|
protected void |
invokePostRegister(java.lang.Boolean b)
|
protected void |
invokePreDeregister()
|
protected ObjectName (src) |
invokePreRegister(MBeanServer (src) server,
ObjectName (src) name)
|
boolean |
isSuspended()
|
protected void |
override(Invocation (src) invocation)
Placeholder to allow subclasses to override the invocation |
void |
postDeregister()
This method is called by the MBeanServer after deregistration takes place. |
void |
postRegister(java.lang.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 (src) |
preRegister(MBeanServer (src) server,
ObjectName (src) name)
Initializes this invoker. |
void |
removeNotificationListener(NotificationListener (src) listener)
Removes a listener from an MBean. |
void |
removeNotificationListener(NotificationListener (src) listener,
NotificationFilter (src) filter,
java.lang.Object handback)
Removes a listener from the Emitter. |
protected void |
removeNotificationListenerFromResource(NotificationListener (src) listener)
|
protected void |
removeNotificationListenerFromResource(NotificationListener (src) listener,
NotificationFilter (src) filter,
java.lang.Object handback)
|
void |
resume()
|
void |
setAttribute(Attribute (src) attribute)
Sets an attribute value. |
AttributeList (src) |
setAttributes(AttributeList (src) attributes)
Sets the values of the attributes passed as an AttributeList (src) of name and new value pairs. |
void |
setInvocationTimeout(long time)
|
static void |
setMBeanEntry(MBeanEntry (src) entry)
Set the MBeanEntry thread local value. |
void |
setResource(java.lang.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 (src) attrDesc)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected MBeanEntry (src) resourceEntry
protected boolean dynamicResource
protected MBeanInfo (src) info
protected java.util.Map attributeContextMap
protected java.util.Map operationContextMap
protected java.util.Map constructorContextMap
protected InvocationContext (src) getMBeanInfoCtx
protected InvocationContext (src) preRegisterCtx
protected InvocationContext (src) postRegisterCtx
protected InvocationContext (src) preDeregisterCtx
protected InvocationContext (src) postDeregisterCtx
protected Logger (src) log
Constructor Detail |
public AbstractMBeanInvoker()
public AbstractMBeanInvoker(java.lang.Object resource)
public AbstractMBeanInvoker(MBeanEntry (src) resourceEntry)
resourceEntry
- Method Detail |
public static void setMBeanEntry(MBeanEntry (src) entry)
entry
- - the entry that will be used on successful registrationpublic static MBeanEntry (src) getMBeanEntry()
public void updateAttributeInfo(Descriptor (src) attrDesc) throws MBeanException (src)
updateAttributeInfo
in interface MBeanInvoker (src)
MBeanException (src)
public java.lang.Object invoke(java.lang.String operationName, java.lang.Object[] args, java.lang.String[] signature) throws MBeanException (src) , ReflectionException (src)
invoke
in interface DynamicMBean (src)
operationName
- name of the target methodargs
- argumetns for the target methodsignature
- signature of the target method
MBeanException (src)
- if the target method raised a hecked exception
ReflectionException (src)
- if there was an error trying to resolve or
invoke the target method
RuntimeMBeanException (src)
- if the target method raised an unchecked
exceptionpublic java.lang.Object getAttribute(java.lang.String attribute) throws AttributeNotFoundException (src) , MBeanException (src) , ReflectionException (src)
getAttribute
in interface DynamicMBean (src)
attribute
- attribute name
AttributeNotFoundException (src)
- if the requested attribute is not part
of the MBean's management interface
MBeanException (src)
- if retrieving the attribute value causes an
application exception
ReflectionException (src)
- if there was an error trying to retrieve the
attribute valuepublic void setAttribute(Attribute (src) attribute) throws AttributeNotFoundException (src) , InvalidAttributeValueException (src) , MBeanException (src) , ReflectionException (src)
setAttribute
in interface DynamicMBean (src)
attribute
- new attribute value
AttributeNotFoundException (src)
- if the requested attribute is not part
of the MBean's management interface
InvalidAttributeValueException (src)
- if the attribute contains a value
not suitable for the attribute
MBeanException (src)
- if setting the attribute value causes an
application exception
ReflectionException (src)
- if there was an error trying to set the
attribute value.Attribute
(src) public MBeanInfo (src) getMBeanInfo()
DynamicMBean (src)
getMBeanInfo
in interface DynamicMBean (src)
public AttributeList (src) getAttributes(java.lang.String[] attributes)
DynamicMBean (src)
getAttributes
in interface DynamicMBean (src)
attributes
- the names of the attribute.
AttributeList
(src) of name and value pairs.public AttributeList (src) setAttributes(AttributeList (src) attributes)
DynamicMBean (src)
AttributeList
(src) of name and new value pairs.
setAttributes
in interface DynamicMBean (src)
attributes
- the name an new value pairs.
AttributeList
(src) of name and value pairs
that were actually set.public ObjectName (src) preRegister(MBeanServer (src) server, ObjectName (src) name) throws java.lang.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 (src)
java.lang.Exception
- for any error, the MBean is not registered.public void postRegister(java.lang.Boolean registrationSuccessful)
MBeanRegistration (src)
postRegister
in interface MBeanRegistration (src)
registrationSuccessful
- the MBeanServer passes true when the
MBean was registered, false otherwise.public void preDeregister() throws java.lang.Exception
MBeanRegistration (src)
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 (src)
java.lang.Exception
public void postDeregister()
MBeanRegistration (src)
postDeregister
in interface MBeanRegistration (src)
public void addNotificationListener(NotificationListener (src) listener, NotificationFilter (src) filter, java.lang.Object handback)
NotificationBroadcaster (src)
addNotificationListener
in interface NotificationBroadcaster (src)
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 (src) listener, NotificationFilter (src) filter, java.lang.Object handback)
public void removeNotificationListener(NotificationListener (src) listener) throws ListenerNotFoundException (src)
NotificationBroadcaster (src)
removeNotificationListener
in interface NotificationBroadcaster (src)
listener
- the listener object to remove
ListenerNotFoundException (src)
- if the listener was not foundprotected void removeNotificationListenerFromResource(NotificationListener (src) listener) throws ListenerNotFoundException (src)
ListenerNotFoundException (src)
public void removeNotificationListener(NotificationListener (src) listener, NotificationFilter (src) filter, java.lang.Object handback) throws ListenerNotFoundException (src)
NotificationEmitter (src)
Only the listener, filter, handback triplet is removed
removeNotificationListener
in interface NotificationEmitter (src)
listener
- the listener object to removefilter
- the filter registered with the listenerhandback
- the handback object associated with the registered listener
ListenerNotFoundException (src)
- if the listener was not foundprotected void removeNotificationListenerFromResource(NotificationListener (src) listener, NotificationFilter (src) filter, java.lang.Object handback) throws ListenerNotFoundException (src)
ListenerNotFoundException (src)
public MBeanNotificationInfo (src) [] getNotificationInfo()
NotificationBroadcaster (src)
getNotificationInfo
in interface NotificationBroadcaster (src)
MBeanNotificationInfo
(src) protected MBeanNotificationInfo (src) [] getNotificationInfoFromResource()
public java.lang.Object getResource()
getResource
in interface MBeanInvoker (src)
public void setResource(java.lang.Object resource)
setResource
in interface MBeanInvoker (src)
resource
- - the model mbean resourcepublic MBeanInfo (src) getMetaData()
getMetaData
in interface MBeanInvoker (src)
public ObjectName (src) getObjectName()
getObjectName
in interface MBeanInvoker (src)
public void suspend()
suspend
in interface Suspendable (src)
public void suspend(long wait) throws TimeoutException (src)
suspend
in interface Suspendable (src)
TimeoutException (src)
public void suspend(boolean force)
suspend
in interface Suspendable (src)
public boolean isSuspended()
isSuspended
in interface Suspendable (src)
public void setInvocationTimeout(long time)
setInvocationTimeout
in interface Suspendable (src)
public long getInvocationTimeout()
getInvocationTimeout
in interface Suspendable (src)
public void resume()
resume
in interface Suspendable (src)
public MBeanServer (src) getServer()
protected void inject(java.lang.String type, java.lang.String name, java.lang.Class argType, java.lang.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 (src) invokePreRegister(MBeanServer (src) server, ObjectName (src) name) throws java.lang.Exception
java.lang.Exception
protected void invokePostRegister(java.lang.Boolean b)
protected void invokePreDeregister() throws java.lang.Exception
java.lang.Exception
protected void invokePostDeregister()
protected void initAttributeContexts(MBeanAttributeInfo (src) [] attributes)
protected void initOperationContexts(MBeanOperationInfo (src) [] operations)
protected void initDispatchers()
protected void override(Invocation (src) invocation) throws MBeanException (src)
invocation
- the invocation
MBeanException (src)
- for any errorprotected java.lang.String getSignatureString(java.lang.String[] signature)
|
||||||||||
PREV CLASS NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |