    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.

##

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

##

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

##

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

##

parent

     protected Agent parent

  Agent whose Resources are managed.

ClassLoaders

     protected Hashtable ClassLoaders

  Storage for NetworkClassLoaders used to load remote classes into the current runtime. Type NetworkClassLoader.

addresses

     protected Addresses addresses

  Local storage for agent addresses. Identifiers are Agent names, type String, elements are addresses, type AgentAddress.

classes

     protected Classes classes

  Storage for all Classes loaded into the runtime. Identifiers are class names, type String, elements are the classes, type Class.

files

     protected Files files

  Storage for all local Files.

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.

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.

##

ResourceManager

     public ResourceManager(Agent parent)

  Initializes the memory and contents of all Agent resources.

##

addSystemMessage

     public void addSystemMessage(String message)

  Sends a system message to the agent.

  Parameters:
    message - The system message to output.

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.

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.

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.

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