org.objectweb.easybeans.naming.interceptors
Class TomcatENCInterceptor

java.lang.Object
  extended by org.objectweb.easybeans.naming.interceptors.TomcatENCInterceptor
All Implemented Interfaces:
EasyBeansInterceptor

public class TomcatENCInterceptor
extends java.lang.Object
implements EasyBeansInterceptor

Interceptor used when EasyBeans is integrated in Tomcat. As the java: namespace is managed by Tomcat, EasyBeans needs to call Tomcat objects in order to set java: context.

Author:
Florent Benoit

Field Summary
private static java.lang.reflect.Method bindContextMethod
          Method used to bind the component context for the current thread on the Tomcat naming.
private static java.lang.reflect.Method bindThreadMethod
          Method used to bind the name associated to a component context for the current thread on the Tomcat naming.
private static JLog logger
          Logger.
protected static java.lang.String TOMCAT_NAMING_CLASS
          Tomcat's class for naming.
private static java.lang.reflect.Method unbindContextMethod
          Method used to unbind the component context for the current thread on the Tomcat naming.
private static java.lang.reflect.Method unbindThreadMethod
          Method used to unbind the name associated to a context for the current thread on the Tomcat naming.
 
Constructor Summary
TomcatENCInterceptor()
          Default constructor.
 
Method Summary
 java.lang.Object intercept(EasyBeansInvocationContext invocationContext)
          Sets JOnAS ENC context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static JLog logger
Logger.


TOMCAT_NAMING_CLASS

protected static final java.lang.String TOMCAT_NAMING_CLASS
Tomcat's class for naming.

See Also:
Constant Field Values

bindThreadMethod

private static java.lang.reflect.Method bindThreadMethod
Method used to bind the name associated to a component context for the current thread on the Tomcat naming.


unbindThreadMethod

private static java.lang.reflect.Method unbindThreadMethod
Method used to unbind the name associated to a context for the current thread on the Tomcat naming.


bindContextMethod

private static java.lang.reflect.Method bindContextMethod
Method used to bind the component context for the current thread on the Tomcat naming.


unbindContextMethod

private static java.lang.reflect.Method unbindContextMethod
Method used to unbind the component context for the current thread on the Tomcat naming.

Constructor Detail

TomcatENCInterceptor

public TomcatENCInterceptor()
Default constructor. Gets a reference on the tomcat's naming methods

Method Detail

intercept

public java.lang.Object intercept(EasyBeansInvocationContext invocationContext)
                           throws java.lang.Exception
Sets JOnAS ENC context.

Specified by:
intercept in interface EasyBeansInterceptor
Parameters:
invocationContext - context with useful attributes on the current invocation.
Returns:
result of the next invocation (to chain interceptors).
Throws:
java.lang.Exception - needs for signature of interceptor.