org.clazzes.util.aop.servlet
Class ThreadLocalServletInterceptor

java.lang.Object
  extended by org.clazzes.util.aop.servlet.ThreadLocalServletInterceptor
All Implemented Interfaces:
org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor

public class ThreadLocalServletInterceptor
extends Object
implements org.aopalliance.intercept.MethodInterceptor

A method interceptor, which binds the servlet request and/or reponse to a thread local key.


Constructor Summary
ThreadLocalServletInterceptor()
           
 
Method Summary
 String getRequestThreadLocalKey()
           
 String getResponseThreadLocalKey()
           
 Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
           
 void setRequestThreadLocalKey(String requestThreadLocalKey)
           
 void setResponseThreadLocalKey(String responseThreadLocalKey)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadLocalServletInterceptor

public ThreadLocalServletInterceptor()
Method Detail

invoke

public Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
              throws Throwable
Specified by:
invoke in interface org.aopalliance.intercept.MethodInterceptor
Throws:
Throwable

getRequestThreadLocalKey

public String getRequestThreadLocalKey()
Returns:
The key under which the servlet request is bound to the current thread using ThreadLocalManager.bindResource(String, Object).

setRequestThreadLocalKey

public void setRequestThreadLocalKey(String requestThreadLocalKey)
Parameters:
requestThreadLocalKey - The key under which the servlet request is bound to the current thread using ThreadLocalManager.bindResource(String, Object) to set. if null, the servlet request will not be bound to the current thread.

getResponseThreadLocalKey

public String getResponseThreadLocalKey()
Returns:
The key under which the servlet response is bound to the current thread using ThreadLocalManager.bindResource(String, Object).

setResponseThreadLocalKey

public void setResponseThreadLocalKey(String responseThreadLocalKey)
Parameters:
responseThreadLocalKey - The key under which the servlet response is bound to the current thread using ThreadLocalManager.bindResource(String, Object) to set. if null, the servlet response will not be bound to the current thread.


Copyright © 2012. All Rights Reserved.