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

agents.magagent.MagAgent Class Reference

Collaboration diagram for agents.magagent.MagAgent:
[legend]
List of all members.

Public Member Functions

byte[] marshall (Object obj) throws Exception
 -------------------- public methods
Object unmarshall (byte b[]) throws Exception
void addBehaviour (Behaviour b)
void migrateAgent (String location)
void terminateAgent ()
void redirectOutput (Thread th, String appReposId)
void disableRedirectOutput (Thread th)
void appFinished (String appExecutionId)
void errorMessage (String appReposId, String message)
String getAhIor ()
void setAhIor (String ahIor)
String getAppArgs ()
void setAppArgs (String appArgs)
String getAppConstraints ()
void setAppConstraints (String appConstraints)
MagApplication getApplication ()
void setApplication (MagApplication application)
String getAppMainRequestId ()
void setAppMainRequestId (String appMainRequestId)
String getAppName ()
void setAppName (String appName)
String getAppNodeRequestId ()
void setAppNodeRequestId (String appNodeRequestId)
String getAppPreferences ()
void setAppPreferences (String appPreferences)
String getAppReposId ()
void setAppReposId (String appReposId)
Object[] getArgs ()
void setArgs (Object[] args)
String getAsctIor ()
void setAsctIor (String asctIor)
String getAppExecutionId ()
void setAppExecutionId (String appExecutionId)
ArrayList getInputFiles ()
void setInputFiles (ArrayList inputFiles)
ArrayList getOutputFiles ()
void setOutputFiles (ArrayList outputFiles)
String getSource ()
void setSource (String source)
String getUserName ()
void setUserName (String userName)
Boolean getRecovering ()
void setRecovering (Boolean recovering)
byte[] getSerializedApplication ()
void setSerializedApplication (byte[] serializedApplication)
byte[] getCompressedCheckpoint ()
void setCompressedCheckpoint (byte[] compressedCheckpoint)

Protected Member Functions

void setup ()
 -------------------- protected methods
void beforeMove ()
void afterMove ()
void takeDown ()

Private Member Functions

Behaviour registerAgent ()
 -------------------- private methods
ExecutionInfo createExecutionInfo ()
void saveToFile (String directory, String fileName, byte b[]) throws Exception
void collectArguments ()
void clearBehaviourList ()
byte[] suspendAppExecution ()

Private Attributes

AID emaAID = null
 -------------------- fields
AID stableStorageAID = null
Codec codec = new LEAPCodec()
Ontology ontology = MAGOntology.getInstance()
String appReposId = ""
String appName = ""
String ahIor = ""
String appExecutionId = ""
String appArgs = ""
String appMainRequestId = ""
String appNodeRequestId = ""
String asctIor = ""
ArrayList outputFiles
ArrayList inputFiles
String appConstraints = ""
String appPreferences = ""
String userName = ""
String source = ""
HashSet behaviourSet = null
byte serializedApplication []
transient byte compressedCheckpoint [] = null
transient Boolean recovering = new Boolean (false)
transient AgentHandlerImpl agentHandler = null
transient MagApplication application = null
transient Object[] args = null
transient ThreadAwareOutputStream out = null
transient ThreadAwareOutputStream err = null

Detailed Description

Class MagAgent - Mobile agent responsible for the execution and control of applications in the grid

This mobile agent execute applications in the grid. For each application we have an agent associated with it. MagAgent is also responsible for migrate its application if the user requests the release of the node, and notifies the AgentHandler about the finish of application execution

Author:
Rafael Fernandes Lopes


Member Function Documentation

void agents.magagent.MagAgent.addBehaviour Behaviour  b  ) 
 

void agents.magagent.MagAgent.afterMove  )  [protected]
 

Method invoked on the agent after the end of migration process

void agents.magagent.MagAgent.appFinished String  appExecutionId  ) 
 

Redirect the output of an application to its own output files

Parameters:
th - the application to have the output redirected

void agents.magagent.MagAgent.beforeMove  )  [protected]
 

void agents.magagent.MagAgent.clearBehaviourList  )  [private]
 

void agents.magagent.MagAgent.collectArguments  )  [private]
 

Get the arguments passed to the agent and saves them in private attributes

ExecutionInfo agents.magagent.MagAgent.createExecutionInfo  )  [private]
 

void agents.magagent.MagAgent.disableRedirectOutput Thread  th  ) 
 

Redirect the output of an application to its own output files

