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

application.MagApplication Class Reference

List of all members.

Public Member Functions

String getAppExecutionId ()
void setAppExecutionId (String appExecutionId)
void setBaseDir (String baseDir)
final void captureCheckpoint ()
 MagApplication ()
 MagApplication (String args[])
final void doStart ()
final void doYield ()
final void doResume ()
final void doResume (Context context)
abstract void run ()

Protected Member Functions

final boolean notLastStackInContext ()
final synchronized void copyStableCheckpoint ()
final boolean isSwitching ()
final boolean isStopping ()
final boolean isRestoring ()
final void mayCheckpoint ()

Protected Attributes

Context tmpContext
Context myContext = null
boolean switching = false
boolean restoring = false
boolean stopping = false
transient long lastCheckpointTimestamp
transient File baseDir = null

Private Attributes

String appExecutionId

Static Private Attributes

static final int SLEEP_TIME = 5000

Detailed Description

Class MagApplication - Represents a MAG application

To execute an application on the grid, the user must extend this abstract class

Author:
Rafael Fernandes Lopes


Constructor & Destructor Documentation

application.MagApplication.MagApplication  ) 
 

application.MagApplication.MagApplication String  args[]  ) 
 


Member Function Documentation

final void application.MagApplication.captureCheckpoint  ) 
 

Retrieve the application's checkpoint. If there isn't a new checkpoint returns null. This method is invoked by the CheckpointCollectorBehaviour

Returns:
the application's checkpoint or null if there isn't a new checkpoint.

final synchronized void application.MagApplication.copyStableCheckpoint  )  [protected]
 

An internal method used for copy the actual checkpoint from the temporary context (tmpContext) to the 'stable' context attribute (myContext)

final void application.MagApplication.doResume Context  context  ) 
 

final void application.MagApplication.doResume  ) 
 

Resumes the execution of an instrumented application, from its own context.

final void application.MagApplication.doStart  ) 
 

Method invoked by the MagAgent to start the execution of an user application

final void application.MagApplication.doYield  ) 
 

Stops the execution of an instrumented application, and force it save its own context. Method invoked by the MagAgent in the migration mechanism

String application.MagApplication.getAppExecutionId  ) 
 

Returns:
Returns the appExecutionId.

final boolean application.MagApplication.isRestoring  )  [protected]
 

Test done by the instrumented application code, asking if the execution state must be restored from the application context

Returns:
true if the application have to restore its own context

final boolean application.MagApplication.isStopping  )  [protected]
 

Test done by the instrumented application code, asking if the execution must be stopped

Returns:
true if the application have to stop

final boolean application.MagApplication.isSwitching  )  [protected]
 

Test done by the instrumented application code, asking if the execution state must be captured

Returns:
true if the application have to capture its context

final void application.MagApplication.mayCheckpoint  )  [protected]
 

Force the capture of a checkpoint

final boolean application.MagApplication.notLastStackInContext  )  [protected]
 

Returns 'true' if it isn't the last stackframe in this context object.

abstract void application.MagApplication.run  )  [pure virtual]
 

Abstract method that forces the user to implement the run() method

void application.MagApplication.setAppExecutionId String  appExecutionId  ) 
 

Parameters:
appExecutionId The appExecutionId to set.

void application.MagApplication.setBaseDir String  baseDir  ) 
 

Parameters:
baseDir The baseDir to set.


Member Data Documentation

String application.MagApplication.appExecutionId [private]
 

transient File application.MagApplication.baseDir = null [protected]
 

transient long application.MagApplication.lastCheckpointTimestamp [protected]
 

Context application.MagApplication.myContext = null [protected]
 

boolean application.MagApplication.restoring = false [protected]
 

final int application.MagApplication.SLEEP_TIME = 5000 [static, private]
 

boolean application.MagApplication.stopping = false [protected]
 

boolean application.MagApplication.switching = false [protected]
 

Context application.MagApplication.tmpContext [protected]
 


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