Main Page | Packages | Class Hierarchy | Class List | Directories | File List | Class Members

container.AgentHandlerImpl Class Reference

Inherits interfaces.AgentHandlerPOA.

Inheritance diagram for container.AgentHandlerImpl:

[legend]
Collaboration diagram for container.AgentHandlerImpl:
[legend]
List of all members.

Public Member Functions

boolean registerAgent (MagAgent magAgent, String appId, String appMainRequestId, String appNodeRequestId, String appConstraints, String appPreferences, String asctIor, ArrayList outputFiles)
boolean unregisterAgent (String appId)
void executeApp (String applicationId, String appArgs, String asctIor, String appMainRequestId, String appNodeRequestId, String appConstraints, String appPreferences, String[] outputFiles)
void restoreApp (String appExecutionId, String applicationId, String appName, String appArgs, String asctIor, String appMainRequestId, String appNodeRequestId, String appConstraints, String appPreferences, String[] outputFiles)
void releaseNode ()
Agent getAgent (String execId)
subtypes.FileStruct[] requestOutputFiles (String appId)
void appFinished (String appId)
void kill (String appId)
ThreadAwareOutputStream requestOutputStream ()
ThreadAwareOutputStream requestErrorStream ()

Static Public Member Functions

static AgentHandlerImpl getInstance ()

Package Functions

 AgentHandlerImpl (String file)

Private Member Functions

void cleanup ()
void removeDirectory (File directory)

Private Attributes

String ipMainContainer = ""
String myIor = ""
String iorFile = ""
AgentContainer ac
HashMap map
ThreadAwareOutputStream out = null
ThreadAwareOutputStream err = null

Static Private Attributes

static AgentHandlerImpl instance = null

Detailed Description

Class AgentHandlerImpl - Servant implementation of AgentHandler

The AgentHandler acts as a mobile agent container, becoming transparent to the grid, the existence of mobile agents.

Author:
Rafael Fernandes Lopes


Constructor & Destructor Documentation

container.AgentHandlerImpl.AgentHandlerImpl String  file  )  [package]
 

Creates a new AgentHandlerImpl object

Parameters:
file - path of local AgentHandler IOR file


Member Function Documentation

void container.AgentHandlerImpl.appFinished String  appId  ) 
 

Method invoked by an agent to inform that an application execution has finished

Parameters:
appId - Id of current execution request

void container.AgentHandlerImpl.cleanup  )  [private]
 

Removes the application directories. These directories stores the execution results of applications, including the outputs

void container.AgentHandlerImpl.executeApp String  applicationId,
String  appArgs,
String  asctIor,
String  appMainRequestId,
String  appNodeRequestId,
String  appConstraints,
String  appPreferences,
String[]  outputFiles
 

Method that starts the execution of an application on a grid node

Parameters:
applicationId - Id of application in the ApplicationRepository
appArgs - Application arguments
asctIor - Asct IOR that generated the request to grid
appMainRequestId - Reserved for future use
appNodeRequestId - Reserved for future use
appConstraints - Constraints of an application
appPreferences - Prefences of an application
outputFiles - List of output files requested by the user

Agent container.AgentHandlerImpl.getAgent String  execId  ) 
 

static AgentHandlerImpl container.AgentHandlerImpl.getInstance  )  [static]
 

Returns the singleton instance of the local AgentHandler

Returns:
instance of the unique local AgentHandler

void container.AgentHandlerImpl.kill String  appId  ) 
 

Method invoked by an Asct to kill a specific application

Parameters:
appId - Id of current execution reque

boolean container.AgentHandlerImpl.registerAgent MagAgent  magAgent,
String  appId,
String  appMainRequestId,
String  appNodeRequestId,
String  appConstraints,
String  appPreferences,
String  asctIor,
ArrayList  outputFiles
 

Register an agent/application information in local AgentHandler

Parameters:
magAgent - The agent reference
appId - Id of current execution request
appMainRequestId - Reserved for future use
appNodeRequestId - Reserved for future use
appConstraints - Constraints of an application
appPreferences - Prefences of an application
asctIor - Asct IOR that generated the request to grid
outputFiles - List of output files requested by the user
Returns:
true if the register occurs successfully; otherwise returns false

void container.AgentHandlerImpl.releaseNode  ) 
 

Release the local node. If a user requests the local machine, it have to be released for he/she use.

Implements interfaces.AgentHandlerOperations.

void container.AgentHandlerImpl.removeDirectory File  directory  )  [private]
 

Used by the cleanup method to remove a directory recursively

Parameters:
directory - Directory to be removed

ThreadAwareOutputStream container.AgentHandlerImpl.requestErrorStream  ) 
 

Method invoked by an agent to request the error output stream

Returns:
the output error controller

subtypes.FileStruct [] container.AgentHandlerImpl.requestOutputFiles String  appId  ) 
 

Method invoked by an Asct to request the output files generated by an application execution

Parameters:
appId - Id of current execution request
Returns:
an array of FileStruct (each of them representing an output file)

ThreadAwareOutputStream container.AgentHandlerImpl.requestOutputStream  ) 
 

Method invoked by an agent to request the output stream

Returns:
the output controller

void container.AgentHandlerImpl.restoreApp String  appExecutionId,
String  applicationId,
String  appName,
String  appArgs,
String  asctIor,
String  appMainRequestId,
String  appNodeRequestId,
String  appConstraints,
String  appPreferences,
String[]  outputFiles
 

boolean container.AgentHandlerImpl.unregisterAgent String  appId  ) 
 

Unregister an agent/application information from local AgentHandler

Parameters:
appId - Id of current execution request to be unregistered
Returns:
returns true, if no errors occurs; otherwise returns false


Member Data Documentation

AgentContainer container.AgentHandlerImpl.ac [private]
 

ThreadAwareOutputStream container.AgentHandlerImpl.err = null [private]
 

AgentHandlerImpl container.AgentHandlerImpl.instance = null [static, private]
 

String container.AgentHandlerImpl.iorFile = "" [private]
 

String container.AgentHandlerImpl.ipMainContainer = "" [private]
 

HashMap container.AgentHandlerImpl.map [private]
 

String container.AgentHandlerImpl.myIor = "" [private]
 

ThreadAwareOutputStream container.AgentHandlerImpl.out = null [private]
 


The documentation for this class was generated from the following file:
Generated on Fri Feb 17 09:37:57 2006 for MAG by  doxygen 1.4.4