|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--PaP.Actor | +--PaP.ApplicationActor | +--Watcher.v2_1.Watcher
Watcher is the Plug-and-Play (PaP) specific class of the Watcher
application. It extends ApplicationActor and therefore has access to
functionality provided by the PaP system. Watcher has an internal state
model with three states. The method stateTransition() defines the class'
behavior in the different states when it receives a request through the
method applicationActorEntry().
Watcher subscribes for reports on the events generated in the PaP system.
Each time such an event occurs, the Director calls subscribeReport() with
information regarding the event.
Field Summary | |
private RoleSession |
initialRoleSession
The initial RoleSession created when this Actor is created. |
private boolean |
initiated
Indicates wether initial ActorPlugIn has been performed or not |
private int |
state
Indicates which state the application is in |
private int |
STATE_INITIAL
|
private int |
STATE_SERVER_ACTIVE
State where it subscribes and shows the received reports |
private int |
STATE_SERVER_PASSIVE
State where subscriptions are canceled and the Window are disposed |
private java.lang.String |
subscribeId
The unique subscription id returned when SubscribeRequest is done |
private WatcherWindow |
window
A reference to an instance of WatcherWindow |
Fields inherited from class PaP.Actor |
bf, context, fh |
Constructor Summary | |
Watcher()
Creates a new instance of Watcher and sets the initial state to STATE_INITIAL. |
Method Summary | |
RequestResult |
applicationActorEntry(RequestPars rpars)
This method is the common entry point for all external requests to this actor. |
void |
changeSubscription(int interval)
Switches between the defined subscription types; Immediate, 15 seconds intervals and 30 seconds intervals. |
void |
closeApplication()
This method is used by WatcherWindow to tell Watcher that the user wants to close the application. |
private void |
dbg(java.lang.String dbg)
Sends debug information to this actor's BaseFrame window, which is an interactive debug client window for several entities. |
java.lang.String |
getWatcherGAI()
Returns the GAI of this ApplicationActor. |
private RequestResult |
stateTransition(GAI sender,
GAI receiver,
ApplicationMessage message)
This method defines the main behaviour of this actor. |
RequestResult |
subscribeReport(java.lang.String[] report)
This method is an overloading of the corresponding method in the super class ApplicationActor. |
Methods inherited from class PaP.Actor |
findRoleSession, getGAI, start, status, term |
Methods inherited from class java.lang.Object |
|
Field Detail |
private final int STATE_INITIAL
private final int STATE_SERVER_ACTIVE
private final int STATE_SERVER_PASSIVE
private int state
private boolean initiated
private RoleSession initialRoleSession
private java.lang.String subscribeId
private WatcherWindow window
Constructor Detail |
public Watcher()
Method Detail |
public RequestResult applicationActorEntry(RequestPars rpars) throws java.lang.Exception
applicationActorEntry
in class ApplicationActor
rpars
- Instance of RequestPars which specifies type of request and
additional parametres.java.lang.Exception
- public void changeSubscription(int interval) throws java.lang.Exception
interval
- Indicates the subscription type. If interval = 0 it
means immediate subscription.java.lang.Exception
- public void closeApplication()
public java.lang.String getWatcherGAI()
private RequestResult stateTransition(GAI sender, GAI receiver, ApplicationMessage message) throws java.lang.Exception
sender
- The GAI to the source of the received request.receiver
- This actor's GAI.message
- The specification of the request.java.lang.Exception
- public RequestResult subscribeReport(java.lang.String[] report) throws java.lang.Exception
subscribeReport
in class ApplicationActor
report
- A list of newly reported events.java.lang.Exception
- private void dbg(java.lang.String dbg)
dbg
in class ApplicationActor
dbg
- The debug information to be sent.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |