org.apache.fulcrum.yaafi.framework.interceptor
Class AvalonInterceptorContextImpl

java.lang.Object
  extended by org.apache.fulcrum.yaafi.framework.interceptor.AvalonInterceptorContextImpl
All Implemented Interfaces:
AvalonInterceptorContext

public class AvalonInterceptorContextImpl
extends java.lang.Object
implements 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
AvalonInterceptorContextImpl(java.lang.String serviceName, java.lang.String serviceShorthand, java.lang.Object serviceDelegate, java.lang.reflect.Method method, java.lang.Object[] args)
          Constructor.
 
Method Summary
 void clearTransactionId()
          Clears the transaction id for the current thread.
 void decrementInvocationDepth()
          Decrement the current service invocation depth
 java.lang.Object[] getArgs()
           
 int getInvocationDepth()
          Get the current service invocation depth
 java.lang.Long getInvocationId()
           
 java.lang.reflect.Method getMethod()
           
 java.util.Map getRequestContext()
           
 java.lang.Object getServiceDelegate()
           
 java.lang.String getServiceName()
           
 java.lang.String getServiceShorthand()
           
 ThreadLocalStorage getThreadContext()
           
 java.lang.Object getTransactionId()
           
 boolean hasTransactionId()
           
 void incrementInvocationDepth()
          Increment the current service invocation depth
 void setTransactionId(java.lang.Object transactionId)
          Set the transaction id for the current thread.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AvalonInterceptorContextImpl

public AvalonInterceptorContextImpl(java.lang.String serviceName,
                                    java.lang.String serviceShorthand,
                                    java.lang.Object serviceDelegate,
                                    java.lang.reflect.Method method,
                                    java.lang.Object[] args)
Constructor.

Parameters:
serviceName - the name of the service being intercepted
serviceShorthand - the shorthand of the service being intercepted
serviceDelegate - the real service implementation
method - the method being invoked
args - the list of arguments for the method invocation
Method Detail

getRequestContext

public final java.util.Map getRequestContext()
Specified by:
getRequestContext in interface AvalonInterceptorContext
Returns:
Returns the context for the given request.

getServiceDelegate

public final java.lang.Object getServiceDelegate()
Specified by:
getServiceDelegate in interface AvalonInterceptorContext
Returns:
Returns the serviceDelegate.

getServiceName

public final java.lang.String getServiceName()
Specified by:
getServiceName in interface AvalonInterceptorContext
Returns:
Returns the serviceName.

getServiceShorthand

public java.lang.String getServiceShorthand()
Specified by:
getServiceShorthand in interface AvalonInterceptorContext
Returns:
Returns the serviceShorthand.

getArgs

public final java.lang.Object[] getArgs()
Specified by:
getArgs in interface AvalonInterceptorContext
Returns:
Returns the args.

getMethod

public final java.lang.reflect.Method getMethod()
Specified by:
getMethod in interface AvalonInterceptorContext
Returns:
Returns the method.

getThreadContext

public final ThreadLocalStorage getThreadContext()
Specified by:
getThreadContext in interface AvalonInterceptorContext
Returns:
Returns the ThreadLocalStorage

hasTransactionId

public boolean hasTransactionId()
Specified by:
hasTransactionId in interface AvalonInterceptorContext
Returns:
is a transaction id defined for the current thread

getTransactionId

public java.lang.Object getTransactionId()
Specified by:
getTransactionId in interface AvalonInterceptorContext
Returns:
get the transaction id defined for the current thread

setTransactionId

public void setTransactionId(java.lang.Object transactionId)
Set the transaction id for the current thread.

Specified by:
setTransactionId in interface AvalonInterceptorContext
Parameters:
transactionId - the transaction id

clearTransactionId

public void clearTransactionId()
Clears the transaction id for the current thread.

Specified by:
clearTransactionId in interface AvalonInterceptorContext

incrementInvocationDepth

public void incrementInvocationDepth()
Increment the current service invocation depth

Specified by:
incrementInvocationDepth in interface AvalonInterceptorContext

decrementInvocationDepth

public void decrementInvocationDepth()
Decrement the current service invocation depth

Specified by:
decrementInvocationDepth in interface AvalonInterceptorContext

getInvocationDepth

public int getInvocationDepth()
Get the current service invocation depth

Specified by:
getInvocationDepth in interface AvalonInterceptorContext
Returns:
the current service invocation depth

getInvocationId

public final java.lang.Long getInvocationId()
Specified by:
getInvocationId in interface AvalonInterceptorContext
Returns:
Returns the invocationId.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.