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 TypeMethodDescriptionvoidClears the transaction id for the current thread.voidDecrement the current service invocation depthfinal Object[]getArgs()intGet the current service invocation depthfinal Longfinal Methodfinal Objectfinal Stringfinal ThreadLocalStoragebooleanvoidIncrement the current service invocation depthvoidsetTransactionId(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:
getRequestContextin interfaceAvalonInterceptorContext- Returns:
- Returns the context for the given request.
-
getServiceDelegate
- Specified by:
getServiceDelegatein interfaceAvalonInterceptorContext- Returns:
- Returns the serviceDelegate.
-
getServiceName
- Specified by:
getServiceNamein interfaceAvalonInterceptorContext- Returns:
- Returns the serviceName.
-
getServiceShorthand
- Specified by:
getServiceShorthandin interfaceAvalonInterceptorContext- Returns:
- Returns the serviceShorthand.
-
getArgs
- Specified by:
getArgsin interfaceAvalonInterceptorContext- Returns:
- Returns the args.
-
getMethod
- Specified by:
getMethodin interfaceAvalonInterceptorContext- Returns:
- Returns the method.
-
getThreadContext
- Specified by:
getThreadContextin interfaceAvalonInterceptorContext- Returns:
- Returns the ThreadLocalStorage
-
hasTransactionId
public boolean hasTransactionId()- Specified by:
hasTransactionIdin interfaceAvalonInterceptorContext- Returns:
- is a transaction id defined for the current thread
-
getTransactionId
- Specified by:
getTransactionIdin interfaceAvalonInterceptorContext- Returns:
- get the transaction id defined for the current thread
-
setTransactionId
Set the transaction id for the current thread.- Specified by:
setTransactionIdin interfaceAvalonInterceptorContext- Parameters:
transactionId- the transaction id
-
clearTransactionId
public void clearTransactionId()Clears the transaction id for the current thread.- Specified by:
clearTransactionIdin interfaceAvalonInterceptorContext
-
incrementInvocationDepth
public void incrementInvocationDepth()Increment the current service invocation depth- Specified by:
incrementInvocationDepthin interfaceAvalonInterceptorContext
-
decrementInvocationDepth
public void decrementInvocationDepth()Decrement the current service invocation depth- Specified by:
decrementInvocationDepthin interfaceAvalonInterceptorContext
-
getInvocationDepth
public int getInvocationDepth()Get the current service invocation depth- Specified by:
getInvocationDepthin interfaceAvalonInterceptorContext- Returns:
- the current service invocation depth
-
getInvocationId
- Specified by:
getInvocationIdin interfaceAvalonInterceptorContext- Returns:
- Returns the invocationId.
-
toString
-