FileDocCategorySizeDatePackage
MultiLoader.javaAPI DocExample2555Sun Oct 25 18:13:34 GMT 1998None

MultiLoader

public class MultiLoader extends JavaRunnerLoader

Fields Summary
private static final String
server
Constructors Summary
public MultiLoader(String url, ClassLoader parent)


	     
		super(url, parent);
	
Methods Summary
protected java.lang.ClassfindClass(java.lang.String name)

		URL codeURL;

		SecurityManager sm = System.getSecurityManager();
		if (sm != null) {
			int i = name.lastIndexOf('.");
			if (i >= 0)
				sm.checkPackageDefinition(name.substring(0, i));
		}

		try {
			String codeName = name.replace('.", '/") + ".class";
			if (name.startsWith("com.xyz.support"))
				codeURL = new URL("http://" + server + codeName);
			else codeURL = new URL(urlBase, codeName);
			if (printLoadMessages)
				System.out.println("Loading " + name + " from " + codeURL);
			InputStream is = codeURL.openConnection().getInputStream();
			byte buf[] = getClassBytes(is);
			// Starting in 1.2 beta 4, we no longer use a code source in
			// this example
			// return defineClass(name, buf, 0, buf.length, cs, null);
			return defineClass(name, buf, 0, buf.length);
		} catch (Exception e) {
			return null;
		}