Class JavaAgent.agent.ResourceManager
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JavaAgent.agent.ResourceManager

java.lang.Object
   |
   +----JavaAgent.agent.ResourceManager

public class ResourceManager
extends Object
Manages all of the Resource objects for a specific Agent.


Copyright (c) 1995, H. Robert Frost, Stanford University. All rights reserved.

Copyright (c) 1996, H. Robert Frost, Enterprise Integration Technologies, Inc. All rights reserved.

RESTRICTED RIGHTS LEGEND: Use, duplication or disclosure by the Government is subject to restrictions as set forth in subparagraph(c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013 and in similar clauses in the FAR and NASA FAR supplement.

This software is bound by the terms and conditions listed in the attached LICENSE file.



Variable Index

 o addresses
Local storage for agent addresses.
 o classes
Storage for all Classes loaded into the runtime.
 o ClassLoaders
Storage for NetworkClassLoaders used to load remote classes into the current runtime.
 o files
Storage for all local Files.
 o interpreters
Storage for the subclasses of Interpreter which the agent can understand.
 o languages
Storage for the subclasses of Language which the agent can understand.
 o parent
Agent whose Resources are managed.

Constructor Index

 o ResourceManager(Agent)
Initializes the memory and contents of all Agent resources.

Method Index

 o addSystemMessage(String)
Sends a system message to the agent.
 o addSystemMessage(String, Exception)
Sends a system message to the agent w/ exception.
 o getResource(String)
Get the resource object for the specified type.
 o loadClass(URL, String)
Called to load a remote class into the current runtime environment.
 o loadResource(String, String, String, String)
Loads a given resource.

Variables

 o parent
  protected Agent parent
Agent whose Resources are managed.
 o ClassLoaders
  protected Hashtable ClassLoaders
Storage for NetworkClassLoaders used to load remote classes into the current runtime. Type NetworkClassLoader.
 o addresses
  protected Addresses addresses
Local storage for agent addresses. Identifiers are Agent names, type String, elements are addresses, type AgentAddress.
 o classes
  protected Classes classes
Storage for all Classes loaded into the runtime. Identifiers are class names, type String, elements are the classes, type Class.
 o files
  protected Files files
Storage for all local Files.
 o interpreters
  protected Interpreters interpreters
Storage for the subclasses of Interpreter which the agent can understand. Identifiers are Interpreter names, type String, elements are instances of Interpreter, type Interpreter.
 o languages
  protected Languages languages
Storage for the subclasses of Language which the agent can understand. Identifiers are language names, type String, elements are subclasses of Language, type Class.

Constructors

 o ResourceManager
  public ResourceManager(Agent parent)
Initializes the memory and contents of all Agent resources.

Methods

 o addSystemMessage
  public void addSystemMessage(String message)
Sends a system message to the agent.
Parameters:
message - The system message to output.
 o addSystemMessage
  public void addSystemMessage(String message,
                               Exception e)
Sends a system message to the agent w/ exception.
Parameters:
message - The system message to output.
e - Exception which generated the message, may be null.
 o loadResource
  public void loadResource(String type,
                           String name,
                           String object_name,
                           String url)
Loads a given resource. If the resource currently exists does not overwrite.
Parameters:
type - Type of resource, either language, Interpreter or class
name - The identifier for the resource.
object_name - The class or file name.
url - The code base for the class.
 o getResource
  public Resource getResource(String type)
Get the resource object for the specified type.
Parameters:
type - Resource type to get, one of: "address", "language", "interpreter" or "class".
Returns:
Resource object or null if type does not exist.
 o loadClass
  public Class loadClass(URL code_url,
                         String name)
Called to load a remote class into the current runtime environment. First check to see if a loader for the URL already exists, only create a new loader if one doesn't currently exist. Returns null if no code is found.
Parameters:
code_url - code base URL
name - Class name.
Returns:
The loaded Class.

All Packages  Class Hierarchy  This Package  Previous  Next  Index