MicroTAPAS
Class MicroApplicationActor

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

public abstract class MicroApplicationActor
extends MicroActor

Superclass for mobility application actors, interfaces TAPAS support functions

See Also:
Serialized Form

Field Summary
protected static boolean DEBUG
          Determines whether debug info to be sent to debug-server
 
Fields inherited from class MicroTAPAS.MicroActor
bf, context, debug, fh, properties
 
Constructor Summary
MicroApplicationActor()
           
 
Method Summary
 RequestResult actorBehaviourPlugIn(java.lang.String pRoleId)
          Plug in of new behaviour for own actor according to the role specified
 RequestResult actorBehaviourPlugOut()
          Plug out behaviour for own actor.
 RequestResult ActorCapabilities(int opType, CapabilitySet caps)
          Request to change capabilities for own actor.
 RequestResult actorChangeBehaviour(java.lang.String pRoleId, java.lang.Object actorInterface)
          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 actorEntry(RequestPars pRP)
          Common enrty point of ApplicationActors to invoke some activity from outside
 RequestResult ActorPlay(GAI ident)
          Request to perform ActorPlay request for a specified actor.
 RequestResult actorPlugIn(ActorPlugInReq request)
          Builds an ActorPlugIn request, applies the application specified parameters in the request, and sends the request to own director
The result of this request is either of:
1.
 RequestResult actorPlugOut(RoleSession pRS, boolean isMoved)
          Build and send ActorPlugOut request to (a specific actor) director
The result of this request is either of:
1.
 RequestPars anyOtherRequestType(RequestPars pRP)
          Received request types that is not served through the 'applicationActorEntry()' method.
abstract  RequestResult applicationActorEntry(RequestPars pRP)
          This is the ONLY entry to application part of actors in addition to "subscribeReport()" and "anyOtherRequestType()".
private  RequestResult callActorChangeBehaviour(ActorPlugInReq request, java.lang.Object actorInterface)
          Common method used by all actor change request methods.
private  RequestResult callActorChangeBehaviour(ActorPlugInReq request, java.lang.String[] pars)
          Deprecated. Replaced by callActorChangeBehaviour(ActorPlugInReq, Object)
 void closeBF()
          Method that enables the ApplicationActor to close the DebugWindow of the actor.
 RequestResult control(java.lang.String command, java.lang.String[] pars)
          Controls the actor, invokes its functionality, BaseFrame input field can trigger it, and RoleSessionAction can also trigger it.
private  GAI directorDiscovery(GAI actor)
          Locates the managing director of a particular GAI by sending a request to the local MobilityManager.
 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
 RequestResult playChangesPlugIn(Play pPlay)
          Builds a request for the TAPAS support function of the same name and sends it to the Director
 RequestResult playPlugIn(Play pPlay)
          Builds a request for the TAPAS support function of the same name and sends it to the Director.
 RequestResult playPlugOut(java.lang.String pPlayId, java.lang.String pPlayVer)
          Builds a request for the TAPAS support function of the same name and sends it to the Director
protected  RequestResult requestToActor(RequestPars pRP)
          Common method for most types of requests from actors to other actors
 RequestResult RoleSessionAction(RoleSession pRS, ApplicationMessage pMessage)
          Request to perform a RoleSessionAction, with the purpose to send a message from own actor to another.
 RequestResult subscribeCancel(java.lang.String subscribeID)
          Request cancel of an existing subscription.
 RequestResult subscribeReport(java.lang.String[] subscribeReport, long id)
          Subscribe reports returned to the actor if the SubscribeRequest service is used.
 RequestResult subscribeRequest(SubscribeRequest spec)
          SubscribeRequest for information about activity in the TAPAS system.
 
Methods inherited from class MicroTAPAS.MicroActor
findRoleSession, getGAI, start, status, term, terminalMove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface MicroTAPAS.ControlInterface
cleanUp
 

Field Detail

DEBUG

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

See Also:
Constant Field Values
Constructor Detail

MicroApplicationActor

public MicroApplicationActor()
Method Detail

closeBF

