Class AvalonInterceptorContextImpl
java.lang.Object
org.apache.fulcrum.yaafi.framework.interceptor.AvalonInterceptorContextImpl
- All Implemented Interfaces:
AvalonInterceptorContext
Contains context information for the interceptors being invoked. The
class contains a request context which allows to store data from within an
interceptor. It also provides access to a ThreadLocalStorage to associate
data with the current thread.
- Author:
- Siegfried Goeschl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears the transaction id for the current thread.void
Decrement the current service invocation depthfinal Object[]
getArgs()
int
Get the current service invocation depthfinal Long
final Method
final Object
final String
final ThreadLocalStorage
boolean
void
Increment the current service invocation depthvoid
setTransactionId
(Object transactionId) Set the transaction id for the current thread.toString()
-
Constructor Details
-
AvalonInterceptorContextImpl
public AvalonInterceptorContextImpl(String serviceName, String serviceShorthand, Object serviceDelegate, Method method, Object[] args) Constructor.- Parameters:
serviceName
- the name of the service being interceptedserviceShorthand
- the shorthand of the service being interceptedserviceDelegate
- the real service implementationmethod
- the method being invokedargs
- the list of arguments for the method invocation
-
-
Method Details
-
getRequestContext
- Specified by:
getRequestContext
in interfaceAvalonInterceptorContext
- Returns:
- Returns the context for the given request.
-
getServiceDelegate
- Specified by:
getServiceDelegate
in interfaceAvalonInterceptorContext
- Returns:
- Returns the serviceDelegate.
-
getServiceName
- Specified by:
getServiceName
in interfaceAvalonInterceptorContext
- Returns:
- Returns the serviceName.
-
getServiceShorthand
- Specified by:
getServiceShorthand
in interfaceAvalonInterceptorContext
- Returns:
- Returns the serviceShorthand.
-
getArgs
- Specified by:
getArgs
in interfaceAvalonInterceptorContext
- Returns:
- Returns the args.
-
getMethod
- Specified by:
getMethod
in interfaceAvalonInterceptorContext
- Returns:
- Returns the method.
-
getThreadContext
- Specified by:
getThreadContext
in interfaceAvalonInterceptorContext
- Returns:
- Returns the ThreadLocalStorage
-
hasTransactionId
public boolean hasTransactionId()- Specified by:
hasTransactionId
in interfaceAvalonInterceptorContext
- Returns:
- is a transaction id defined for the current thread
-
getTransactionId
- Specified by:
getTransactionId
in interfaceAvalonInterceptorContext
- Returns:
- get the transaction id defined for the current thread
-
setTransactionId
Set the transaction id for the current thread.- Specified by:
setTransactionId
in interfaceAvalonInterceptorContext
- Parameters:
transactionId
- the transaction id
-
clearTransactionId
public void clearTransactionId()Clears the transaction id for the current thread.- Specified by:
clearTransactionId
in interfaceAvalonInterceptorContext
-
incrementInvocationDepth
public void incrementInvocationDepth()Increment the current service invocation depth- Specified by:
incrementInvocationDepth
in interfaceAvalonInterceptorContext
-
decrementInvocationDepth
public void decrementInvocationDepth()Decrement the current service invocation depth- Specified by:
decrementInvocationDepth
in interfaceAvalonInterceptorContext
-
getInvocationDepth
public int getInvocationDepth()Get the current service invocation depth- Specified by:
getInvocationDepth
in interfaceAvalonInterceptorContext
- Returns:
- the current service invocation depth
-
getInvocationId
- Specified by:
getInvocationId
in interfaceAvalonInterceptorContext
- Returns:
- Returns the invocationId.
-
toString
-