Package org.jboss.invocation
Class ContextClassLoaderInterceptor
- java.lang.Object
-
- org.jboss.invocation.ContextClassLoaderInterceptor
-
- All Implemented Interfaces:
Serializable,Interceptor
public final class ContextClassLoaderInterceptor extends Object implements Interceptor, Serializable
An interceptor which sets the thread context class loader for the duration of an invocation. Note that this interceptor is only serializable if the given class loader is serializable.- Author:
- David M. Lloyd
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.jboss.invocation.Interceptor
EMPTY_ARRAY
-
-
Constructor Summary
Constructors Constructor Description ContextClassLoaderInterceptor(ClassLoader classLoader)Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectprocessInvocation(InterceptorContext context)Process an invocation.
-
-
-
Constructor Detail
-
ContextClassLoaderInterceptor
public ContextClassLoaderInterceptor(ClassLoader classLoader)
Construct a new instance.- Parameters:
classLoader- the class loader to use
-
-
Method Detail
-
processInvocation
public Object processInvocation(InterceptorContext context) throws Exception
Process an invocation. The invocation can be handled directly, or passed on to the next processor in the chain.- Specified by:
processInvocationin interfaceInterceptor- Parameters:
context- the interceptor context- Returns:
- the result of the invocation
- Throws:
Exception- If the underlying invocation resulted in some exception
-
-