public void closeBF()
Method that enables the ApplicationActor to close the DebugWindow of the actor. This can be helpful if the device have few resource, or if one generally whishes a less cluttered desktop.


init

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

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

control

public RequestResult control(java.lang.String command,
                             java.lang.String[] pars)
                      throws java.lang.Exception
Controls the actor, invokes its functionality, BaseFrame input field can trigger it, and RoleSessionAction can also trigger it.

Parameters:
command - First command line argument, used to denote a command name.
Returns:
TAPAS style result indication of the operation.
java.lang.Exception

actorEntry

public RequestResult actorEntry(RequestPars pRP)
                         throws java.lang.Exception
Common enrty point of ApplicationActors to invoke some activity from outside

Parameters:
pRP - Parameters for the activity this actorEntry will attempt to carry out
Returns:
Result of the activity this actorEntry attempted to carry out
java.lang.Exception

applicationActorEntry

public abstract RequestResult applicationActorEntry(RequestPars pRP)
                                             throws java.lang.Exception
This is the ONLY entry to application part of actors in addition to "subscribeReport()" and "anyOtherRequestType()".

Returns:
Result of the activity this actorEntry attempted to carry out
java.lang.Exception

subscribeReport

public RequestResult subscribeReport(java.lang.String[] subscribeReport,
                                     long id)
                              throws java.lang.Exception
Subscribe reports returned to the actor if the SubscribeRequest service is used. To get the reported information the actor must define an overloaded method to replace this.

Parameters:
subscribeReport - The reported set of events. A further description is given in the 'SubscribeCollection' class.
Returns:
The result of the serve of the request.
java.lang.Exception

anyOtherRequestType

public RequestPars anyOtherRequestType(RequestPars pRP)
                                throws java.lang.Exception
Received request types that is not served through the 'applicationActorEntry()' method. This gives the possibility for the actor to control any received request type. To get control of the request the actor must define an overloaded method to this method.

Parameters:
pRP - The received request.
Returns:
request to be rerouted to Director, null if no rerouting is decided.
java.lang.Exception

requestToActor

protected RequestResult requestToActor(RequestPars pRP)
Common method for most types of requests from actors to other actors

Parameters:
pRP - The request
Returns:
TAPAS style result of the request

playPlugIn

public RequestResult playPlugIn(Play pPlay)
                         throws java.lang.Exception
Builds a request for the TAPAS support function of the same name and sends it to the Director.
The result of this request is:
- Director will put the play/reference to play in its repertoire base
and manuscript base.

Parameters:
pPlay - The play to be plugged in
Returns:
TAPAS style result indication of the operation
java.lang.Exception

playChangesPlugIn

public RequestResult playChangesPlugIn(Play pPlay)
                                throws java.lang.Exception
Builds a request for the TAPAS support function of the same name and sends it to the Director

Parameters:
pPlay - The play to be plugged in
Returns:
TAPAS style result indication of the operation
java.lang.Exception

playPlugOut

public RequestResult playPlugOut(java.lang.String pPlayId,
                                 java.lang.String pPlayVer)
                          throws java.lang.Exception
Builds a request for the TAPAS support function of the same name and sends it to the Director

Parameters:
pPlayId - ID string of the play to be plugged out
pPlayVer - Version string of the play to be plugged out, null value means all versions plug out
Returns:
TAPAS style result indication of the operation
java.lang.Exception

actorPlugIn

public RequestResult actorPlugIn(ActorPlugInReq request)
                          throws java.lang.Exception
Builds an ActorPlugIn request, applies the application specified parameters in the request, and sends the request to own director
The result of this request is either of:
1. A new actor must be created
- The director sends a request to the correct PAS which will create an instance
and the correct behaviour must be loaded
- The behaviour for the actor is downloaded (i.e. actor behaviour plug in)
2. An existing instance may be applied
For both 1. and 2., a RoleSession is returned in RequestResult to initiator

Parameters:
request - Application specified parameters for the request
Returns:
TAPAS style result indication of the operation
java.lang.Exception

actorBehaviourPlugIn

