All Packages Class Hierarchy This Package Previous Next Index
Class ajanta.server.AgentLoader
java.lang.Object
|
+----java.lang.ClassLoader
|
+----ajanta.server.AgentLoader
- public class AgentLoader
- extends ClassLoader
Class AgentLoader is our class loader which is used to isolate incoming
agents into separate protection domains.
Each executing agent is assigned a separate class loader
object that is responsible for locating and loading any classes that
are needed during the agent's execution. Whenever the agent code
encounters an object reference for which the class is not currently
loaded, the Java virtual machine requests the agent's class loader to
load it.
-
AgentLoader(AgentServer, URN, URN, String)
-
-
loadClass(String, boolean)
- The loadClass method is automatically invoked by the JVM whenever
it encounters a reference of a type which is not already known to it.
AgentLoader
public AgentLoader(AgentServer as,
URN ag,
URN c,
String p)
- Parameters:
- as - current agent server of the agent
- ag - URN of the agent
- c - URN of the codebase
- p - startup path ...path to StartUP class
loadClass
protected Class loadClass(String name,
boolean resolve) throws ClassNotFoundException
- The loadClass method is automatically invoked by the JVM whenever
it encounters a reference of a type which is not already known to it.
Our implementation of the class loader first searches the
server's classpath --- the set of directories on the local file system
which contain classes trusted by the server. If the requisite bytecode
is found on the classpath, it is loaded into the virtual machine.
Otherwise, the agent's code base is contacted to download the bytecode
for the desired class. It send a ClassRequest to the code base for required class.
Thus, if a trusted version of the required
class is available locally, it is always used in preference to the code
available from the agent's code base.
- Overrides:
- loadClass in class ClassLoader
All Packages Class Hierarchy This Package Previous Next Index