Class JavaAgent.resource.RetrievalResource
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JavaAgent.resource.RetrievalResource

java.lang.Object
   |
   +----JavaAgent.resource.Resource
           |
           +----JavaAgent.resource.RetrievalResource

public class RetrievalResource
extends Resource
Subclass of Resource which the Agent will attempt to retrieve from other Agents when that resource is not available. Example of this type of Resource are: addresses, languages and interpreters.
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 BLOCK
Block retrieval.
 o SEND_MSG
Send out message then block.

Constructor Index

 o RetrievalResource(Agent)
Constructor for the resource.

Method Index

 o block(Object)
Block until the element is put in the Resource.
 o getMissingAction(Object, int, String)
Called when there is an attempt to retrieve an element associated with a non-existent identifier.
 o getReceiver(Object)
 o getType()
 o send_message(Object, String)
Send out a retrieval message.

Variables

 o BLOCK
  public final static int BLOCK
Block retrieval.
 o SEND_MSG
  public final static int SEND_MSG
Send out message then block.

Constructors

 o RetrievalResource
  public RetrievalResource(Agent agent)
Constructor for the resource.
Parameters:
agent - The Agent which owns the resource.

Methods

 o getMissingAction
  public Object getMissingAction(Object identifier,
                                 int retrieve_option,
                                 String receiver) throws ResourceException
Called when there is an attempt to retrieve an element associated with a non-existent identifier. If an attempt to retrieve the given identifier should be taken (determined by the abstract retrieve() method, then the action taken depends on the specified retrieve_option: Other options can be specified by subclasses of RetrievalResource. If the element is null, the Agent was unable to retrieve the element and the null object is removed and a ResourceException is thrown.

Parameters:
identifier - Object identifier for the element.
retrieve_option - Specifies action to take if the element is not currently present.
receiver - Agent to whom retrieve requests should be sent, null if default should be used.
Returns:
Object to be returned.
Overrides:
getMissingAction in class Resource
 o block
  protected Object block(Object identifier) throws ResourceException
Block until the element is put in the Resource. Each wait is timed and after a set number of notify calls the retrieval attempt is halted and a exception is thrown.
Parameters:
identifier - Identifier for the element.
 o send_message
  protected void send_message(Object identifier,
                              String receiver)
Send out a retrieval message.
Parameters:
identifier - Object identifier for the element.
receiver - Agent to whom retrieve requests should be sent, null if default should be used.
 o getReceiver
  protected abstract String getReceiver(Object identifier)
 o getType
  protected abstract String getType()

All Packages  Class Hierarchy  This Package  Previous  Next  Index