mx4j.tools.adaptor.interceptor

Class AdaptorInterceptor

Implemented Interfaces:
AdaptorInterceptorMBean, Interceptor, Invocable
Known Direct Subclasses:
ContextClassLoaderAdaptorInterceptor, InvokerAdaptorInterceptor, LoggerAdaptorInterceptor, TimingAdaptorInterceptor

public class AdaptorInterceptor
extends java.lang.Object
implements Interceptor, AdaptorInterceptorMBean

The base adaptor interceptor implementation

Version:
$Revision: 1.3 $

Method Summary

protected InvocationResult
doInvoke(Invocation invocation)
The real invocation on the interceptor chain.
protected Logger
getLogger()
javax.management.MBeanServer
getMBeanServer()
protected Interceptor
getNext()
javax.management.ObjectName
getObjectName()
Returns the object name explicitely set by setObjectName(ObjectName)
String
getType()
Returns the type of this interceptor
InvocationResult
invoke(Invocation invocation)
Invocation method
boolean
isEnabled()
Returns whether this interceptor is enabled
protected void
postInvoke(Invocation invocation)
Called after the real invocation in the interceptor chain.
protected void
preInvoke(Invocation invocation)
Called before the real invocation on the interceptor chain.
void
setEnabled(boolean value)
Enables or disables this interceptor
void
setMBeanServer(javax.management.MBeanServer server)
void
setNext(Interceptor interceptor)
void
setObjectName(javax.management.ObjectName name)
Explicitely sets the object name of this interceptor in case it is registered with an MBeanServer.
String
toString()

Method Details

doInvoke

protected InvocationResult doInvoke(Invocation invocation)
            throws Exception
The real invocation on the interceptor chain.
By default calls the next interceptor in the chain.

See Also:
setNext(Interceptor), preInvoke(Invocation), postInvoke(Invocation)


getLogger

protected Logger getLogger()


getMBeanServer

public javax.management.MBeanServer getMBeanServer()


getNext

protected Interceptor getNext()


getObjectName

public javax.management.ObjectName getObjectName()


getType

public String getType()
Returns the type of this interceptor
Specified by:
getType in interface Interceptor
getType in interface AdaptorInterceptorMBean


invoke

public InvocationResult invoke(Invocation invocation)
            throws Exception
Invocation method
Specified by:
invoke in interface Invocable


isEnabled

public boolean isEnabled()
Returns whether this interceptor is enabled
Specified by:
isEnabled in interface AdaptorInterceptorMBean


postInvoke

protected void postInvoke(Invocation invocation)
            throws Exception
Called after the real invocation in the interceptor chain.
By default does nothing; exception thrown by this method will be just logged. This method is always called, even in case of exception thrown by preInvoke(Invocation) or by doInvoke(Invocation) Subclasses normally override this method to perform some operation after the real invocation on the interceptor chain.

See Also:
preInvoke(Invocation)


preInvoke

protected void preInvoke(Invocation invocation)
            throws Exception
Called before the real invocation on the interceptor chain.
By default does nothing; exception thrown by this method will result in doInvoke(Invocation) not being called. Subclasses normally override this method to perform some operation before the real invocation on the interceptor chain.

See Also:
postInvoke(Invocation)


setEnabled

public void setEnabled(boolean value)
Enables or disables this interceptor
Specified by:
setEnabled in interface AdaptorInterceptorMBean


setMBeanServer

public void setMBeanServer(javax.management.MBeanServer server)


setNext

public void setNext(Interceptor interceptor)
Specified by:
setNext in interface Interceptor


setObjectName

public void setObjectName(javax.management.ObjectName name)
Explicitely sets the object name of this interceptor in case it is registered with an MBeanServer.
If not set, the object name will be deducted from the adaptor's object name and from this interceptor's name.

See Also:
getObjectName(), getType()


toString

public String toString()


Copyright © 2001-2003 MX4J Team. All Rights Reserved.