PaP
Class Director1

java.lang.Object
  |
  +--PaP.Actor
        |
        +--PaP.DirectorActor
              |
              +--PaP.Director1
All Implemented Interfaces:
ActorInterface, ControlInterface, java.rmi.Remote, java.io.Serializable

public class Director1
extends DirectorActor
implements ActorInterface, ControlInterface, java.io.Serializable

Director1 is an implementation of the abstract class DirectorActor. It is a fully implemented Director which contains functionality described in the PaP Dynamic Basic Support.

Version:
 
Author:
Ulrik Johansen
See Also:
DirectorActor, Serialized Form

Field Summary
private  PlayingBase pb
          Playing base for the director, holds active Actors in the domain it manages
private  RepertoireBase rb
          Repertoire base for the director, holds plugged in plays and their manuscripts
private  SubscribeCollection sc
          Subscription management, requested by actors and served by director
private  SessionBase sessionbase
           
private static int unique
          Sequence of integers for unique naming of Actors and RoleSessions
private  UserProfileBase userbase
           
private  XMLFileUtil xmlutil
           
 
Fields inherited from class PaP.Actor
bf, context, fh
 
Constructor Summary
Director1()
          Creates a new Director1.
 
Method Summary
private  RequestResult actorPlugOut(RequestPars pRP, GAI pActor)
          Plugs out the specified actor.
 RequestResult control(java.lang.String pCommand, java.lang.String[] pPars)
          Used to get different report from this Director depending on the specified command.
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.
 RequestResult directorActorEntry(RequestPars pRP)
          This is the entry point for external requests to this Director.
static int getUnique()
          Gets the next unique number of this Director.
 void start()
          Initializes this Director.
 Item status()
          Returns a report on the status of this Director as an Item.
 
Methods inherited from class PaP.DirectorActor
actorEntry, init
 
Methods inherited from class PaP.Actor
findRoleSession, getGAI, term
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 
Methods inherited from interface PaP.ActorInterface
actorEntry, term
 

Field Detail

rb

private RepertoireBase rb
Repertoire base for the director, holds plugged in plays and their manuscripts

pb

private PlayingBase pb
Playing base for the director, holds active Actors in the domain it manages

sc

private SubscribeCollection sc
Subscription management, requested by actors and served by director

userbase

private UserProfileBase userbase

xmlutil

private XMLFileUtil xmlutil

sessionbase

private SessionBase sessionbase

unique

private static int unique
Sequence of integers for unique naming of Actors and RoleSessions
Constructor Detail

Director1

public Director1()
Creates a new Director1.
Method Detail

control

public RequestResult control(java.lang.String pCommand,
                             java.lang.String[] pPars)
Used to get different report from this Director depending on the specified command. Such a command can either be 'Status', 'ListPlays', 'ListActors' or 'ListRoleSessions'. The report is shown in the Directors baseframe. The reports can be triggered from the baseframe window.
Specified by:
control in interface ControlInterface
Parameters:
pCommand - Name of the command which specifies which report to show.
pPars[] - Command line arguments that are parameters for the specified command.
Returns:
RequestResult indicating if the operation completed successfully.

directorActorEntry

public RequestResult directorActorEntry(RequestPars pRP)
                                 throws java.lang.Exception
This is the entry point for external requests to this Director. The type of request is checked and according to the type appropriate operations are performed.
Overrides:
directorActorEntry in class DirectorActor
Parameters:
pRP - RequestPars indicating the type of request with a set of parameters.
Returns:
RequestResult indicating wether the request was handled successfully or not.
Throws:
java.lang.Exception -  

getUnique

public static int getUnique()
Gets the next unique number of this Director. This number is used to name the actors that are plugged in. This is a counter which is increased each time this method is called.
Returns:
A new unique number.

start

public void start()
Initializes this Director. Creates the different bases and collections. This method is used to keep the constructor empty.
Specified by:
start in interface ActorInterface
Overrides:
start in class Actor

status

public Item status()
Returns a report on the status of this Director as an Item. An item is an information element that can contain other items in a hierarchy.
Overrides:
status in class Actor
Returns:
Hierarchy of Item information elements.

actorPlugOut

private RequestResult actorPlugOut(RequestPars pRP,
                                   GAI pActor)
                            throws java.lang.Exception
Plugs out the specified actor. Constructs an ActorPlugOut request and sends it to the PAS of the specified actor. If the ActorPlugOut was successful the playingbase is updated and the event is registered in the subscribecollection for the subscribing actors.
Parameters:
pRP - The original ActorPlugOut request parameters.
pActor - The actor to be plugged out.
Returns:
RequestResult indicating wether the ActorPlugOut was successful or not.
Throws:
java.lang.Exception -  

dbg

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.
Parameters:
dbg - The debug information to be sent.