Invocation API 1.1.0.Final

org.jboss.invocation
Class ContextClassLoaderInterceptor

java.lang.Object
  extended by 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

Constructor Summary
ContextClassLoaderInterceptor(ClassLoader classLoader)
          Construct a new instance.
 
Method Summary
 Object processInvocation(InterceptorContext context)
          Process an invocation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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:
processInvocation in interface Interceptor
Parameters:
context - the interceptor context
Returns:
the result of the invocation
Throws:
Exception - If the underlying invocation resulted in some exception

Invocation API 1.1.0.Final

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.