1 7 package org.jboss.ha.httpsession.beanimpl.ejb; 8 9 import org.jboss.ejb.plugins.AbstractInterceptor; 10 import org.jboss.invocation.Invocation; 11 12 16 public class ServerTCLInterceptor extends AbstractInterceptor 17 { 18 public Object invokeHome(Invocation mi) throws Exception 19 { 20 ClassLoader prevTCL = Thread.currentThread().getContextClassLoader(); 21 ClassLoader tcl = (ClassLoader ) mi.getValue("org.jboss.invocation.TCL"); 22 try 23 { 24 if( tcl != null ) 26 Thread.currentThread().setContextClassLoader(tcl); 27 return getNext().invokeHome(mi); 28 } 29 finally 30 { 31 if( tcl != null ) 33 Thread.currentThread().setContextClassLoader(prevTCL); 34 } 35 } 36 37 public Object invoke(Invocation mi) throws Exception 38 { 39 ClassLoader prevTCL = Thread.currentThread().getContextClassLoader(); 40 ClassLoader tcl = (ClassLoader ) mi.getValue("org.jboss.invocation.TCL"); 41 try 42 { 43 if( tcl != null ) 45 Thread.currentThread().setContextClassLoader(tcl); 46 return getNext().invoke(mi); 47 } 48 finally 49 { 50 if( tcl != null ) 52 Thread.currentThread().setContextClassLoader(prevTCL); 53 } 54 } 55 } 56 | Popular Tags |