1 22 package org.jboss.mx.capability; 23 24 33 public class DispatchClassLoader extends ClassLoader 34 { 35 36 private String name = null; 38 private byte[] code = null; 39 40 DispatchClassLoader(ClassLoader parent, String name, byte[] bytecode) 42 { 43 super(parent); 44 45 this.name = name; 46 this.code = bytecode; 47 } 48 49 DispatchClassLoader(String name, byte[] bytecode) 50 { 51 super(); 52 53 this.name = name; 54 this.code = bytecode; 55 } 56 57 protected Class findClass(String name) throws ClassNotFoundException 59 { 60 if (!name.equals(this.name)) 61 throw new ClassNotFoundException ("Class not found: " + name + "(I'm a dispatch loader, I only know " + this.name + ")"); 62 63 return defineClass(name, code, 0, code.length); 64 65 } 66 } 67 68 69 70 71 | Popular Tags |