aa.core
Class FacilitatorActor

java.lang.Object
  extended byaa.core.Actor
      extended byaa.core.FacilitatorActor
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
FaciPara, QuadFacilitator

public class FacilitatorActor
extends Actor

This class represents a facilitator actor of a cyberorg

Author:
xinghuizhao
See Also:
Serialized Form

Field Summary
protected  CyberOrg m_cybHost
           
 
Fields inherited from class aa.core.Actor
m_athread
 
Constructor Summary
FacilitatorActor(CyberOrg p_cybHost)
          Creates a new instance of FacilitatorActor
 
Method Summary
 CyberOrg doAssimilate()
          CyberOrg assimilate
 CyberOrg doIsolate(java.lang.Long p_longECash, ActorName[] p_anaActors, Contract p_conContract)
          CyberOrg isolate
 void doMigrate(ActorName p_anDestFacilitator, Contract p_conNewContract)
          CyberOrg migrate
 CyberOrg getHost()
          Returns the host cyberorg
 Contract negotiate(ActorName p_anSender, Contract p_conContract)
          Negotiation
 ActorName receiveCyberOrg(Contract p_conContract, java.lang.Long p_LECash, java.util.LinkedList p_llActors)
          This method is called in remote migration , when a cyberorg is migrating to this facilitator's host
 CyberOrg remoteControlAssimilate()
          Remote control assimilation (being used in a specific example)
 CyberOrg remoteControlIsolate(java.lang.Long p_longECash, ActorName[] p_anaActors, Contract p_conContract)
          Remote control isolation (being used in a specific example)
 void setHost()
          Set the host cyberorg
it is called after migration, because the new host is created in the new Platform
 void tryMigrate(ActorName p_anReceiver, Contract p_conContract)
          Try to migrate using proposed contract
 
Methods inherited from class aa.core.Actor
become, become, become, become, become, become, become, become, become, become, become, becomeActor, call, call, call, call, call, call, call, call, call, call, call, callMessage, create, create, create, create, create, create, create, create, create, create, create, createActor, createRemote, createRemote, createRemote, createRemote, createRemote, createRemote, createRemote, createRemote, createRemote, createRemote, createRemote, createRemoteActor, destroy, echo, getActorName, getDefaultDirectoryManager, getDefaultDirectoryManager, getLastErrorMessage, migrate, print, printLastErrorMessage, println, send, send, send, send, send, send, send, send, send, send, send, sendMessage, setErrorMessage, uninit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_cybHost

protected transient CyberOrg m_cybHost
Constructor Detail

FacilitatorActor

public FacilitatorActor(CyberOrg p_cybHost)
Creates a new instance of FacilitatorActor

Method Detail

setHost

public void setHost()
Set the host cyberorg
it is called after migration, because the new host is created in the new Platform


getHost

public CyberOrg getHost()
Returns the host cyberorg

Returns:
The host cyberorg

doIsolate

public CyberOrg doIsolate(java.lang.Long p_longECash,
                          ActorName[] p_anaActors,
                          Contract p_conContract)
CyberOrg isolate

Parameters:
p_longECash - eCash to be allocated to the child
p_anaActors - Actors to be isolated to the child cyberorg
p_conContract - New contract
Returns:
The new child cyberorg

remoteControlIsolate

public CyberOrg remoteControlIsolate(java.lang.Long p_longECash,
                                     ActorName[] p_anaActors,
                                     Contract p_conContract)
Remote control isolation (being used in a specific example)

Parameters:
p_longECash -
p_anaActors -
p_conContract -
Returns:

doAssimilate

public CyberOrg doAssimilate()
CyberOrg assimilate

Returns:
The parent cyberorg

remoteControlAssimilate

public CyberOrg remoteControlAssimilate()
Remote control assimilation (being used in a specific example)

Returns:

doMigrate

public void doMigrate(ActorName p_anDestFacilitator,
                      Contract p_conNewContract)
CyberOrg migrate

Parameters:
p_anDestFacilitator - The distination facilitator
p_conNewContract - New contranct

receiveCyberOrg

public ActorName receiveCyberOrg(Contract p_conContract,
                                 java.lang.Long p_LECash,
                                 java.util.LinkedList p_llActors)
This method is called in remote migration , when a cyberorg is migrating to this facilitator's host

Parameters:
p_conContract - The contract which is held by the coming cyberorg
p_LECash - The number of eCash
p_llActors - Actor list of the coming cyberorg
Returns:
The facilitator of the coming cyberorg

negotiate

public Contract negotiate(ActorName p_anSender,
                          Contract p_conContract)
Negotiation

Parameters:
p_anSender - The name of the facilitator which initializes the negotiation
p_conContract - The proposed contract
Returns:
A final contract

tryMigrate

public void tryMigrate(ActorName p_anReceiver,
                       Contract p_conContract)
Try to migrate using proposed contract

Parameters:
p_anReceiver - The potential destination
p_conContract - The proposed contract