|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectaa.core.ActorManager
This class represents Actor Manager to handle the state information about actors that are working or created on this platform.
History:
| Field Summary | |
static java.lang.Integer |
ACTIVE
An actor state to indicate that an actor is working, and hence it can receive and process a message. |
static int |
IDX_AGENT
Index for the actor field in the actor infromation array. |
static int |
IDX_AN
Index for the actor name field in the actor infromation array. |
static int |
IDX_LOC
Index for the actor location field in the actor infromation array. |
static int |
IDX_STATE
Index for the actor state field in the actor infromation array. |
static java.lang.Integer |
IN_TRANSIT
An actor state to indicate that an actor is moving from one platform to another. |
private DelayedMessageManager |
m_dmmDelayedMessageManager
|
private MigrationManager |
m_mmMigrationManager
|
private Platform |
m_pPlatform
|
private java.lang.String |
m_strHostAddress
|
private static java.lang.String[] |
m_strState
String names about actor states. |
private java.util.TreeMap |
m_tmActors
|
private java.util.TreeMap |
m_tmMobileActors
|
private View |
m_viewMain
|
static java.lang.Integer |
SUSPENDED
An actor state to indicate that an actor is suspended by the platform. |
static java.lang.Integer |
TRANSIT
An actor state to indicate that an actor moved to another platform. |
static java.lang.Integer |
UNKNOWN
An actor state to indicate that the state of an actor is unknown. |
| Constructor Summary | |
ActorManager(Platform p_platform,
View p_viewMain)
Creates an Actor Manager. |
|
| Method Summary | |
protected void |
changeToActor(ActorThread p_athread,
java.lang.Integer p_intState)
Deregisters the specified actor form the mobile actor list, and registers an actor into the working actors list. |
protected void |
changeToMobileActor(ActorName p_anActor,
java.net.InetAddress p_iaDestHost)
Deregisters the specified actor form the working actor list, and registers an actor into the mobile actors list. |
protected java.lang.Object[] |
deregisterActor(ActorName p_anActor)
Deregisters the specified actor from this platform. |
protected java.lang.Object[] |
deregisterMobileActor(ActorName p_anActor)
Deregisters a mobile actor. |
protected java.lang.Object[] |
getActor(ActorName p_anActor)
Returns information about the actor with the given actor name. |
java.lang.String[][] |
getActorData(ActorName p_anActor)
Returns information about the actor specifiey its actor name. |
protected java.lang.Object[] |
getActorInfo(ActorName p_anActor)
Returns information about the actor with the given actor name. |
java.lang.Integer |
getActorState(ActorName p_anActor)
Returns the state of the specified actor. |
protected ActorThread |
getActorThread(ActorName p_anActor)
Returns the reference to the actor with the given actor name. |
java.lang.String[][] |
getAllActorData()
Returns information about the actors registered. |
protected java.lang.String |
getMobileActorLocation(ActorName p_anActor)
Returns the reference to the mobile actor with the given actor name. |
protected java.lang.Integer |
getMobileActorState(ActorName p_anActor)
Returns the state of the specified mobile actor. |
void |
killActor(ActorName p_anActor)
Tries to kill an actor. |
protected void |
registerActor(ActorThread p_athread,
java.lang.Integer p_intState)
Registers a new actor into this actor platform. |
protected void |
registerMobileActor(ActorName p_anActor,
java.net.InetAddress p_iaDestHost)
Registers an actor into the mobile actors list. |
protected void |
removeActor(ActorName p_anActor)
Removes information about the specified actor from the actor list. |
void |
resumeActor(ActorName p_anActor)
Resumes the specified actor. |
protected void |
setMigrationManager(MigrationManager p_mmMigrationManager)
Sets the reference of a Migration Manager. |
protected void |
setMobileActorState(ActorName p_anActor,
java.lang.Integer pintNewState,
java.lang.String p_strHostAddress)
Changes the state of a mobile actor with the new state. |
void |
suspendActor(ActorName p_anActor)
Suspends the specified actor. |
protected void |
uninit()
Uninitializes this program. |
protected void |
updateActor(ActorThread p_athread,
java.lang.Integer p_intState)
Updates the old reference to an actor with new one. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.Integer UNKNOWN
public static final java.lang.Integer ACTIVE
public static final java.lang.Integer SUSPENDED
public static final java.lang.Integer IN_TRANSIT
public static final java.lang.Integer TRANSIT
public static final int IDX_STATE
public static final int IDX_AGENT
public static final int IDX_AN
public static final int IDX_LOC
private static final java.lang.String[] m_strState
private java.util.TreeMap m_tmActors
private java.util.TreeMap m_tmMobileActors
private Platform m_pPlatform
private View m_viewMain
private MigrationManager m_mmMigrationManager
private DelayedMessageManager m_dmmDelayedMessageManager
private java.lang.String m_strHostAddress
| Constructor Detail |
public ActorManager(Platform p_platform,
View p_viewMain)
p_platform - the reference to this platform.p_viewMain - the reference to View.| Method Detail |
protected void setMigrationManager(MigrationManager p_mmMigrationManager)
p_mmMigrationManager - the reference to a Migration Manager.protected void uninit()
protected void registerActor(ActorThread p_athread,
java.lang.Integer p_intState)
p_athread - the reference to the specified actor.p_intState - an initial state of the actor.
protected void updateActor(ActorThread p_athread,
java.lang.Integer p_intState)
p_athread - the reference to an actor thread.p_intState - a new state of the actor.protected java.lang.Object[] deregisterActor(ActorName p_anActor)
p_anActor - the name of the selected actor.protected void removeActor(ActorName p_anActor)
p_anActor - the name of an actor.protected ActorThread getActorThread(ActorName p_anActor)
p_anActor - the name of an actor.
protected java.lang.Object[] getActor(ActorName p_anActor)
p_anActor - the name of an actor.
public java.lang.Integer getActorState(ActorName p_anActor)
p_anActor - the name of an actor.
public java.lang.String[][] getActorData(ActorName p_anActor)
p_anActor - the name of an actor.
public java.lang.String[][] getAllActorData()
public void suspendActor(ActorName p_anActor)
p_anActor - the name of the selected actor.public void resumeActor(ActorName p_anActor)
p_anActor - the name of the selected actor.public void killActor(ActorName p_anActor)
p_anActor - the name of the selected actor.protected java.lang.Object[] getActorInfo(ActorName p_anActor)
p_anActor - the name of an actor.
protected void changeToMobileActor(ActorName p_anActor,
java.net.InetAddress p_iaDestHost)
p_anActor - the name of a mobile actor.p_iaDestHost - the Inernet address of the destination host.
protected void changeToActor(ActorThread p_athread,
java.lang.Integer p_intState)
p_athread - the reference to the specified actor.p_intState - an initial state of the actor.
protected void registerMobileActor(ActorName p_anActor,
java.net.InetAddress p_iaDestHost)
p_anActor - the name of a mobile actor.p_iaDestHost - the Inernet address of the destination host.protected java.lang.Object[] deregisterMobileActor(ActorName p_anActor)
p_anActor - the name of a mobile actor.
protected void setMobileActorState(ActorName p_anActor,
java.lang.Integer pintNewState,
java.lang.String p_strHostAddress)
p_anActor - the name of a mobile actor.pintNewState - a new state of the actor.p_strHostAddress - the host address of the destination platform.protected java.lang.Integer getMobileActorState(ActorName p_anActor)
p_anActor - the name of a mobile actor.
protected java.lang.String getMobileActorLocation(ActorName p_anActor)
p_anActor - the name of a mobile actor.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||