public class CorbaActorClient extends TypedAtomicActor
When constructing, this actor has no input and no output. The ports can be added by the addPort() method (or removed by the removePort() method.) Local ports and remote ports are binded by their names, such that at run time, the tokens sent to a local port is transferred to the remote port with the same name.
It has three default parameters, one for name server, one for its port, and one for the name of the remote actor. Additional parameters can be added to the actor, and those parameters will be sent to the remote actor at the initilization phase of the execution. Parameters are binded by their names.
At the initialize() phase of the execution, the actor will try to create the ORB, and connect to the name server. If succeed, it will find the remote actor by looking for its name. If this succeeds also, the remote actor is called to be located. Then at each firing phase (prefire(), fire() and postfire()), this actor will first transfer all the current input tokens to the remote actor, and call the corresponding methods of the remote actor, then transfer the output values. If any of these actions failed, an Exception will be thrown.
FIXME: In the current implementation, all the values are transferred in the form of a string. This is not type save. Further improvement is needed.
Entity.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
Parameter |
ORBInitProperties
The initialization properties of the ORB.
|
Parameter |
remoteActorName
The name of the remote actor.
|
_typesValid
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
COMPLETED, NOT_READY, STOP_ITERATING
Constructor and Description |
---|
CorbaActorClient(CompositeEntity container,
java.lang.String name)
Construct an actor with the given container and name.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_transferInputs()
Transfer the input tokens to the remote actor.
|
protected void |
_transferOutputs()
Transfer the output data from the remote actor.
|
void |
attributeTypeChanged(Attribute attribute)
Override the base class to allow arbitrary type changes
for the variables and parameters.
|
void |
fire()
Transfer the input tokens to the remote actor, fire the remote
actor, transfer the output tokens, and broadcast them.
|
void |
initialize()
Setup the link to the remote actor.
|
boolean |
postfire()
Transfer the input tokens to the remote actor, postfire the remote
actor, transfer the output tokens, and broadcast them.
|
boolean |
prefire()
Transfer the input tokens to the remote actor, prefire the remote
actor, transfer the output tokens, and broadcast them.
|
void |
wrapup()
Wrapup the remote actor.
|
_containedTypeConstraints, _customTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, clone, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints
_actorFiring, _actorFiring, _declareDelayDependency, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, preinitialize, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
_addPort, _description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
isFireFunctional, isStrict, iterate, stop, stopFire, terminate
addInitializable, preinitialize, removeInitializable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
getDerivedLevel, getDerivedList, propagateValue
public Parameter ORBInitProperties
"Currently, the following configuration properties are defined
for all ORB implementations:
org.omg.CORBA.ORBClass
The name of a Java class that implements the org.omg.CORBA.ORB
interface. Applets and applications do not need to
supply this property unless they must have a particular ORB
implementation. The value for the Java IDL ORB is
com.sun.CORBA.iiop.ORB.
org.omg.CORBA.ORBSingletonClass
The name of a Java class that implements the org.omg.CORBA.ORB
interface. This is the object returned by a call to
orb.init() with no arguments. It is used primarily to create
typecode instances than can be shared across untrusted code
(such as unsigned applets) in a secured environment.
In addition to the standard properties listed above, Java IDL also supports the following properties:
org.omg.CORBA.ORBInitialHost
The host name of a machine running a server or daemon that
provides initial bootstrap services, such as a name service.
The default value for this property is localhost for applications.
For applets it is the applet host, equivalent to
getCodeBase().getHost().
org.omg.CORBA.ORBInitialPort
The port the initial naming service listens to. The default
value is 900."
The parameters should be constructed in one line of String.
For example:
-ORBInitialHost moog.eecs.berkeley.edu -ORBInitialPort
1005
public Parameter remoteActorName
public CorbaActorClient(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
container
- The container.name
- The name of this actor.IllegalActionException
- If the actor cannot be contained
by the proposed container.NameDuplicationException
- If the container already has an
actor with this name.public void attributeTypeChanged(Attribute attribute) throws IllegalActionException
attributeTypeChanged
in class TypedAtomicActor
attribute
- The attribute whose type changed.IllegalActionException
- If thrown by the base class.public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class AtomicActor<TypedIOPort>
IllegalActionException
- If any of the above actions
failted.public void fire() throws IllegalActionException
fire
in interface Executable
fire
in class AtomicActor<TypedIOPort>
IllegalActionException
- If any of the above actions
failed or if there is no director.public boolean postfire() throws IllegalActionException
postfire
in interface Executable
postfire
in class AtomicActor<TypedIOPort>
IllegalActionException
- If any of the above actions
failed or if there is no director.public boolean prefire() throws IllegalActionException
prefire
in interface Executable
prefire
in class AtomicActor<TypedIOPort>
IllegalActionException
- If any of the above actions
failed or if there is no director.public void wrapup() throws IllegalActionException
wrapup
in interface Initializable
wrapup
in class AtomicActor<TypedIOPort>
IllegalActionException
- Not thrown in this base class.protected void _transferInputs() throws IllegalActionException
IllegalActionException
- If the port names do not
match, or the tokens values are invalid.
FIXME: How to set width?protected void _transferOutputs() throws IllegalActionException
IllegalActionException
- If the port names do not
match, or the tokens values are invalid.
FIXME: how to set width?