public RequestResult actorBehaviourPlugIn(java.lang.String pRoleId)
                                   throws java.lang.Exception
Plug in of new behaviour for own actor according to the role specified

Parameters:
pRoleId - New role to be assigned to actor
Returns:
Result of the performed request
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.

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 actorInterface)
                                   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 set of parameters will be withdrawn to the upgraded actor.

Parameters:
pRoleId - New role to be assigned to actor
Returns:
Result of the performed request
java.lang.Exception

actorBehaviourPlugOut

public RequestResult actorBehaviourPlugOut()
                                    throws java.lang.Exception
Plug out behaviour for own actor. The actor will take a predefined TAPAS "dummy" role.

Returns:
Result of the performed request
java.lang.Exception

callActorChangeBehaviour

private RequestResult callActorChangeBehaviour(ActorPlugInReq request,
                                               java.lang.String[] pars)
                                        throws java.lang.Exception
Deprecated. Replaced by callActorChangeBehaviour(ActorPlugInReq, Object)

Common method used by all actor change request methods. Builds a request and send it to own director.

Parameters:
request - A actor plug in request used for change behaviour
pars - Set Information to follow a actor change behaviour request
Returns:
Result of the request execution
java.lang.Exception

callActorChangeBehaviour

private RequestResult callActorChangeBehaviour(ActorPlugInReq request,
                                               java.lang.Object actorInterface)
                                        throws java.lang.Exception
Common method used by all actor change request methods. Builds a request and send it to own director.

Parameters:
request - A actor plug in request used for change behaviour
Returns:
Result of the request execution
java.lang.Exception

actorPlugOut

public RequestResult actorPlugOut(RoleSession pRS,
                                  boolean isMoved)
                           throws java.lang.Exception
Build and send ActorPlugOut request to (a specific actor) director
The result of this request is either of:
1. An existing actor is plugged out
- The actor is removed from the director's playing base
- The actor instance is removed from the PNES where it is located
2. The actor shall not be removed (because of conditions specified)
- The role session registry is removed at actors and Director

Parameters:
pRS - This RoleSession specifies which actor to be plugged out
Returns:
TAPAS style result indication of the operation
java.lang.Exception

ActorPlay

public RequestResult ActorPlay(GAI ident)
                        throws java.lang.Exception
Request to perform ActorPlay request for a specified actor.

Parameters:
ident - The actor to request for ActorPlay
Returns:
result of the request
java.lang.Exception

subscribeRequest

public RequestResult subscribeRequest(SubscribeRequest spec)
                               throws java.lang.Exception
SubscribeRequest for information about activity in the TAPAS system.

Parameters:
spec - Specifies the type of subscription request for.
Returns:
Result of the request
java.lang.Exception

subscribeCancel

public RequestResult subscribeCancel(java.lang.String subscribeID)
                              throws java.lang.Exception
Request cancel of an existing subscription.

Parameters:
subscribeID - Identification of the subscription (given when initiated)
Returns:
Result of the request
java.lang.Exception

RoleSessionAction

public RequestResult RoleSessionAction(RoleSession pRS,
                                       ApplicationMessage pMessage)
                                throws java.lang.Exception
Request to perform a RoleSessionAction, with the purpose to send a message from own actor to another.

Parameters:
pRS - The role session to use. Will determine who will be the receiver
pMessage - The application specific message to send.
Returns:
Result of the request
java.lang.Exception

ActorCapabilities

public RequestResult ActorCapabilities(int opType,
                                       CapabilitySet caps)
                                throws java.lang.Exception
Request to change capabilities for own actor.

Parameters:
opType - Specifies 'Set', 'Add' or 'Remove' as operation type
caps - The set of capabilities to add, set or remove
Returns:
The result of the operation
java.lang.Exception

directorDiscovery

private GAI directorDiscovery(GAI actor)
Locates the managing director of a particular GAI by sending a request to the local MobilityManager. If the address to the MM can't be found, or the GAI of the director can't be located by the MM, return the local director GAI.

Parameters:
actor - The actor for whom to look-up the director.
Returns:
The GAI of the actor's director.

help

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



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.