metaglue
Class MetaglueClassLoader

java.lang.Object
  |
  +--java.lang.ClassLoader
        |
        +--metaglue.MetaglueClassLoader

public class MetaglueClassLoader
extends ClassLoader

A ClassLoader which can transfer files between MetaglueAgents. Highly useful for letting agents defined in one society interact with agents defined elsewhere, but probably insecure as all get out.

Here's the idea: RMI requires that you specify where classes get loaded from. Normally, that's either the local class path into the filesystem, or it's over the web through special URLs. This will talk to a MetaglueAgent and get the stub information for the classes that it has loaded.

This is designed to be lightweight and used inside a ChainingClassLoader, which handles the organization of multiple such loaders.

See Also:
ChainingClassLoader, ClassLoader

Constructor Summary
MetaglueClassLoader(Metaglue ma, ClassLoader parent)
           
 
Method Summary
 boolean equals(AgentID a)
           
 byte[] fetchClassData(String name)
           
protected  Class findClass(String name)
          Get the class for the given name by talking to the MetaglueAgent.
 AgentID getMetaglueAgentID()
           
 void setMetaglue(Metaglue ma)
           
 
Methods inherited from class java.lang.ClassLoader
defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetaglueClassLoader

public MetaglueClassLoader(Metaglue ma,
                           ClassLoader parent)
Method Detail

setMetaglue

public void setMetaglue(Metaglue ma)

getMetaglueAgentID

public AgentID getMetaglueAgentID()

equals

public boolean equals(AgentID a)

fetchClassData

public byte[] fetchClassData(String name)
                      throws ClassNotFoundException,
                             RemoteException

findClass

protected Class findClass(String name)
                   throws ClassNotFoundException
Get the class for the given name by talking to the MetaglueAgent.
Overrides:
findClass in class ClassLoader
Parameters:
name - the name of the class
Returns:
the class given that name.