MicroTAPAS.mobility
Class MobilityApplicationActor

java.lang.Object
  |
  +--MicroTAPAS.MicroActor
        |
        +--MicroTAPAS.MicroApplicationActor
              |
              +--MicroTAPAS.mobility.MobilityApplicationActor
All Implemented Interfaces:
ControlInterface, MicroActorInterface, java.io.Serializable
Direct Known Subclasses:
MicroTesterBase, MicroTesterServer

public abstract class MobilityApplicationActor
extends MicroApplicationActor

This abstract class adds a layer of mobility to the actor hierarchy

See Also:
Serialized Form

Field Summary
private  CapsMonitorAgent cma
          Instance of the capability monitor agent used for monitoring node vs. actor capabilities.
protected static boolean DEBUG
          Determines whether debug info to be sent to debug-server
protected  boolean doRegister
          Variable to that tells the actor to register.
protected  boolean isRegistered
          This boolean is set to true if the actor is registered.
private  java.util.Vector reqQueue
          Queue to hold requests while in a move phase.
private  java.lang.String selectedStrategy
          The currently selected move strategy.
 
Fields inherited from class MicroTAPAS.MicroActor
bf, context, debug, fh, properties
 
Constructor Summary
MobilityApplicationActor()
          Constructor
 
Method Summary
 RequestResult actorChangeBehaviour(java.lang.String pRoleId, java.lang.Object ai)
          Request to perform an actor change behaviour for own actor.
 RequestResult actorChangeBehaviour(java.lang.String pRoleId, java.lang.String[] pars)
          Deprecated. Replaced by actorChangeBehaviour(String, Object)
 RequestResult actorMove(GAI moveTo)
          Received from CapsMonitorAgent when the offered capabilites of this node has become 'less' than the required capabilites for this actor, or as a explicit command.
protected  RequestResult actorRegister()
          Method used to register this actor with both MA and MM.
protected  RequestResult actorRegisterCancel(boolean isMoved)
          Method used to registerCancel this actor with both local MicroPNES and homeInterface MicroPNES (director node).
 RequestResult applicationActorEntry(RequestPars pRP)
          Common entry point for all actors of this type
 void cleanUp()
          Gives this Actor instance a chance to clean up when the DebugWindow is closed.
 RequestResult control(java.lang.String cmd, java.lang.String[] pars)
          Overloaded mehtod that controls the actor, invokes its functionality, BaseFrame input field can trigger it, as can RoleSessionActions, or the ScriptHandler.
abstract  void createInterface(java.lang.Object actorInterface)
          Mehtod that enables the (re-)creation of an interface at an actor.
abstract  java.lang.Object getInterface()
          Method to retrieve the interface of an actor.
 GAI getMAGAI()
           
 GAI getMMGAI()
           
 Item help()
          Method to display a hierarchy of available commands
 void init(ActorContext pAC)
          To leave constructor empty, this method is used to initialize Object data
abstract  RequestResult mobilityActorEntry(RequestPars rp)
          Common entry point for all actors who subclass this class.
private  RequestResult sendCreateInterface(GAI receiver)
          Deprecated. Replaced by sendCreateInterface(GAI,ActorContext,Object)
private  RequestResult sendCreateInterface(GAI receiver, ActorContext ac, java.lang.Object oldActInterface)
          Method to re-create this actor's interface at another actor
 Item status()
          Report this actor's status through Item elements
 void term()
          Terminate method from the ActorInterface.
 
Methods inherited from class MicroTAPAS.MicroApplicationActor
actorBehaviourPlugIn, actorBehaviourPlugOut, ActorCapabilities, actorEntry, ActorPlay, actorPlugIn, actorPlugOut, anyOtherRequestType, closeBF, playChangesPlugIn, playPlugIn, playPlugOut, requestToActor, RoleSessionAction, subscribeCancel, subscribeReport, subscribeRequest
 
Methods inherited from class MicroTAPAS.MicroActor
findRoleSession, getGAI, start, terminalMove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

protected static final boolean DEBUG
Determines whether debug info to be sent to debug-server

See Also:
Constant Field Values

doRegister

protected boolean doRegister
Variable to that tells the actor to register.


isRegistered

protected boolean isRegistered
This boolean is set to true if the actor is registered.


cma

private CapsMonitorAgent cma
Instance of the capability monitor agent used for monitoring node vs. actor capabilities.


selectedStrategy

private java.lang.String selectedStrategy
The currently selected move strategy.


reqQueue

private java.util.Vector reqQueue
Queue to hold requests while in a move phase.

Constructor Detail

MobilityApplicationActor

public MobilityApplicationActor()
Constructor

Method Detail

init

public void init(ActorContext pAC)
To leave constructor empty, this method is used to initialize Object data

Overrides:
init in class MicroApplicationActor
Parameters:
pAC - context data for this actor

mobilityActorEntry

public abstract RequestResult mobilityActorEntry(RequestPars rp)
                                          throws java.lang.Exception