Parameters:
th - the application to have the output redirected

void agents.magagent.MagAgent.errorMessage String  appReposId,
String  message
 

Returns an error message to an user

Parameters:
appReposId - the appReposId represents the correct directory where the error file are located
message - message to be returned to an user

String agents.magagent.MagAgent.getAhIor  ) 
 

Returns:
Returns the ahIor.

String agents.magagent.MagAgent.getAppArgs  ) 
 

Returns:
Returns the appArgs.

String agents.magagent.MagAgent.getAppConstraints  ) 
 

Returns:
Returns the appConstraints.

String agents.magagent.MagAgent.getAppExecutionId  ) 
 

Returns:
Returns the appExecutionId.

MagApplication agents.magagent.MagAgent.getApplication  ) 
 

Returns:
Returns the application.

String agents.magagent.MagAgent.getAppMainRequestId  ) 
 

Returns:
Returns the appMainRequestId.

String agents.magagent.MagAgent.getAppName  ) 
 

Returns:
Returns the appName.

String agents.magagent.MagAgent.getAppNodeRequestId  ) 
 

Returns:
Returns the appNodeRequestId.

String agents.magagent.MagAgent.getAppPreferences  ) 
 

Returns:
Returns the appPreferences.

String agents.magagent.MagAgent.getAppReposId  ) 
 

Returns:
Returns the appReposId.

Object [] agents.magagent.MagAgent.getArgs  ) 
 

Returns:
Returns the args.

String agents.magagent.MagAgent.getAsctIor  ) 
 

Returns:
Returns the asctIor.

byte [] agents.magagent.MagAgent.getCompressedCheckpoint  ) 
 

Returns:
Returns the compressedCheckpoint.

ArrayList agents.magagent.MagAgent.getInputFiles  ) 
 

Returns:
Returns the inputFiles.

ArrayList agents.magagent.MagAgent.getOutputFiles  ) 
 

Returns:
Returns the outputFiles.

Boolean agents.magagent.MagAgent.getRecovering  ) 
 

Returns:
Returns the recovering.

byte [] agents.magagent.MagAgent.getSerializedApplication  ) 
 

Returns:
Returns the serializedApplication.

String agents.magagent.MagAgent.getSource  ) 
 

Returns:
Returns the source.

String agents.magagent.MagAgent.getUserName  ) 
 

Returns:
Returns the userName.

byte [] agents.magagent.MagAgent.marshall Object  obj  )  throws Exception
 

-------------------- public methods

Serializes an object

Parameters:
obj - the object to be serialized
Returns:
the object in serialized form
Exceptions:
Exception case any error occurs

void agents.magagent.MagAgent.migrateAgent String  location  ) 
 

Migrate this agent and its application

Parameters:
location - Location where the agent have to migrate. Location represents a container name

void agents.magagent.MagAgent.redirectOutput Thread  th,
String  appReposId
 

Redirect the output of an application to its own output files

Parameters:
th - the application to have the output redirected
appReposId - the appReposId represents the correct directory where the files are located

Behaviour agents.magagent.MagAgent.registerAgent  )  [private]
 

-------------------- private methods

Register the agent in the AgentMap

void agents.magagent.MagAgent.saveToFile String  directory,
String  fileName,
byte  b[]
throws Exception [private]
 

Saves a serialized bytecode on filesystem

Parameters:
directory - directory where to put the file
fileName - the name of the file to be saved
b - a serialized object
Exceptions:
Exception case any error occurs

void agents.magagent.MagAgent.setAhIor String  ahIor  ) 
 

Parameters:
ahIor The ahIor to set.

void agents.magagent.MagAgent.setAppArgs String  appArgs  ) 
 

Parameters:
appArgs The appArgs to set.

void agents.magagent.MagAgent.setAppConstraints String  appConstraints  ) 
 

Parameters:
appConstraints The appConstraints to set.

void agents.magagent.MagAgent.setAppExecutionId String  appExecutionId  ) 
 

Parameters:
appExecutionId The appExecutionId to set.

void agents.magagent.MagAgent.setApplication MagApplication  application  ) 
 

Parameters:
application The application to set.

void agents.magagent.MagAgent.setAppMainRequestId String  appMainRequestId  ) 
 

Parameters:
appMainRequestId The appMainRequestId to set.

void agents.magagent.MagAgent.setAppName String  appName  ) 
 

Parameters:
appName The appName to set.

