|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.mx.interceptor.AbstractInterceptor org.jboss.mx.interceptor.AbstractSharedInterceptor
Base class for shared interceptors. This class provides some default method implementations for shared interceptors.
SharedInterceptor
,
MBeanInvoker
Field Summary | |
protected ObjectName |
objectName
Object name of this interceptor. |
protected MBeanServer |
server
MBean server reference for shared interceptors. |
Fields inherited from class org.jboss.mx.interceptor.AbstractInterceptor |
isShared, log, name |
Constructor Summary | |
AbstractSharedInterceptor()
Constructs a new shared interceptor instance. |
|
AbstractSharedInterceptor(String name)
Constructs a new shared interceptor instance with a given name. |
Method Summary | |
protected ObjectName |
createObjectName()
Creates an object name for this interceptor. |
void |
destroy()
This method is part of the interceptor MBean's registration lifecycle. |
MBeanServer |
getMBeanServer()
Returns the interceptor's view to the MBean server it has been registered to. |
ObjectName |
getObjectName()
Returns the object name of this shared interceptor. |
void |
init()
This method is part of the interceptor MBean's registration lifecycle. |
void |
postDeregister()
This method is called by the MBeanServer after deregistration takes place. |
void |
postRegister(Boolean registrationSuccesful)
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 oname)
This method is called by the MBeanServer before registration takes place. |
ObjectName |
register(MBeanServer server)
Registers the interceptor to the MBean server. |
void |
setName(String name)
Shared interceptors allows their name to be set only before they have been registered to the MBean server. |
void |
start()
This method is part of the interceptor MBean's registration lifecycle. |
void |
stop()
This method is part of the interceptor MBean's registration lifecycle. |
String |
toString()
Returns a string representation of this interceptor instance. |
Methods inherited from class org.jboss.mx.interceptor.AbstractInterceptor |
getName, invoke, isShared, setLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.jboss.mx.interceptor.Interceptor |
getName, invoke, isShared, setLogger |
Field Detail |
protected MBeanServer server
protected ObjectName objectName
Constructor Detail |
public AbstractSharedInterceptor()
register(javax.management.MBeanServer)
method. Shared
interceptor names must be unique within the MBean server.
public AbstractSharedInterceptor(String name)
name
- name of this interceptor
IllegalArgumentException
- if name contains null referenceMethod Detail |
public ObjectName getObjectName()
SharedInterceptor
getObjectName
in interface SharedInterceptor
public MBeanServer getMBeanServer()
SharedInterceptor
getMBeanServer
in interface SharedInterceptor
public ObjectName register(MBeanServer server) throws InterceptorNameConflictException
The interceptor is registered under the
JBOSSMX_DOMAIN
name. An interceptor's object name contains a type property and
a name property. Property type always contains string
'Interceptor' as its value. Interceptor's name is used as a value
for the name property. Therefore, an interceptor created with
name 'Bart' can be found from the MBean server under object name:
JBOSSMX_DOMAIN
:type=Interceptor,name=Bart,*
If the log reference has not been set for this interceptor when it is
registered, this implementation will register a log MBean via the system
log manager under JBOSSMX
domain (see SystemLogManager
for details). The log instance's name will match the pattern: "JBossMX.Interceptor.<interceptor name>"
register
in interface SharedInterceptor
server
- MBean server where this shared interceptor is registered
InterceptorNameConflictException
- if an interceptor was already
registered to the given serverpublic void init() throws Exception
Any exception that is propagated from this method to its caller will cancel the interceptor registration.
init
in interface Interceptor
init
in class AbstractInterceptor
Exception
- if you want to cancel the interceptor registrationpublic void start()
start
in interface Interceptor
start
in class AbstractInterceptor
public void stop() throws Exception
Any exception that is propagated from this method to its caller will cancel the interceptor unregistration.
stop
in interface Interceptor
stop
in class AbstractInterceptor
Exception
- if you want to cancel the interceptor unregistrationpublic void destroy()
destroy
in interface Interceptor
destroy
in class AbstractInterceptor
public ObjectName preRegister(MBeanServer server, ObjectName oname) throws Exception
MBeanRegistration
The MBean can stop the registration by throwing an exception.The exception is forwarded to the invoker wrapped in an MBeanRegistrationException.
preRegister
in interface MBeanRegistration
Exception
- for any error, the MBean is not registered.public void postRegister(Boolean registrationSuccesful)
MBeanRegistration
postRegister
in interface MBeanRegistration
registrationSuccesful
- 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 setName(String name)
setName
in class AbstractInterceptor
name
- name of this shared interceptor
IllegalArgumentException
- if there was an attempt to change the
name after the interceptor had been registered to the serverpublic String toString()
toString
in class AbstractInterceptor
protected ObjectName createObjectName() throws MalformedObjectNameException
JBOSSMX_DOMAIN
:type=Interceptor,name=Bart,*
MalformedObjectNameException
- if the object name could not be
created
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |