1 22 package org.jboss.ejb.plugins.inflow; 23 24 import java.security.AccessController ; 25 import java.security.PrivilegedAction ; 26 27 31 public class SetTCLAction implements PrivilegedAction  32 { 33 Thread t; 34 ClassLoader loader; 35 36 SetTCLAction(Thread t, ClassLoader loader) 37 { 38 this.t = t; 39 this.loader = loader; 40 } 41 public Object run() 42 { 43 t.setContextClassLoader(loader); 44 loader = null; 45 return null; 46 } 47 48 static void setContextClassLoader(Thread t, ClassLoader loader) 49 { 50 SetTCLAction action = new SetTCLAction(t, loader); 51 AccessController.doPrivileged(action); 52 } 53 54 } 55 56 | Popular Tags |