void agents.magagent.MagAgent.setAppNodeRequestId String  appNodeRequestId  ) 
 

Parameters:
appNodeRequestId The appNodeRequestId to set.

void agents.magagent.MagAgent.setAppPreferences String  appPreferences  ) 
 

Parameters:
appPreferences The appPreferences to set.

void agents.magagent.MagAgent.setAppReposId String  appReposId  ) 
 

Parameters:
appReposId The appReposId to set.

void agents.magagent.MagAgent.setArgs Object[]  args  ) 
 

Parameters:
args The args to set.

void agents.magagent.MagAgent.setAsctIor String  asctIor  ) 
 

Parameters:
asctIor The asctIor to set.

void agents.magagent.MagAgent.setCompressedCheckpoint byte[]  compressedCheckpoint  ) 
 

Parameters:
compressedCheckpoint The compressedCheckpoint to set.

void agents.magagent.MagAgent.setInputFiles ArrayList  inputFiles  ) 
 

Parameters:
inputFiles The inputFiles to set.

void agents.magagent.MagAgent.setOutputFiles ArrayList  outputFiles  ) 
 

Parameters:
outputFiles The outputFiles to set.

void agents.magagent.MagAgent.setRecovering Boolean  recovering  ) 
 

Parameters:
recovering The recovering to set.

void agents.magagent.MagAgent.setSerializedApplication byte[]  serializedApplication  ) 
 

Parameters:
serializedApplication The serializedApplication to set.

void agents.magagent.MagAgent.setSource String  source  ) 
 

Parameters:
source The source to set.

void agents.magagent.MagAgent.setup  )  [protected]
 

-------------------- protected methods

First method invoked by the mobile agent plataform on an agent when it is instantiated

void agents.magagent.MagAgent.setUserName String  userName  ) 
 

Parameters:
userName The userName to set.

byte [] agents.magagent.MagAgent.suspendAppExecution  )  [private]
 

void agents.magagent.MagAgent.takeDown  )  [protected]
 

This method is invoked before the agent's death

void agents.magagent.MagAgent.terminateAgent  ) 
 

Object agents.magagent.MagAgent.unmarshall byte  b[]  )  throws Exception
 

Deserializes an object

Parameters:
b - the serialized object, to be deserialized
Returns:
the deserialized object
Exceptions:
Exception case any error occurs


Member Data Documentation

transient AgentHandlerImpl agents.magagent.MagAgent.agentHandler = null [private]
 

String agents.magagent.MagAgent.ahIor = "" [private]
 

String agents.magagent.MagAgent.appArgs = "" [private]
 

String agents.magagent.MagAgent.appConstraints = "" [private]
 

String agents.magagent.MagAgent.appExecutionId = "" [private]
 

transient MagApplication agents.magagent.MagAgent.application = null [private]
 

String agents.magagent.MagAgent.appMainRequestId = "" [private]
 

String agents.magagent.MagAgent.appName = "" [private]
 

String agents.magagent.MagAgent.appNodeRequestId = "" [private]
 

String agents.magagent.MagAgent.appPreferences = "" [private]
 

String agents.magagent.MagAgent.appReposId = "" [private]
 

transient Object [] agents.magagent.MagAgent.args = null [private]
 

String agents.magagent.MagAgent.asctIor = "" [private]
 

HashSet agents.magagent.MagAgent.behaviourSet = null [private]
 

Codec agents.magagent.MagAgent.codec = new LEAPCodec() [private]
 

transient byte agents.magagent.MagAgent.compressedCheckpoint[] = null [private]
 

AID agents.magagent.MagAgent.emaAID = null [private]
 

-------------------- fields

transient ThreadAwareOutputStream agents.magagent.MagAgent.err = null [private]
 

ArrayList agents.magagent.MagAgent.inputFiles [private]
 

Ontology agents.magagent.MagAgent.ontology = MAGOntology.getInstance() [private]
 

transient ThreadAwareOutputStream agents.magagent.MagAgent.out = null [private]
 

ArrayList agents.magagent.MagAgent.outputFiles [private]
 

transient Boolean agents.magagent.MagAgent.recovering = new Boolean (false) [private]
 

byte agents.magagent.MagAgent.serializedApplication[] [private]
 

String agents.magagent.MagAgent.source = "" [private]
 

AID agents.magagent.MagAgent.stableStorageAID = null [private]
 

String agents.magagent.MagAgent.userName = "" [private]
 


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