Common entry point for all actors who subclass this class.

java.lang.Exception

createInterface

public abstract void createInterface(java.lang.Object actorInterface)
Mehtod that enables the (re-)creation of an interface at an actor.


getInterface

public abstract java.lang.Object getInterface()
Method to retrieve the interface of an actor.


getMAGAI

public GAI getMAGAI()

getMMGAI

public GAI getMMGAI()

control

public RequestResult control(java.lang.String cmd,
                             java.lang.String[] pars)
                      throws java.lang.Exception
Overloaded mehtod that controls the actor, invokes its functionality, BaseFrame input field can trigger it, as can RoleSessionActions, or the ScriptHandler.

Specified by:
control in interface ControlInterface
Overrides:
control in class MicroApplicationActor
Parameters:
cmd - First command line argument, used to denote a command name.
Returns:
PaP style result indication of the operation.
java.lang.Exception

applicationActorEntry

public RequestResult applicationActorEntry(RequestPars pRP)
                                    throws java.lang.Exception
Common entry point for all actors of this type

Specified by:
applicationActorEntry in class MicroApplicationActor
Returns:
TAPAS style result
java.lang.Exception

actorChangeBehaviour

public RequestResult actorChangeBehaviour(java.lang.String pRoleId,
                                          java.lang.String[] pars)
                                   throws java.lang.Exception
Deprecated. Replaced by actorChangeBehaviour(String, Object)

Request to perform an actor change behaviour for own actor. The new role for the actor will be according to what is specified, and the set of parameters will be withdrawn to the upgraded actor.

Overrides:
actorChangeBehaviour in class MicroApplicationActor
Parameters:
pRoleId - New role to be assigned to actor
pars - The data withdraw from existing to upgraded actor
Returns:
Result of the performed request
java.lang.Exception

actorChangeBehaviour

public RequestResult actorChangeBehaviour(java.lang.String pRoleId,
                                          java.lang.Object ai)
                                   throws java.lang.Exception
Request to perform an actor change behaviour for own actor. The new role for the actor will be according to what is specified, and the actors interface will be withdrawn and plugged into the upgraded actor.

Overrides:
actorChangeBehaviour in class MicroApplicationActor
Parameters:
pRoleId - New role to be assigned to actor
ai - The actor interface
Returns:
Result of the performed request
java.lang.Exception

actorRegister

protected RequestResult actorRegister()
Method used to register this actor with both MA and MM. The data will eventually be used if a network error occurs (loss of connection), and an actorPlugOut sequence will be initiated by both sides.

Returns:
TAPAS result style

actorRegisterCancel

protected RequestResult actorRegisterCancel(boolean isMoved)
Method used to registerCancel this actor with both local MicroPNES and homeInterface MicroPNES (director node).

Parameters:
isMoved - Indicated if this actor has been terminated, or has just moved
Returns:
TAPAS style result

actorMove

public RequestResult actorMove(GAI moveTo)
Received from CapsMonitorAgent when the offered capabilites of this node has become 'less' than the required capabilites for this actor, or as a explicit command.

Parameters:
moveTo - New GAI of actor after move
Returns:
TAPAS-style result

sendCreateInterface

private RequestResult sendCreateInterface(GAI receiver)
Deprecated. Replaced by sendCreateInterface(GAI,ActorContext,Object)

Method to re-create this actor's interface at another actor

Parameters:
receiver - The foreign actor whose interface should be replaced by this actor's interface.
Returns:
TAPAS-style result.

sendCreateInterface

private RequestResult sendCreateInterface(GAI receiver,
                                          ActorContext ac,
                                          java.lang.Object oldActInterface)
Method to re-create this actor's interface at another actor

Parameters:
receiver - The foreign actor whose interface should be replaced by this actor's interface.
oldActInterface - The interface to be plugged into new actor. If null a new interface will be queried from actor.
Returns:
TAPAS-style result.

cleanUp

public void cleanUp()
Gives this Actor instance a chance to clean up when the DebugWindow is closed.


term

public void term()
Description copied from class: MicroActor
Terminate method from the ActorInterface. Closes the debug window

Specified by:
term in interface MicroActorInterface
Overrides:
term in class MicroActor

status

public Item status()
Report this actor's status through Item elements

Overrides:
status in class MicroActor
Returns:
Whatever context.status() returns

help

public Item help()
Method to display a hierarchy of available commands

Overrides:
help in class MicroApplicationActor


The Telematics Architecture for Plug-and-Play Systems (TAPAS) is a research project undertaken by the Norwegian University of Science and Technology's Telematics department which aims at developing an architecture for network-based service systems with a) flexibility and adaptability, b) robustness and survivability, and c) QoS awareness and resource control.

More information can be found at the project's homepage at http://tapas.item.ntnu.no and the project manager, Professor Finn Arve Aagesen, can be reached at finn.arve.aagesen@item.ntnu.no.