|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.distributed.rmi.DistributedActorWrapper
public class DistributedActorWrapper
The DistributedActorWrapper implements the RemoteDistributedActor interface. It is a remote distributed actor and wraps actors inside, making them believe they are executed locally while they are distributed. It receives rmi calls. The calls to methods that exist in the actor interface are forwarded to the wrapped actor.
Red (cxh) |
Red (kapokasa) |
Field Summary | |
---|---|
private Actor |
actor
The distributed actor. |
private DistributedTypedCompositeActor |
compositeActor
A distributedTypedCompositeActor that will embed the distributed actor. |
private java.util.HashMap |
idsReceiversMap
Map containing information about the ports, services and receiver IDs. |
private MoMLParser |
momlParser
A MoML parser. |
private boolean |
VERBOSE
Turns debugging messages on when true. |
Constructor Summary | |
---|---|
DistributedActorWrapper()
Construct an DistributedActorWrapper. |
Method Summary | |
---|---|
void |
fire()
Fire the wrapped actor. |
java.net.InetAddress |
getAddress()
Return the Internet Address where the wrapper is executing. |
void |
initialize()
Begin execution of the wrapped actor. |
int |
iterate(int count)
Invoke a specified number of iterations of the wrapped actor. |
boolean |
loadMoML(java.lang.String moml)
Load a moml representation of an actor. |
boolean |
postfire()
This method should be invoked once per iteration, after the last invocation of fire() in that iteration. |
boolean |
prefire()
This method should be invoked once per iteration, before the first invocation of fire() in that iteration. |
void |
preinitialize()
This method should be invoked exactly once per execution of a model, before any of these other methods are invoked. |
private java.lang.String |
processMoML(java.lang.String moml)
Process a string of moml (corresponding to an actor description) adding it some extra moml code that embeds it in a DistributedTypedCompositeActor with a DistributedDirector. |
void |
put(java.util.HashMap data)
Puts copies of the token received into the Receivers included in the IDlist. |
void |
setConnections(java.util.HashMap connections)
Set the "virtual connections" concerning the wrapped actor. |
void |
setPortTypes(java.util.HashMap portTypes)
Set the port types of the wrapped actor. |
void |
stop()
Request that execution of the wrapped actor to stop as soon as possible. |
void |
stopFire()
Request that execution of the current iteration of the wrapped actor complete. |
void |
terminate()
Terminate any currently executing model with extreme prejudice. |
void |
wrapup()
This method is invoked exactly once per execution of an application. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private DistributedTypedCompositeActor compositeActor
private Actor actor
private MoMLParser momlParser
private java.util.HashMap idsReceiversMap
private boolean VERBOSE
Constructor Detail |
---|
public DistributedActorWrapper()
Method Detail |
---|
public void fire() throws java.rmi.RemoteException
fire
in interface DistributedActor
java.rmi.RemoteException
- If a communication-related exception may
occur during the execution of a remote method call.public java.net.InetAddress getAddress() throws java.rmi.RemoteException
getAddress
in interface DistributedActor
java.rmi.RemoteException
- If a communication-related exception may
occur during the execution of a remote method call.public void initialize() throws java.rmi.RemoteException
initialize
in interface DistributedActor
java.rmi.RemoteException
- If a communication-related exception may
occur during the execution of a remote method call.public int iterate(int count) throws java.rmi.RemoteException
iterate
in interface DistributedActor
count
- The number of iterations to perform.
java.rmi.RemoteException
- If a communication-related exception may
occur during the execution of a remote method call.public boolean loadMoML(java.lang.String moml) throws java.rmi.RemoteException
loadMoML
in interface DistributedActor
moml
- The moml code representing the actor to be loaded.
java.rmi.RemoteException
- If a communication-related exception may
occur during the execution of a remote method call.public boolean postfire() throws java.rmi.RemoteException
postfire
in interface DistributedActor
java.rmi.RemoteException
- If a communication-related exception may
occur during the execution of a remote method call.public boolean prefire() throws java.rmi.RemoteException
prefire
in interface DistributedActor
java.rmi.RemoteException
- If a communication-related exception may
occur during the execution of a remote method call.public void preinitialize() throws java.rmi.RemoteException
preinitialize
in interface DistributedActor
java.rmi.RemoteException
- If a communication-related exception may
occur during the execution of a remote method call.public void put(java.util.HashMap data) throws java.rmi.RemoteException, IllegalActionException
put
in interface DistributedActor
data
- contains a token and a list of IDs.
java.rmi.RemoteException
- If a communication-related exception may
occur during the execution of a remote method call.
IllegalActionException
- If the transaction fails (e.g.
the data type is incompatible).public void setConnections(java.util.HashMap connections) throws java.rmi.RemoteException
setConnections
in interface DistributedActor
connections
- a mapping of ports, services and receiver IDs (see
before).
java.rmi.RemoteException
- If a communication-related exception may
occur during the execution of a remote method call.public void setPortTypes(java.util.HashMap portTypes) throws java.rmi.RemoteException
setPortTypes
in interface DistributedActor
portTypes
- is a Map of ports to port types.
java.rmi.RemoteException
- If a communication-related exception may
occur during the execution of a remote method call.public void stop() throws java.rmi.RemoteException
stop
in interface DistributedActor
java.rmi.RemoteException
- If a communication-related exception may
occur during the execution of a remote method call.public void stopFire() throws java.rmi.RemoteException
stopFire
in interface DistributedActor
java.rmi.RemoteException
- If a communication-related exception may
occur during the execution of a remote method call.public void terminate() throws java.rmi.RemoteException
terminate
in interface DistributedActor
java.rmi.RemoteException
- If a communication-related exception may
occur during the execution of a remote method call.public void wrapup() throws java.rmi.RemoteException
wrapup
in interface DistributedActor
java.rmi.RemoteException
- If a communication-related exception may
occur during the execution of a remote method call.private java.lang.String processMoML(java.lang.String moml)
moml
- A String containing moml code that describes an actor.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |