|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--osl.manager.ActorManager
This abstract class defines the basic methods necessary for implementing an actor manager. An actor manager is responsible for providing the basic actor services (e.g. sending messages, or creating other actors) to a collection of local actors. Moreover, a manager shields its local actors from interactions with external entities. That is, all interactions with local actors must go through the actor manager.
The ActorManager class is also expected to implement the RemoteActorManager interface which defines the mechanism by which external entities (except for actors) interact with a local actor manager. Typically, the RemoteActorManager interface is passed as the client interface for any RequestHandler sessions opened by an actor manager. Each actor manager also has an ActorManagerName which uniquely defines the manager relative to all other managers in the system (or at least relative to all other actor managers using the same implementation). An actor manager's name is used by other actor managers or local actors to request location-specific services such as remote creation or migration.
Actor,
ActorManagerName,
RemoteActorManager,
Scheduler,
RequestHandler| Constructor Summary | |
ActorManager()
|
|
| Method Summary | |
protected abstract ActorName |
actorCreate(ActorImpl caller,
ActorCreateRequest request)
This method is called by a local actor implementation to request the creation of a new actor. |
protected abstract void |
actorFatalError(ActorImpl caller,
java.lang.Exception e)
This method is called by an actor implementation to report that it has encountered a fatal error. |
protected abstract java.lang.Object |
actorInvokeService(ActorImpl caller,
ServiceName serviceName,
java.lang.String meth,
java.lang.Object[] serviceArgs)
This method is called by a local actor in order to access a locally provided node service. |
protected abstract void |
actorMigrate(ActorImpl caller,
ActorManagerName where)
This method is called by a local actor that wishes to be migrated to another manager. |
protected abstract void |
actorSend(ActorImpl caller,
ActorMsgRequest message)
This method is called by a local actor to send a message to another actor. |
protected void |
implDeliver(ActorImpl actor,
ActorMsgRequest msg)
Deliver a message to an actor implementation. |
protected ActorName |
implGetName(ActorImpl actor)
Return the name associated with an actor implementation. |
protected void |
implInitialize(ActorImpl actor,
ActorName you,
ActorCreateRequest req)
Call the initialization method of an actor implementation. |
protected void |
implPostMigrateRebuild(ActorImpl actor,
ActorManager ourMgr)
Instruct an actor implementation to rebuild itself after a migration. |
protected void |
implStamp(ActorImpl actor,
ActorMsgRequest msg)
Instruct an actor implementation to stamp a message. |
abstract void |
managerInitialize(Scheduler S,
RequestHandler R)
Initialize a new actor manager. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public ActorManager()
| Method Detail |
public abstract void managerInitialize(Scheduler S,
RequestHandler R)
throws RequestException
S - The Scheduler instance which should be
used to schedule all threads required by the manager. Most of
these threads will correspond to actors. Thus, it is
advantageous to use a scheduler customized to efficiently handle
actors.R - The RequestHandler instance which should
be used for interactions between this manager and other managers
in the system.
protected void implInitialize(ActorImpl actor,
ActorName you,
ActorCreateRequest req)
throws java.lang.Exception
you - The ActorName that should be used as
the name of the new actor.rtClass - The run-time Class of the
user-written actor that should be instantiated by this
implementation. This class will always be an extension of the
Actor class.initArgs - The array of arguments to pass to the
constructor of the user-defined actor when it is instantiated.
protected void implDeliver(ActorImpl actor,
ActorMsgRequest msg)
actor - A reference to the ActorImpl which
receive the message.msg - The ActorMsgRequest structure to be
delivered. This structure must be maintained by the actor as it
is required if an exception is returned to the manager.protected ActorName implGetName(ActorImpl actor)
actor - A reference to the ActorImpl who's
name should be returned.
protected void implPostMigrateRebuild(ActorImpl actor,
ActorManager ourMgr)
actor - The actor to rebuild.ourMgr - A reference to the new manager of the
implementation after migration has occurred.
protected void implStamp(ActorImpl actor,
ActorMsgRequest msg)
actor - The actor to do the stamping.msg - The message to be stamped.
protected abstract ActorName actorCreate(ActorImpl caller,
ActorCreateRequest request)
throws java.lang.SecurityException,
RemoteCodeException
If an exception is thrown by this method (asynchronously or otherwise) then the returned actor name is no longer valid and any messages sent to it will be discarded. Furthermore, if the asynchronous exception resulted from the constructor invoked for the new actor, then any messages sent will be dropped. The following asynchronous exceptions may be thrown:
request - The ActorCreateRequest structure
which describes the new actor to be created.
protected abstract void actorSend(ActorImpl caller,
ActorMsgRequest message)
throws RemoteCodeException
If an exception is returned by this method then the message structure is never sent. For asynchronous exceptions, only the RemoteCodeException corresponds to a message structure which should be viewed as "delivered". All other asynchronous exceptions should be interpreted as indicating that the original message structure was never sent. The following asynchronous exceptions may be thrown:
message - The ActorMsg structure which
indicates the sender and receiver of the message, the method to
invoke on the receiver, and any arguments to pass to the target
method.
protected abstract void actorFatalError(ActorImpl caller,
java.lang.Exception e)
thrower - The ActorImpl signalling the fatal
error. Usually, this actor will be removed from the system.e - The Exception which describes the fatal
error encountered in the actor.
protected abstract void actorMigrate(ActorImpl caller,
ActorManagerName where)
throws IllegalNodeException,
RemoteRequestRefusedException,
RemoteCodeException
thrower - A reference to the ActorImpl which
wishes to be migrated.where - The ActorManagerName of the manager
where this actor should be moved.
protected abstract java.lang.Object actorInvokeService(ActorImpl caller,
ServiceName serviceName,
java.lang.String meth,
java.lang.Object[] serviceArgs)
throws ServiceNotFoundException,
ServiceException
serviceName - The ServiceName of the service
to invoke.serviceArgs - An Object which represents the
sole argument to pass to the invocation function of the service.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||