|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mx.server.AbstractMBeanInvoker
public abstract class AbstractMBeanInvoker
A base MBeanInvoker class that provides common state
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)
|
protected void |
addNotificationListenerToResource(NotificationListener listener,
NotificationFilter filter,
Object handback)
|
void |
addOperationInterceptor(Interceptor interceptor)
Add dynamically an operation interceptor, first in the chain. |
Object |
getAttribute(String attribute)
Returns an attribte value. |
AttributeList |
getAttributes(String[] attributes)
|
long |
getInvocationTimeout()
|
static MBeanEntry |
getMBeanEntry()
An accessor for the MBeanEntry thread local |
MBeanInfo |
getMBeanInfo()
|
MBeanInfo |
getMetaData()
|
MBeanNotificationInfo[] |
getNotificationInfo()
|
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()
|
void |
postRegister(Boolean registrationSuccessful)
|
void |
preDeregister()
|
ObjectName |
preRegister(MBeanServer server,
ObjectName name)
Initializes this invoker. |
void |
removeNotificationListener(NotificationListener listener)
|
void |
removeNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
|
protected void |
removeNotificationListenerFromResource(NotificationListener listener)
|
protected void |
removeNotificationListenerFromResource(NotificationListener listener,
NotificationFilter filter,
Object handback)
|
void |
removeOperationInterceptor(Interceptor interceptor)
Remove the specified operation interceptor |
void |
resume()
|
void |
setAttribute(Attribute attribute)
Sets an attribute value. |
AttributeList |
setAttributes(AttributeList attributes)
|
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 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.public MBeanInfo getMBeanInfo()
getMBeanInfo
in interface DynamicMBean
public AttributeList getAttributes(String[] attributes)
getAttributes
in interface DynamicMBean
public AttributeList setAttributes(AttributeList attributes)
setAttributes
in interface DynamicMBean
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
public void postRegister(Boolean registrationSuccessful)
postRegister
in interface MBeanRegistration
public void preDeregister() throws Exception
preDeregister
in interface MBeanRegistration
Exception
public void postDeregister()
postDeregister
in interface MBeanRegistration
public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
addNotificationListener
in interface NotificationBroadcaster
protected void addNotificationListenerToResource(NotificationListener listener, NotificationFilter filter, Object handback)
public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException
removeNotificationListener
in interface NotificationBroadcaster
ListenerNotFoundException
protected void removeNotificationListenerFromResource(NotificationListener listener) throws ListenerNotFoundException
ListenerNotFoundException
public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException
removeNotificationListener
in interface NotificationEmitter
ListenerNotFoundException
protected void removeNotificationListenerFromResource(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException
ListenerNotFoundException
public MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo
in interface NotificationBroadcaster
protected MBeanNotificationInfo[] getNotificationInfoFromResource()
public MBeanInfo getMetaData()
getMetaData
in interface MBeanInvoker
public Object getResource()
getResource
in interface MBeanInvoker
public void setResource(Object resource)
setResource
in interface MBeanInvoker
resource
- - the model mbean resourcepublic ObjectName getObjectName()
getObjectName
in interface MBeanInvoker
public void updateAttributeInfo(Descriptor attrDesc) throws MBeanException
updateAttributeInfo
in interface MBeanInvoker
MBeanException
public void addOperationInterceptor(Interceptor interceptor)
addOperationInterceptor
in interface Interceptable
public void removeOperationInterceptor(Interceptor interceptor)
removeOperationInterceptor
in interface Interceptable
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 |