1 6 package org.logicalcobwebs.logging.impl; 7 8 import java.security.PrivilegedAction ; 9 10 19 public class MyPrivilegedAction implements PrivilegedAction { 20 21 private ClassLoader threadCL; 22 23 private String name; 24 25 public MyPrivilegedAction(ClassLoader threadCL, String name) { 26 this.threadCL = threadCL; 27 this.name = name; 28 } 29 30 public Object run() { 31 if (threadCL != null) { 32 try { 33 return threadCL.loadClass(name); 34 } catch (ClassNotFoundException ex) { 35 } 37 } 38 try { 39 return Class.forName(name); 40 } catch (ClassNotFoundException e) { 41 return e; 42 } 43 } 44 45 } 46 47 48 | Popular Tags |