Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2013-10-01 10:00:54 -0400
committerHenrik Rentz-Reichert2013-10-01 12:58:33 -0400
commite9271e02c6b65a99b7feb77eaddcf6898344e568 (patch)
tree9988ae18e99a920de5240de76268705adb6d10c6
parent5507edae78655799c3a4f754d6f10fec6a9a9b02 (diff)
downloadorg.eclipse.etrice-e9271e02c6b65a99b7feb77eaddcf6898344e568.tar.gz
org.eclipse.etrice-e9271e02c6b65a99b7feb77eaddcf6898344e568.tar.xz
org.eclipse.etrice-e9271e02c6b65a99b7feb77eaddcf6898344e568.zip
[runtime.java][generator.java] Bug 418424: nest runtime binding creation as deep as possible
https://bugs.eclipse.org/418424 Change-Id: I398011365c22fcc4d57ef8768cf3992911364e77
-rw-r--r--examples/.gitignore2
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors1/genmodel.egm109
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC1.java18
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC2.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC3.java15
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Appl.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Container.java20
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Node_nodeRef1_main.java13
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1Factory.java13
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2Factory.java11
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/OptionalInterface.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/OptionalReplicatedInterface.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/PC.java16
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC1.java12
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC2.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC3.java12
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Appl.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Container.java15
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Node_nodeRef1_main.java13
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1Factory.java11
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2Factory.java11
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/PC.java16
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC1.java18
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC2.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC3.java15
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Appl.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Container.java26
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Node_nodeRef1_main.java13
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1Factory.java13
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2Factory.java11
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/OptionalInterface.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/OptionalReplicatedInterface.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/PC.java16
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors4/model/DynAct4.room14
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors4/model/diagrams/org.eclipse.etrice.examples.dynamicactors4.Controller.structure20
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/AC1.java18
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/AC2.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/AC3.java15
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Appl.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Controller.java67
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Node_nodeRef1_main.java15
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Optional.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Optional1.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Optional1Factory.java13
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Optional2.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Optional2Factory.java11
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/OptionalInterface.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/OptionalReplicatedInterface.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/PC.java16
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/PWorker.java16
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Worker.java15
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/Appl.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/Container.java18
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/Node_nodeRef1_main.java13
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/Optional.java15
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/OptionalFactory.java10
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/OptionalInterface.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/OptionalReplicatedInterface.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/PC.java16
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors6/genmodel.egm102
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/AC1.java15
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/AC2.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/AC3.java15
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Appl.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Container.java18
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Node_nodeRef1_main.java25
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional1.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional1Factory.java11
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional1Interface.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional1ReplicatedInterface.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional2.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional2Factory.java11
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional2Interface.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional2ReplicatedInterface.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/PC.java16
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/AC1.java15
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/AC2.java15
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Appl.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Container.java16
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Controller.java28
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Node_nodeRef1_main.java22
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional1.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional1Factory.java13
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional1Interface.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional1ReplicatedInterface.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional2.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional2Factory.java13
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional2Interface.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional2ReplicatedInterface.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/PC.java16
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/PCtrl.java16
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Appl.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Container.java27
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/DeepSub1.java25
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Node_nodeRef1_main.java18
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Optional.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Optional1.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Optional1Factory.java13
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Optional2.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Optional2Factory.java11
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/OptionalInterface.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/OptionalReplicatedInterface.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/PStep.java16
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Sub1.java26
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Sub2.java15
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors9/model/diagrams/org.eclipse.etrice.examples.dynamicactors9.Sender.behavior2
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/Container.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/Node_nodeRef1_subSysRef1.java9
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/PingPong.java5
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/PingPongFactory.java13
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/PingPongProtocol.java16
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/PingPongTop.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/Receiver.java4
-rw-r--r--examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/Sender.java5
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/builder/Wiring.java2
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassGen.xtend17
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeGen.xtend37
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/OptionalActorFactoryGen.xtend39
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassGen.java76
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/NodeGen.java214
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/OptionalActorFactoryGen.java185
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors1.zipbin240648 -> 261615 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors2.zipbin230402 -> 250006 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors3.zipbin254269 -> 275382 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors4.zipbin289273 -> 314278 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors5.zipbin173131 -> 186247 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors6.zipbin228892 -> 250139 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors7.zipbin145227 -> 170192 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors8.zipbin321410 -> 349645 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors9.zipbin61459 -> 61455 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.c.zipbin136125 -> 136125 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.java.zipbin365549 -> 373908 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.c.zipbin112244 -> 6193622 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.java.zipbin67347 -> 65472 bytes
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/IRTObject.java61
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/RTObject.java13
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/DataPortBase.java10
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/DataReceivePort.java8
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/DataSendPort.java11
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/IInterfaceItem.java8
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/IInterfaceItemBroker.java5
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/IReplicatedInterfaceItem.java2
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/InterfaceItemBase.java55
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/InterfaceItemBroker.java60
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/OptionalActorInterfaceBase.java149
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/PathToPeers.java53
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/ReplicatedInterfaceItemBase.java27
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/SubSystemClassBase.java41
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/DynamicActorTest3.room14
-rw-r--r--tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/modelbase/BrokerTest.java46
-rw-r--r--tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/modelbase/PortBaseTest.java4
-rw-r--r--tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/modelbase/ReplicatedPortBaseTest.java13
161 files changed, 1412 insertions, 1229 deletions
diff --git a/examples/.gitignore b/examples/.gitignore
new file mode 100644
index 000000000..edeaaf4de
--- /dev/null
+++ b/examples/.gitignore
@@ -0,0 +1,2 @@
+org.eclipse.etrice.modellib.java
+org.eclipse.etrice.runtime.java
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors1/genmodel.egm b/examples/org.eclipse.etrice.examples.dynamicactors1/genmodel.egm
index 5c7b5fbde..51d8318c5 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors1/genmodel.egm
+++ b/examples/org.eclipse.etrice.examples.dynamicactors1/genmodel.egm
@@ -7,7 +7,7 @@
<ports name="p0" objId="3" peers="//@systemInstances.0/@instances.0/@instances.0/@instances.0/@instances.0/@ports.0" kind="internal" bindings="//@systemInstances.0/@instances.0/@instances.0/@instances.0/@bindings.0">
<port href="model/DynAct1.room#Port:Container$p0"/>
</ports>
- <instances xsi:type="etricegen:ActorInterfaceInstance" name="opt" optionalInstances="//@optionalInstances.0 //@optionalInstances.1">
+ <instances xsi:type="etricegen:ActorInterfaceInstance" name="opt" optionalInstances="//@optionalInstances.1 //@optionalInstances.0">
<ports name="p0" objId="4" peers="//@systemInstances.0/@instances.0/@instances.0/@instances.0/@ports.0" kind="interface" bindings="//@systemInstances.0/@instances.0/@instances.0/@instances.0/@bindings.0">
<port href="model/DynAct1.room#Port:Optional$p0"/>
</ports>
@@ -163,56 +163,109 @@
<actorClass href="model/DynAct1.room#ActorClass:Optional2"/>
<stateMachine/>
</xpActorClasses>
- <optionalInstances name="Optional1">
- <ports name="p0" objId="5" peers="//@optionalInstances.0/@instances.0/@ports.0" kind="interface" bindings="//@optionalInstances.0/@bindings.0">
+ <optionalInstances name="Optional2">
+ <ports name="p0" objId="5" peers="//@optionalInstances.0/@instances.0/@instances.0/@ports.0" kind="interface" bindings="//@optionalInstances.0/@bindings.0">
<port href="model/DynAct1.room#Port:Optional$p0"/>
</ports>
- <instances xsi:type="etricegen:ActorInstance" name="sub1" objId="6">
- <ports name="p0" objId="7" peers="//@optionalInstances.0/@ports.0" bindings="//@optionalInstances.0/@bindings.0">
- <port href="model/DynAct1.room#Port:AC1$p0"/>
- </ports>
- <ports name="hlp" objId="8" peers="//@optionalInstances.0/@instances.0/@instances.0/@ports.0" kind="internal" bindings="//@optionalInstances.0/@instances.0/@bindings.0">
- <port href="model/DynAct1.room#Port:AC1$hlp"/>
+ <instances xsi:type="etricegen:ActorInstance" name="sub2" objId="6">
+ <ports name="p0" kind="relay" bindings="//@optionalInstances.0/@instances.0/@bindings.0 //@optionalInstances.0/@bindings.0">
+ <port href="model/DynAct1.room#Port:AC2$p0"/>
</ports>
- <instances xsi:type="etricegen:ActorInstance" name="helper" objId="9">
- <ports name="p0" objId="10" peers="//@optionalInstances.0/@instances.0/@ports.1" bindings="//@optionalInstances.0/@instances.0/@bindings.0">
+ <instances xsi:type="etricegen:ActorInstance" name="deep_sub" objId="7">
+ <ports name="p0" objId="8" peers="//@optionalInstances.0/@ports.0" bindings="//@optionalInstances.0/@instances.0/@bindings.0">
<port href="model/DynAct1.room#Port:AC3$p0"/>
</ports>
<actorClass href="model/DynAct1.room#ActorClass:AC3"/>
</instances>
- <bindings ports="//@optionalInstances.0/@instances.0/@ports.1 //@optionalInstances.0/@instances.0/@instances.0/@ports.0">
- <binding href="model/DynAct1.room#Binding:AC1$hlp!.-p0!helper"/>
+ <bindings ports="//@optionalInstances.0/@instances.0/@ports.0 //@optionalInstances.0/@instances.0/@instances.0/@ports.0">
+ <binding href="model/DynAct1.room#Binding:AC2$p0!.-p0!deep_sub"/>
</bindings>
- <actorClass href="model/DynAct1.room#ActorClass:AC1"/>
+ <actorClass href="model/DynAct1.room#ActorClass:AC2"/>
</instances>
<bindings ports="//@optionalInstances.0/@ports.0 //@optionalInstances.0/@instances.0/@ports.0">
- <binding href="model/DynAct1.room#Binding:Optional1$p0!.-p0!sub1"/>
+ <binding href="model/DynAct1.room#Binding:Optional2$p0!.-p0!sub2"/>
</bindings>
- <actorClass href="model/DynAct1.room#ActorClass:Optional1"/>
+ <actorClass href="model/DynAct1.room#ActorClass:Optional2"/>
</optionalInstances>
- <optionalInstances name="Optional2">
- <ports name="p0" objId="11" peers="//@optionalInstances.1/@instances.0/@instances.0/@ports.0" kind="interface" bindings="//@optionalInstances.1/@bindings.0">
+ <optionalInstances name="Optional1">
+ <ports name="p0" objId="9" peers="//@optionalInstances.1/@instances.0/@ports.0" kind="interface" bindings="//@optionalInstances.1/@bindings.0">
<port href="model/DynAct1.room#Port:Optional$p0"/>
</ports>
- <instances xsi:type="etricegen:ActorInstance" name="sub2" objId="12">
- <ports name="p0" kind="relay" bindings="//@optionalInstances.1/@instances.0/@bindings.0 //@optionalInstances.1/@bindings.0">
- <port href="model/DynAct1.room#Port:AC2$p0"/>
+ <instances xsi:type="etricegen:ActorInstance" name="sub1" objId="10">
+ <ports name="p0" objId="11" peers="//@optionalInstances.1/@ports.0" bindings="//@optionalInstances.1/@bindings.0">
+ <port href="model/DynAct1.room#Port:AC1$p0"/>
+ </ports>
+ <ports name="hlp" objId="12" peers="//@optionalInstances.1/@instances.0/@instances.0/@ports.0" kind="internal" bindings="//@optionalInstances.1/@instances.0/@bindings.0">
+ <port href="model/DynAct1.room#Port:AC1$hlp"/>
</ports>
- <instances xsi:type="etricegen:ActorInstance" name="deep_sub" objId="13">
- <ports name="p0" objId="14" peers="//@optionalInstances.1/@ports.0" bindings="//@optionalInstances.1/@instances.0/@bindings.0">
+ <instances xsi:type="etricegen:ActorInstance" name="helper" objId="13">
+ <ports name="p0" objId="14" peers="//@optionalInstances.1/@instances.0/@ports.1" bindings="//@optionalInstances.1/@instances.0/@bindings.0">
<port href="model/DynAct1.room#Port:AC3$p0"/>
</ports>
<actorClass href="model/DynAct1.room#ActorClass:AC3"/>
</instances>
- <bindings ports="//@optionalInstances.1/@instances.0/@ports.0 //@optionalInstances.1/@instances.0/@instances.0/@ports.0">
- <binding href="model/DynAct1.room#Binding:AC2$p0!.-p0!deep_sub"/>
+ <bindings ports="//@optionalInstances.1/@instances.0/@ports.1 //@optionalInstances.1/@instances.0/@instances.0/@ports.0">
+ <binding href="model/DynAct1.room#Binding:AC1$hlp!.-p0!helper"/>
</bindings>
- <actorClass href="model/DynAct1.room#ActorClass:AC2"/>
+ <actorClass href="model/DynAct1.room#ActorClass:AC1"/>
</instances>
<bindings ports="//@optionalInstances.1/@ports.0 //@optionalInstances.1/@instances.0/@ports.0">
- <binding href="model/DynAct1.room#Binding:Optional2$p0!.-p0!sub2"/>
+ <binding href="model/DynAct1.room#Binding:Optional1$p0!.-p0!sub1"/>
</bindings>
- <actorClass href="model/DynAct1.room#ActorClass:Optional2"/>
+ <actorClass href="model/DynAct1.room#ActorClass:Optional1"/>
</optionalInstances>
<optionalActorClasses href="model/DynAct1.room#ActorClass:Optional"/>
+ <wiredInstances xsi:type="etricegen:WiredActorClass">
+ <actorClass href="model/DynAct1.room#ActorClass:AC3"/>
+ </wiredInstances>
+ <wiredInstances xsi:type="etricegen:WiredActorClass">
+ <wires>
+ <path1>helper</path1>
+ <path1>p0</path1>
+ <path2>hlp</path2>
+ </wires>
+ <actorClass href="model/DynAct1.room#ActorClass:AC1"/>
+ </wiredInstances>
+ <wiredInstances xsi:type="etricegen:WiredActorClass">
+ <openBindings>
+ <path>deep_sub</path>
+ <path>p0</path>
+ <port href="model/DynAct1.room#Port:AC2$p0"/>
+ </openBindings>
+ <actorClass href="model/DynAct1.room#ActorClass:AC2"/>
+ </wiredInstances>
+ <wiredInstances xsi:type="etricegen:WiredActorClass">
+ <wires>
+ <path1>opt</path1>
+ <path1>p0</path1>
+ <path2>p0</path2>
+ </wires>
+ <actorClass href="model/DynAct1.room#ActorClass:Container"/>
+ </wiredInstances>
+ <wiredInstances xsi:type="etricegen:WiredActorClass">
+ <actorClass href="model/DynAct1.room#ActorClass:Appl"/>
+ </wiredInstances>
+ <wiredInstances xsi:type="etricegen:WiredActorClass">
+ <actorClass href="model/DynAct1.room#ActorClass:Optional"/>
+ </wiredInstances>
+ <wiredInstances xsi:type="etricegen:WiredActorClass">
+ <openBindings>
+ <path>sub1</path>
+ <path>p0</path>
+ <port href="model/DynAct1.room#Port:Optional$p0"/>
+ </openBindings>
+ <actorClass href="model/DynAct1.room#ActorClass:Optional1"/>
+ </wiredInstances>
+ <wiredInstances xsi:type="etricegen:WiredActorClass">
+ <openBindings>
+ <path>sub2</path>
+ <path>deep_sub</path>
+ <path>p0</path>
+ <port href="model/DynAct1.room#Port:Optional$p0"/>
+ </openBindings>
+ <actorClass href="model/DynAct1.room#ActorClass:Optional2"/>
+ </wiredInstances>
+ <wiredInstances xsi:type="etricegen:WiredSubSystemClass">
+ <subSystemClass href="model/DynAct1.room#SubSystemClass:Main"/>
+ </wiredInstances>
</etricegen:Root>
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC1.java b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC1.java
index 07752e4ff..7b131dd4e 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC1.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC1.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -53,6 +54,10 @@ public class AC1 extends ActorClassBase {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "helper");
new AC3(this, "helper");
+
+ // wiring
+ InterfaceItemBase.connect(this, "helper/p0", "hlp");
+
}
@@ -94,17 +99,18 @@ public class AC1 extends ActorClassBase {
public static final int TRIG_p0__sayHello = IFITEM_p0 + EVT_SHIFT*PC.IN_sayHello;
// state names
- protected static final String stateStrings[] = {"<no state>","<top>","Ready",
- "AskHelper"
+ protected static final String stateStrings[] = {
+ "<no state>",
+ "<top>",
+ "Ready",
+ "AskHelper"
};
-
+
// history
- protected int history[] = {NO_STATE,NO_STATE,NO_STATE,NO_STATE};
+ protected int history[] = {NO_STATE, NO_STATE, NO_STATE, NO_STATE};
private void setState(int new_state) {
DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
- if (stateStrings[new_state]!="Idle") {
- }
this.state = new_state;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC2.java b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC2.java
index c5f247bcd..add46c85e 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC2.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC2.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -47,6 +48,9 @@ public class AC2 extends ActorClassBase {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "deep_sub");
new AC3(this, "deep_sub");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC3.java b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC3.java
index e4e2d63cc..06919ba90 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC3.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC3.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -48,6 +49,9 @@ public class AC3 extends ActorClassBase {
// own service implementations
// sub actors
+
+ // wiring
+
}
@@ -83,16 +87,17 @@ public class AC3 extends ActorClassBase {
public static final int TRIG_p0__sayHello = IFITEM_p0 + EVT_SHIFT*PC.IN_sayHello;
// state names
- protected static final String stateStrings[] = {"<no state>","<top>","Ready"
+ protected static final String stateStrings[] = {
+ "<no state>",
+ "<top>",
+ "Ready"
};
-
+
// history
- protected int history[] = {NO_STATE,NO_STATE,NO_STATE};
+ protected int history[] = {NO_STATE, NO_STATE, NO_STATE};
private void setState(int new_state) {
DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
- if (stateStrings[new_state]!="Idle") {
- }
this.state = new_state;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Appl.java b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Appl.java
index 26c3c307e..edcf2cde4 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Appl.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Appl.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -47,6 +48,9 @@ public class Appl extends ActorClassBase {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "cont");
new Container(this, "cont");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Container.java b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Container.java
index f22baf948..7c0a733c1 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Container.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Container.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -55,6 +56,10 @@ public class Container extends ActorClassBase {
// sub actors
opt = new OptionalInterface(this, "opt");
+
+ // wiring
+ InterfaceItemBase.connect(this, "opt/p0", "p0");
+
}
@@ -93,18 +98,19 @@ public class Container extends ActorClassBase {
public static final int TRIG_p0__hello = IFITEM_p0 + EVT_SHIFT*PC.OUT_hello;
// state names
- protected static final String stateStrings[] = {"<no state>","<top>","CreateOptional2",
- "CreateOptional1",
- "ReceivedHelloAgain"
+ protected static final String stateStrings[] = {
+ "<no state>",
+ "<top>",
+ "CreateOptional2",
+ "CreateOptional1",
+ "ReceivedHelloAgain"
};
-
+
// history
- protected int history[] = {NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE};
+ protected int history[] = {NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE};
private void setState(int new_state) {
DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
- if (stateStrings[new_state]!="Idle") {
- }
this.state = new_state;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Node_nodeRef1_main.java b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Node_nodeRef1_main.java
index 8f0e0ff00..264a57e19 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Node_nodeRef1_main.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Node_nodeRef1_main.java
@@ -8,10 +8,12 @@ import org.eclipse.etrice.runtime.java.messaging.MessageService;
import org.eclipse.etrice.runtime.java.messaging.MessageServiceController;
import org.eclipse.etrice.runtime.java.messaging.RTServices;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;
import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBroker;
@@ -42,15 +44,18 @@ public class Node_nodeRef1_main extends SubSystemClassBase {
// thread mappings
addPathToThread("/LS/main/appl", THREAD_PHYSICALTHREAD1);
addPathToThread("/LS/main/appl/cont", THREAD_PHYSICALTHREAD1);
-
- // port to peer port mappings
- addPathToPeers("/LS/main/appl/cont/p0", "/LS/main/appl/cont/opt/p0");
- addPathToPeers("/LS/main/appl/cont/opt/p0", "/LS/main/appl/cont/p0");
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "appl");
new Appl(this, "appl");
+ // create service brokers in optional actor interfaces
+ {
+ OptionalActorInterfaceBase oai = (OptionalActorInterfaceBase) getObject("/LS/main/appl/cont/opt");
+ }
+
+ // wiring
+
// apply instance attribute configurations
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional.java b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional.java
index 5c89bcf2d..c4dcacf67 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -45,6 +46,9 @@ public abstract class Optional extends ActorClassBase {
// own service implementations
// sub actors
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1.java b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1.java
index 5b94d963b..54401eb64 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -47,6 +48,9 @@ public class Optional1 extends Optional {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "sub1");
new AC1(this, "sub1");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1Factory.java b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1Factory.java
index 912e72b57..6c1566402 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1Factory.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1Factory.java
@@ -3,23 +3,16 @@ package org.eclipse.etrice.examples.dynamicactors1;
import org.eclipse.etrice.examples.dynamicactors1.Optional1;
import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;
import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;
-import org.eclipse.etrice.runtime.java.modelbase.PathToPeers;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
public class Optional1Factory implements IOptionalActorFactory {
- private PathToPeers path2peers = new PathToPeers();
-
public Optional1 create(OptionalActorInterfaceBase ai, String name) {
- // set port mappings of this sub tree
- path2peers.put("/sub1/p0", "/p0");
- path2peers.put("/sub1/hlp", "/sub1/helper/p0");
- path2peers.put("/sub1/helper/p0", "/sub1/hlp");
- ai.setPath2peers(path2peers);
-
// instantiate sub tree
Optional1 actor = new Optional1(ai, name);
- ai.setPath2peers(null);
+ // wiring
+ InterfaceItemBase.connect(ai, "p0", name+"/sub1/p0");
return actor;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2.java b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2.java
index ead8d60c7..c0f2ba56d 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -47,6 +48,9 @@ public class Optional2 extends Optional {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "sub2");
new AC2(this, "sub2");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2Factory.java b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2Factory.java
index ca7742686..84ceb1594 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2Factory.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2Factory.java
@@ -3,21 +3,16 @@ package org.eclipse.etrice.examples.dynamicactors1;
import org.eclipse.etrice.examples.dynamicactors1.Optional2;
import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;
import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;
-import org.eclipse.etrice.runtime.java.modelbase.PathToPeers;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
public class Optional2Factory implements IOptionalActorFactory {
- private PathToPeers path2peers = new PathToPeers();
-
public Optional2 create(OptionalActorInterfaceBase ai, String name) {
- // set port mappings of this sub tree
- path2peers.put("/sub2/deep_sub/p0", "/p0");
- ai.setPath2peers(path2peers);
-
// instantiate sub tree
Optional2 actor = new Optional2(ai, name);
- ai.setPath2peers(null);
+ // wiring
+ InterfaceItemBase.connect(ai, "p0", name+"/sub2/deep_sub/p0");
return actor;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/OptionalInterface.java b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/OptionalInterface.java
index 732190fe0..a13826f54 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/OptionalInterface.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/OptionalInterface.java
@@ -20,12 +20,12 @@ class OptionalInterface extends ScalarOptionalActorInterfaceBase {
}
@Override
- protected void logCreation(String actorClass, String name) {
+ protected void logCreation(String actorClass, String name) {
DebuggingService.getInstance().addMessageActorCreate(this, actorClass, name);
}
@Override
- protected void logDeletion(String name) {
+ protected void logDeletion(String name) {
DebuggingService.getInstance().addMessageActorDestroy(this, name);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/OptionalReplicatedInterface.java b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/OptionalReplicatedInterface.java
index ad2aac3b7..b25dad0ed 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/OptionalReplicatedInterface.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/OptionalReplicatedInterface.java
@@ -20,12 +20,12 @@ class OptionalReplicatedInterface extends ReplicatedOptionalActorInterfaceBase {
}
@Override
- protected void logCreation(String actorClass, String name) {
+ protected void logCreation(String actorClass, String name) {
DebuggingService.getInstance().addMessageActorCreate(this, actorClass, name);
}
@Override
- protected void logDeletion(String name) {
+ protected void logDeletion(String name) {
DebuggingService.getInstance().addMessageActorDestroy(this, name);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/PC.java b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/PC.java
index 73a458047..ec4455cf5 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/PC.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors1/src-gen/org/eclipse/etrice/examples/dynamicactors1/PC.java
@@ -58,10 +58,10 @@ public class PC {
if (messageStrings[msg.getEvtId()] != "timerTick"){
DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
}
- if (msg instanceof EventWithDataMessage)
- getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
- else
- getActor().receiveEvent(this, msg.getEvtId(), null);
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
}
}
@@ -133,10 +133,10 @@ public class PC {
if (messageStrings[msg.getEvtId()] != "timerTick"){
DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
}
- if (msg instanceof EventWithDataMessage)
- getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
- else
- getActor().receiveEvent(this, msg.getEvtId(), null);
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC1.java b/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC1.java
index 1e27eeaa4..109e04482 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC1.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC1.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -48,6 +49,9 @@ public class AC1 extends ActorClassBase {
// own service implementations
// sub actors
+
+ // wiring
+
}
@@ -78,16 +82,10 @@ public class AC1 extends ActorClassBase {
public static final int POLLING = 0;
public static final int TRIG_p0__sayHello = IFITEM_p0 + EVT_SHIFT*PC.IN_sayHello;
- // state names
- protected static final String stateStrings[] = {"<no state>","<top>","Ready"
- };
-
// history
- protected int history[] = {NO_STATE,NO_STATE,NO_STATE};
+ protected int history[] = {NO_STATE, NO_STATE, NO_STATE};
private void setState(int new_state) {
- if (stateStrings[new_state]!="Idle") {
- }
this.state = new_state;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC2.java b/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC2.java
index a9f4a9a00..3c925815a 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC2.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC2.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -46,6 +47,9 @@ public class AC2 extends ActorClassBase {
// sub actors
new AC3(this, "deep_sub");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC3.java b/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC3.java
index fc7770085..8ea99e5b0 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC3.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC3.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -48,6 +49,9 @@ public class AC3 extends ActorClassBase {
// own service implementations
// sub actors
+
+ // wiring
+
}
@@ -78,16 +82,10 @@ public class AC3 extends ActorClassBase {
public static final int POLLING = 0;
public static final int TRIG_p0__sayHello = IFITEM_p0 + EVT_SHIFT*PC.IN_sayHello;
- // state names
- protected static final String stateStrings[] = {"<no state>","<top>","Ready"
- };
-
// history
- protected int history[] = {NO_STATE,NO_STATE,NO_STATE};
+ protected int history[] = {NO_STATE, NO_STATE, NO_STATE};
private void setState(int new_state) {
- if (stateStrings[new_state]!="Idle") {
- }
this.state = new_state;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Appl.java b/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Appl.java
index 16139cb4d..f55b743fb 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Appl.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Appl.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -46,6 +47,9 @@ public class Appl extends ActorClassBase {
// sub actors
new Container(this, "cont");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Container.java b/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Container.java
index 3ad394ef7..9f9018f9a 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Container.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Container.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -57,6 +58,10 @@ public class Container extends ActorClassBase {
// sub actors
opt = new OptionalInterface(this, "opt");
+
+ // wiring
+ InterfaceItemBase.connect(this, "opt/p0", "p0");
+
}
@@ -96,18 +101,10 @@ public class Container extends ActorClassBase {
public static final int POLLING = 0;
public static final int TRIG_p0__hello = IFITEM_p0 + EVT_SHIFT*PC.OUT_hello;
- // state names
- protected static final String stateStrings[] = {"<no state>","<top>","CreateOptional2",
- "CreateOptional1",
- "Done"
- };
-
// history
- protected int history[] = {NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE};
+ protected int history[] = {NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE};
private void setState(int new_state) {
- if (stateStrings[new_state]!="Idle") {
- }
this.state = new_state;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Node_nodeRef1_main.java b/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Node_nodeRef1_main.java
index e2a26df39..8d025a56a 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Node_nodeRef1_main.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Node_nodeRef1_main.java
@@ -7,10 +7,12 @@ import org.eclipse.etrice.runtime.java.messaging.MessageService;
import org.eclipse.etrice.runtime.java.messaging.MessageServiceController;
import org.eclipse.etrice.runtime.java.messaging.RTServices;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;
import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBroker;
@@ -41,14 +43,17 @@ public class Node_nodeRef1_main extends SubSystemClassBase {
// thread mappings
addPathToThread("/LS/main/appl", THREAD_PHYSICALTHREAD1);
addPathToThread("/LS/main/appl/cont", THREAD_PHYSICALTHREAD1);
-
- // port to peer port mappings
- addPathToPeers("/LS/main/appl/cont/p0", "/LS/main/appl/cont/opt/p0");
- addPathToPeers("/LS/main/appl/cont/opt/p0", "/LS/main/appl/cont/p0");
// sub actors
new Appl(this, "appl");
+ // create service brokers in optional actor interfaces
+ {
+ OptionalActorInterfaceBase oai = (OptionalActorInterfaceBase) getObject("/LS/main/appl/cont/opt");
+ }
+
+ // wiring
+
// apply instance attribute configurations
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional.java b/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional.java
index 246b9c043..8c6936828 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -45,6 +46,9 @@ public abstract class Optional extends ActorClassBase {
// own service implementations
// sub actors
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1.java b/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1.java
index e30db0fee..03e91895e 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -46,6 +47,9 @@ public class Optional1 extends Optional {
// sub actors
new AC1(this, "sub1");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1Factory.java b/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1Factory.java
index 37c8c5af4..6c1566402 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1Factory.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1Factory.java
@@ -3,21 +3,16 @@ package org.eclipse.etrice.examples.dynamicactors1;
import org.eclipse.etrice.examples.dynamicactors1.Optional1;
import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;
import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;
-import org.eclipse.etrice.runtime.java.modelbase.PathToPeers;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
public class Optional1Factory implements IOptionalActorFactory {
- private PathToPeers path2peers = new PathToPeers();
-
public Optional1 create(OptionalActorInterfaceBase ai, String name) {
- // set port mappings of this sub tree
- path2peers.put("/sub1/p0", "/p0");
- ai.setPath2peers(path2peers);
-
// instantiate sub tree
Optional1 actor = new Optional1(ai, name);
- ai.setPath2peers(null);
+ // wiring
+ InterfaceItemBase.connect(ai, "p0", name+"/sub1/p0");
return actor;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2.java b/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2.java
index 5ba1b1cdb..0864972fb 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -46,6 +47,9 @@ public class Optional2 extends Optional {
// sub actors
new AC2(this, "sub2");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2Factory.java b/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2Factory.java
index ca7742686..84ceb1594 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2Factory.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2Factory.java
@@ -3,21 +3,16 @@ package org.eclipse.etrice.examples.dynamicactors1;
import org.eclipse.etrice.examples.dynamicactors1.Optional2;
import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;
import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;
-import org.eclipse.etrice.runtime.java.modelbase.PathToPeers;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
public class Optional2Factory implements IOptionalActorFactory {
- private PathToPeers path2peers = new PathToPeers();
-
public Optional2 create(OptionalActorInterfaceBase ai, String name) {
- // set port mappings of this sub tree
- path2peers.put("/sub2/deep_sub/p0", "/p0");
- ai.setPath2peers(path2peers);
-
// instantiate sub tree
Optional2 actor = new Optional2(ai, name);
- ai.setPath2peers(null);
+ // wiring
+ InterfaceItemBase.connect(ai, "p0", name+"/sub2/deep_sub/p0");
return actor;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/PC.java b/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/PC.java
index cedec8ee1..f8b27efcc 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/PC.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors2/src-gen/org/eclipse/etrice/examples/dynamicactors1/PC.java
@@ -48,10 +48,10 @@ public class PC {
return;
EventMessage msg = (EventMessage) m;
if (0 < msg.getEvtId() && msg.getEvtId() < MSG_MAX) {
- if (msg instanceof EventWithDataMessage)
- getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
- else
- getActor().receiveEvent(this, msg.getEvtId(), null);
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
}
}
@@ -111,10 +111,10 @@ public class PC {
return;
EventMessage msg = (EventMessage) m;
if (0 < msg.getEvtId() && msg.getEvtId() < MSG_MAX) {
- if (msg instanceof EventWithDataMessage)
- getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
- else
- getActor().receiveEvent(this, msg.getEvtId(), null);
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC1.java b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC1.java
index 07752e4ff..7b131dd4e 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC1.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC1.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -53,6 +54,10 @@ public class AC1 extends ActorClassBase {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "helper");
new AC3(this, "helper");
+
+ // wiring
+ InterfaceItemBase.connect(this, "helper/p0", "hlp");
+
}
@@ -94,17 +99,18 @@ public class AC1 extends ActorClassBase {
public static final int TRIG_p0__sayHello = IFITEM_p0 + EVT_SHIFT*PC.IN_sayHello;
// state names
- protected static final String stateStrings[] = {"<no state>","<top>","Ready",
- "AskHelper"
+ protected static final String stateStrings[] = {
+ "<no state>",
+ "<top>",
+ "Ready",
+ "AskHelper"
};
-
+
// history
- protected int history[] = {NO_STATE,NO_STATE,NO_STATE,NO_STATE};
+ protected int history[] = {NO_STATE, NO_STATE, NO_STATE, NO_STATE};
private void setState(int new_state) {
DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
- if (stateStrings[new_state]!="Idle") {
- }
this.state = new_state;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC2.java b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC2.java
index c5f247bcd..add46c85e 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC2.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC2.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -47,6 +48,9 @@ public class AC2 extends ActorClassBase {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "deep_sub");
new AC3(this, "deep_sub");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC3.java b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC3.java
index e4e2d63cc..06919ba90 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC3.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/AC3.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -48,6 +49,9 @@ public class AC3 extends ActorClassBase {
// own service implementations
// sub actors
+
+ // wiring
+
}
@@ -83,16 +87,17 @@ public class AC3 extends ActorClassBase {
public static final int TRIG_p0__sayHello = IFITEM_p0 + EVT_SHIFT*PC.IN_sayHello;
// state names
- protected static final String stateStrings[] = {"<no state>","<top>","Ready"
+ protected static final String stateStrings[] = {
+ "<no state>",
+ "<top>",
+ "Ready"
};
-
+
// history
- protected int history[] = {NO_STATE,NO_STATE,NO_STATE};
+ protected int history[] = {NO_STATE, NO_STATE, NO_STATE};
private void setState(int new_state) {
DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
- if (stateStrings[new_state]!="Idle") {
- }
this.state = new_state;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Appl.java b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Appl.java
index 26c3c307e..edcf2cde4 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Appl.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Appl.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -47,6 +48,9 @@ public class Appl extends ActorClassBase {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "cont");
new Container(this, "cont");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Container.java b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Container.java
index f064ede84..7f09ce86e 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Container.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Container.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -55,6 +56,10 @@ public class Container extends ActorClassBase {
// sub actors
optarray = new OptionalReplicatedInterface(this, "optarray");
+
+ // wiring
+ InterfaceItemBase.connect(this, "optarray/p0", "p0");
+
}
@@ -99,21 +104,22 @@ public class Container extends ActorClassBase {
public static final int TRIG_p0__hello = IFITEM_p0 + EVT_SHIFT*PC.OUT_hello;
// state names
- protected static final String stateStrings[] = {"<no state>","<top>","CreateOptional2",
- "CreateOptional1",
- "ReceivedHelloAgain",
- "Destroy0",
- "Destroy1Create2",
- "Done"
+ protected static final String stateStrings[] = {
+ "<no state>",
+ "<top>",
+ "CreateOptional2",
+ "CreateOptional1",
+ "ReceivedHelloAgain",
+ "Destroy0",
+ "Destroy1Create2",
+ "Done"
};
-
+
// history
- protected int history[] = {NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE};
+ protected int history[] = {NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE};
private void setState(int new_state) {
DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
- if (stateStrings[new_state]!="Idle") {
- }
this.state = new_state;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Node_nodeRef1_main.java b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Node_nodeRef1_main.java
index f0fdd2aa2..87721c21d 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Node_nodeRef1_main.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Node_nodeRef1_main.java
@@ -8,10 +8,12 @@ import org.eclipse.etrice.runtime.java.messaging.MessageService;
import org.eclipse.etrice.runtime.java.messaging.MessageServiceController;
import org.eclipse.etrice.runtime.java.messaging.RTServices;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;
import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBroker;
@@ -42,15 +44,18 @@ public class Node_nodeRef1_main extends SubSystemClassBase {
// thread mappings
addPathToThread("/LS/main/appl", THREAD_PHYSICALTHREAD1);
addPathToThread("/LS/main/appl/cont", THREAD_PHYSICALTHREAD1);
-
- // port to peer port mappings
- addPathToPeers("/LS/main/appl/cont/p0", "/LS/main/appl/cont/optarray/p0");
- addPathToPeers("/LS/main/appl/cont/optarray/p0", "/LS/main/appl/cont/p0");
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "appl");
new Appl(this, "appl");
+ // create service brokers in optional actor interfaces
+ {
+ OptionalActorInterfaceBase oai = (OptionalActorInterfaceBase) getObject("/LS/main/appl/cont/optarray");
+ }
+
+ // wiring
+
// apply instance attribute configurations
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional.java b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional.java
index 5c89bcf2d..c4dcacf67 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -45,6 +46,9 @@ public abstract class Optional extends ActorClassBase {
// own service implementations
// sub actors
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1.java b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1.java
index 5b94d963b..54401eb64 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -47,6 +48,9 @@ public class Optional1 extends Optional {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "sub1");
new AC1(this, "sub1");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1Factory.java b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1Factory.java
index 912e72b57..6c1566402 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1Factory.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional1Factory.java
@@ -3,23 +3,16 @@ package org.eclipse.etrice.examples.dynamicactors1;
import org.eclipse.etrice.examples.dynamicactors1.Optional1;
import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;
import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;
-import org.eclipse.etrice.runtime.java.modelbase.PathToPeers;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
public class Optional1Factory implements IOptionalActorFactory {
- private PathToPeers path2peers = new PathToPeers();
-
public Optional1 create(OptionalActorInterfaceBase ai, String name) {
- // set port mappings of this sub tree
- path2peers.put("/sub1/p0", "/p0");
- path2peers.put("/sub1/hlp", "/sub1/helper/p0");
- path2peers.put("/sub1/helper/p0", "/sub1/hlp");
- ai.setPath2peers(path2peers);
-
// instantiate sub tree
Optional1 actor = new Optional1(ai, name);
- ai.setPath2peers(null);
+ // wiring
+ InterfaceItemBase.connect(ai, "p0", name+"/sub1/p0");
return actor;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2.java b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2.java
index ead8d60c7..c0f2ba56d 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -47,6 +48,9 @@ public class Optional2 extends Optional {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "sub2");
new AC2(this, "sub2");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2Factory.java b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2Factory.java
index ca7742686..84ceb1594 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2Factory.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/Optional2Factory.java
@@ -3,21 +3,16 @@ package org.eclipse.etrice.examples.dynamicactors1;
import org.eclipse.etrice.examples.dynamicactors1.Optional2;
import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;
import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;
-import org.eclipse.etrice.runtime.java.modelbase.PathToPeers;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
public class Optional2Factory implements IOptionalActorFactory {
- private PathToPeers path2peers = new PathToPeers();
-
public Optional2 create(OptionalActorInterfaceBase ai, String name) {
- // set port mappings of this sub tree
- path2peers.put("/sub2/deep_sub/p0", "/p0");
- ai.setPath2peers(path2peers);
-
// instantiate sub tree
Optional2 actor = new Optional2(ai, name);
- ai.setPath2peers(null);
+ // wiring
+ InterfaceItemBase.connect(ai, "p0", name+"/sub2/deep_sub/p0");
return actor;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/OptionalInterface.java b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/OptionalInterface.java
index 732190fe0..a13826f54 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/OptionalInterface.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/OptionalInterface.java
@@ -20,12 +20,12 @@ class OptionalInterface extends ScalarOptionalActorInterfaceBase {
}
@Override
- protected void logCreation(String actorClass, String name) {
+ protected void logCreation(String actorClass, String name) {
DebuggingService.getInstance().addMessageActorCreate(this, actorClass, name);
}
@Override
- protected void logDeletion(String name) {
+ protected void logDeletion(String name) {
DebuggingService.getInstance().addMessageActorDestroy(this, name);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/OptionalReplicatedInterface.java b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/OptionalReplicatedInterface.java
index ad2aac3b7..b25dad0ed 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/OptionalReplicatedInterface.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/OptionalReplicatedInterface.java
@@ -20,12 +20,12 @@ class OptionalReplicatedInterface extends ReplicatedOptionalActorInterfaceBase {
}
@Override
- protected void logCreation(String actorClass, String name) {
+ protected void logCreation(String actorClass, String name) {
DebuggingService.getInstance().addMessageActorCreate(this, actorClass, name);
}
@Override
- protected void logDeletion(String name) {
+ protected void logDeletion(String name) {
DebuggingService.getInstance().addMessageActorDestroy(this, name);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/PC.java b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/PC.java
index 73a458047..ec4455cf5 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/PC.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors3/src-gen/org/eclipse/etrice/examples/dynamicactors1/PC.java
@@ -58,10 +58,10 @@ public class PC {
if (messageStrings[msg.getEvtId()] != "timerTick"){
DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
}
- if (msg instanceof EventWithDataMessage)
- getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
- else
- getActor().receiveEvent(this, msg.getEvtId(), null);
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
}
}
@@ -133,10 +133,10 @@ public class PC {
if (messageStrings[msg.getEvtId()] != "timerTick"){
DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
}
- if (msg instanceof EventWithDataMessage)
- getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
- else
- getActor().receiveEvent(this, msg.getEvtId(), null);
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors4/model/DynAct4.room b/examples/org.eclipse.etrice.examples.dynamicactors4/model/DynAct4.room
index 485a8dc8a..c08bb1e0f 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors4/model/DynAct4.room
+++ b/examples/org.eclipse.etrice.examples.dynamicactors4/model/DynAct4.room
@@ -21,10 +21,10 @@ RoomModel org.eclipse.etrice.examples.dynamicactors4 {
ActorClass Controller {
Structure {
- conjugated Port worker: PWorker
+ conjugated Port wrk: PWorker
conjugated Port opt: PC
ActorRef worker: Worker
- Binding worker and worker.fct
+ Binding wrk and worker.fct
Binding opt and worker.opt
}
Behavior {
@@ -32,7 +32,7 @@ RoomModel org.eclipse.etrice.examples.dynamicactors4 {
Transition init: initial -> createOpt1 { }
Transition tr0: createOpt1 -> SendHello {
triggers {
- <ok: worker>
+ <ok: wrk>
}
}
Transition tr1: SendHello -> TryCreateInvalid {
@@ -45,17 +45,17 @@ RoomModel org.eclipse.etrice.examples.dynamicactors4 {
}
Transition tr2: createOpt1 -> UnexpectedError {
triggers {
- <error: worker>
+ <error: wrk>
}
}
Transition tr3: TryCreateInvalid -> ExpectedError {
triggers {
- <error: worker>
+ <error: wrk>
}
}
State createOpt1 {
entry {
- "worker.create(\"Optional1\");"
+ "wrk.create(\"Optional1\");"
}
}
State SendHello {
@@ -65,7 +65,7 @@ RoomModel org.eclipse.etrice.examples.dynamicactors4 {
}
State TryCreateInvalid {
entry {
- "worker.create(\"Optional\");"
+ "wrk.create(\"Optional\");"
}
}
State UnexpectedError
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors4/model/diagrams/org.eclipse.etrice.examples.dynamicactors4.Controller.structure b/examples/org.eclipse.etrice.examples.dynamicactors4/model/diagrams/org.eclipse.etrice.examples.dynamicactors4.Controller.structure
index d518ac863..ebc5bba00 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors4/model/diagrams/org.eclipse.etrice.examples.dynamicactors4.Controller.structure
+++ b/examples/org.eclipse.etrice.examples.dynamicactors4/model/diagrams/org.eclipse.etrice.examples.dynamicactors4.Controller.structure
@@ -141,7 +141,7 @@
<link>
<businessObjects href="../DynAct4.room#Port:Worker$fct"/>
</link>
- <anchors xsi:type="pi:ChopboxAnchor" incomingConnections="//@connections.0" referencedGraphicsAlgorithm="//@children.0/@children.0/@children.2/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <anchors xsi:type="pi:ChopboxAnchor" incomingConnections="//@connections.1" referencedGraphicsAlgorithm="//@children.0/@children.0/@children.2/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
<children visible="true">
<graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="60" height="15" y="6" font="//@fonts.0" value="fct"/>
</children>
@@ -155,7 +155,7 @@
<link>
<businessObjects href="../DynAct4.room#Port:Worker$opt"/>
</link>
- <anchors xsi:type="pi:ChopboxAnchor" incomingConnections="//@connections.1" referencedGraphicsAlgorithm="//@children.0/@children.0/@children.3/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <anchors xsi:type="pi:ChopboxAnchor" incomingConnections="//@connections.0" referencedGraphicsAlgorithm="//@children.0/@children.0/@children.3/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
<children visible="true">
<graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="60" height="15" y="6" font="//@fonts.0" value="opt"/>
</children>
@@ -169,11 +169,11 @@
<graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.2" foreground="//@colors.2" lineWidth="2" transparency="0.0" width="20" height="20" x="30" y="30"/>
</graphicsAlgorithm>
<link>
- <businessObjects href="../DynAct4.room#Port:Controller$worker"/>
+ <businessObjects href="../DynAct4.room#Port:Controller$wrk"/>
</link>
- <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.0" referencedGraphicsAlgorithm="//@children.0/@children.1/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.1" referencedGraphicsAlgorithm="//@children.0/@children.1/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
<children visible="true">
- <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="80" height="20" y="60" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="worker"/>
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="80" height="20" y="60" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="wrk"/>
</children>
</children>
<children xsi:type="pi:ContainerShape" visible="true" active="true">
@@ -186,24 +186,24 @@
<link>
<businessObjects href="../DynAct4.room#Port:Controller$opt"/>
</link>
- <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.1" referencedGraphicsAlgorithm="//@children.0/@children.2/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.0" referencedGraphicsAlgorithm="//@children.0/@children.2/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
<children visible="true">
<graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="80" height="20" y="60" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="opt"/>
</children>
</children>
</children>
- <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.1/@anchors.0" end="//@children.0/@children.0/@children.2/@anchors.0">
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.2/@anchors.0" end="//@children.0/@children.0/@children.3/@anchors.0">
<properties key="obj-type" value="bind"/>
<graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
<link>
- <businessObjects href="../DynAct4.room#Binding:Controller$worker!.-fct!worker"/>
+ <businessObjects href="../DynAct4.room#Binding:Controller$opt!.-opt!worker"/>
</link>
</connections>
- <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.2/@anchors.0" end="//@children.0/@children.0/@children.3/@anchors.0">
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.1/@anchors.0" end="//@children.0/@children.0/@children.2/@anchors.0">
<properties key="obj-type" value="bind"/>
<graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
<link>
- <businessObjects href="../DynAct4.room#Binding:Controller$opt!.-opt!worker"/>
+ <businessObjects href="../DynAct4.room#Binding:Controller$wrk!.-fct!worker"/>
</link>
</connections>
<colors red="227" green="238" blue="249"/>
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/AC1.java b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/AC1.java
index fb65cb533..aed68875a 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/AC1.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/AC1.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -53,6 +54,10 @@ public class AC1 extends ActorClassBase {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "helper");
new AC3(this, "helper");
+
+ // wiring
+ InterfaceItemBase.connect(this, "helper/p0", "hlp");
+
}
@@ -94,17 +99,18 @@ public class AC1 extends ActorClassBase {
public static final int TRIG_p0__sayHello = IFITEM_p0 + EVT_SHIFT*PC.IN_sayHello;
// state names
- protected static final String stateStrings[] = {"<no state>","<top>","Ready",
- "AskHelper"
+ protected static final String stateStrings[] = {
+ "<no state>",
+ "<top>",
+ "Ready",
+ "AskHelper"
};
-
+
// history
- protected int history[] = {NO_STATE,NO_STATE,NO_STATE,NO_STATE};
+ protected int history[] = {NO_STATE, NO_STATE, NO_STATE, NO_STATE};
private void setState(int new_state) {
DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
- if (stateStrings[new_state]!="Idle") {
- }
this.state = new_state;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/AC2.java b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/AC2.java
index 10325f0c1..a62201227 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/AC2.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/AC2.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -47,6 +48,9 @@ public class AC2 extends ActorClassBase {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "deep_sub");
new AC3(this, "deep_sub");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/AC3.java b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/AC3.java
index 8cd621f0d..62f8238a2 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/AC3.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/AC3.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -48,6 +49,9 @@ public class AC3 extends ActorClassBase {
// own service implementations
// sub actors
+
+ // wiring
+
}
@@ -83,16 +87,17 @@ public class AC3 extends ActorClassBase {
public static final int TRIG_p0__sayHello = IFITEM_p0 + EVT_SHIFT*PC.IN_sayHello;
// state names
- protected static final String stateStrings[] = {"<no state>","<top>","Ready"
+ protected static final String stateStrings[] = {
+ "<no state>",
+ "<top>",
+ "Ready"
};
-
+
// history
- protected int history[] = {NO_STATE,NO_STATE,NO_STATE};
+ protected int history[] = {NO_STATE, NO_STATE, NO_STATE};
private void setState(int new_state) {
DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
- if (stateStrings[new_state]!="Idle") {
- }
this.state = new_state;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Appl.java b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Appl.java
index ff621e81b..83f8dbe0e 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Appl.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Appl.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -48,6 +49,9 @@ public class Appl extends ActorClassBase {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "cont");
new Controller(this, "cont");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Controller.java b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Controller.java
index 8aa32e78a..af5b635dc 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Controller.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Controller.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -20,7 +21,7 @@ public class Controller extends ActorClassBase {
//--------------------- ports
- protected PWorkerConjPort worker = null;
+ protected PWorkerConjPort wrk = null;
protected PCConjPort opt = null;
//--------------------- saps
@@ -30,7 +31,7 @@ public class Controller extends ActorClassBase {
//--------------------- optional actors
//--------------------- interface item IDs
- public static final int IFITEM_worker = 1;
+ public static final int IFITEM_wrk = 1;
public static final int IFITEM_opt = 2;
/*--------------------- attributes ---------------------*/
@@ -44,7 +45,7 @@ public class Controller extends ActorClassBase {
// initialize attributes
// own ports
- worker = new PWorkerConjPort(this, "worker", IFITEM_worker);
+ wrk = new PWorkerConjPort(this, "wrk", IFITEM_wrk);
opt = new PCConjPort(this, "opt", IFITEM_opt);
// own saps
@@ -54,6 +55,11 @@ public class Controller extends ActorClassBase {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "worker");
new Worker(this, "worker");
+
+ // wiring
+ InterfaceItemBase.connect(this, "worker/fct", "wrk");
+ InterfaceItemBase.connect(this, "worker/opt/p0", "opt");
+
}
@@ -61,8 +67,8 @@ public class Controller extends ActorClassBase {
//--------------------- port getters
- public PWorkerConjPort getWorker (){
- return this.worker;
+ public PWorkerConjPort getWrk (){
+ return this.wrk;
}
public PCConjPort getOpt (){
return this.opt;
@@ -89,44 +95,45 @@ public class Controller extends ActorClassBase {
/* transition chains */
public static final int CHAIN_TRANS_INITIAL_TO__createOpt1 = 1;
- public static final int CHAIN_TRANS_tr0_FROM_createOpt1_TO_SendHello_BY_okworker = 2;
+ public static final int CHAIN_TRANS_tr0_FROM_createOpt1_TO_SendHello_BY_okwrk = 2;
public static final int CHAIN_TRANS_tr1_FROM_SendHello_TO_TryCreateInvalid_BY_helloopt = 3;
- public static final int CHAIN_TRANS_tr2_FROM_createOpt1_TO_UnexpectedError_BY_errorworker = 4;
- public static final int CHAIN_TRANS_tr3_FROM_TryCreateInvalid_TO_ExpectedError_BY_errorworker = 5;
+ public static final int CHAIN_TRANS_tr2_FROM_createOpt1_TO_UnexpectedError_BY_errorwrk = 4;
+ public static final int CHAIN_TRANS_tr3_FROM_TryCreateInvalid_TO_ExpectedError_BY_errorwrk = 5;
/* triggers */
public static final int POLLING = 0;
- public static final int TRIG_worker__ok = IFITEM_worker + EVT_SHIFT*PWorker.OUT_ok;
- public static final int TRIG_worker__error = IFITEM_worker + EVT_SHIFT*PWorker.OUT_error;
+ public static final int TRIG_wrk__ok = IFITEM_wrk + EVT_SHIFT*PWorker.OUT_ok;
+ public static final int TRIG_wrk__error = IFITEM_wrk + EVT_SHIFT*PWorker.OUT_error;
public static final int TRIG_opt__hello = IFITEM_opt + EVT_SHIFT*PC.OUT_hello;
// state names
- protected static final String stateStrings[] = {"<no state>","<top>","createOpt1",
- "SendHello",
- "TryCreateInvalid",
- "UnexpectedError",
- "ExpectedError"
+ protected static final String stateStrings[] = {
+ "<no state>",
+ "<top>",
+ "createOpt1",
+ "SendHello",
+ "TryCreateInvalid",
+ "UnexpectedError",
+ "ExpectedError"
};
-
+
// history
- protected int history[] = {NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE};
+ protected int history[] = {NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE};
private void setState(int new_state) {
DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
- if (stateStrings[new_state]!="Idle") {
- }
this.state = new_state;
}
/* Entry and Exit Codes */
protected void entry_createOpt1() {
- worker.create("Optional1");
+ wrk.create("Optional1");
}
protected void entry_SendHello() {
opt.sayHello();
}
protected void entry_TryCreateInvalid() {
- worker.create("Optional");
+ wrk.create("Optional");
}
protected void entry_ExpectedError() {
System.out.println("Done, enter 'quit' to exit");
@@ -186,7 +193,7 @@ public class Controller extends ActorClassBase {
{
return STATE_createOpt1;
}
- case CHAIN_TRANS_tr0_FROM_createOpt1_TO_SendHello_BY_okworker:
+ case CHAIN_TRANS_tr0_FROM_createOpt1_TO_SendHello_BY_okwrk:
{
return STATE_SendHello;
}
@@ -196,11 +203,11 @@ public class Controller extends ActorClassBase {
action_TRANS_tr1_FROM_SendHello_TO_TryCreateInvalid_BY_helloopt(ifitem, txt);
return STATE_TryCreateInvalid;
}
- case CHAIN_TRANS_tr2_FROM_createOpt1_TO_UnexpectedError_BY_errorworker:
+ case CHAIN_TRANS_tr2_FROM_createOpt1_TO_UnexpectedError_BY_errorwrk:
{
return STATE_UnexpectedError;
}
- case CHAIN_TRANS_tr3_FROM_TryCreateInvalid_TO_ExpectedError_BY_errorworker:
+ case CHAIN_TRANS_tr3_FROM_TryCreateInvalid_TO_ExpectedError_BY_errorwrk:
{
return STATE_ExpectedError;
}
@@ -272,15 +279,15 @@ public class Controller extends ActorClassBase {
switch (getState()) {
case STATE_createOpt1:
switch(trigger) {
- case TRIG_worker__ok:
+ case TRIG_wrk__ok:
{
- chain = CHAIN_TRANS_tr0_FROM_createOpt1_TO_SendHello_BY_okworker;
+ chain = CHAIN_TRANS_tr0_FROM_createOpt1_TO_SendHello_BY_okwrk;
catching_state = STATE_TOP;
}
break;
- case TRIG_worker__error:
+ case TRIG_wrk__error:
{
- chain = CHAIN_TRANS_tr2_FROM_createOpt1_TO_UnexpectedError_BY_errorworker;
+ chain = CHAIN_TRANS_tr2_FROM_createOpt1_TO_UnexpectedError_BY_errorwrk;
catching_state = STATE_TOP;
}
break;
@@ -304,9 +311,9 @@ public class Controller extends ActorClassBase {
break;
case STATE_TryCreateInvalid:
switch(trigger) {
- case TRIG_worker__error:
+ case TRIG_wrk__error:
{
- chain = CHAIN_TRANS_tr3_FROM_TryCreateInvalid_TO_ExpectedError_BY_errorworker;
+ chain = CHAIN_TRANS_tr3_FROM_TryCreateInvalid_TO_ExpectedError_BY_errorwrk;
catching_state = STATE_TOP;
}
break;
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Node_nodeRef1_main.java b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Node_nodeRef1_main.java
index bf772ec6a..fd4d2a1da 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Node_nodeRef1_main.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Node_nodeRef1_main.java
@@ -8,10 +8,12 @@ import org.eclipse.etrice.runtime.java.messaging.MessageService;
import org.eclipse.etrice.runtime.java.messaging.MessageServiceController;
import org.eclipse.etrice.runtime.java.messaging.RTServices;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;
import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBroker;
@@ -43,17 +45,18 @@ public class Node_nodeRef1_main extends SubSystemClassBase {
addPathToThread("/LS/main/appl", THREAD_PHYSICALTHREAD1);
addPathToThread("/LS/main/appl/cont", THREAD_PHYSICALTHREAD1);
addPathToThread("/LS/main/appl/cont/worker", THREAD_PHYSICALTHREAD1);
-
- // port to peer port mappings
- addPathToPeers("/LS/main/appl/cont/worker", "/LS/main/appl/cont/worker/fct");
- addPathToPeers("/LS/main/appl/cont/opt", "/LS/main/appl/cont/worker/opt/p0");
- addPathToPeers("/LS/main/appl/cont/worker/fct", "/LS/main/appl/cont/worker");
- addPathToPeers("/LS/main/appl/cont/worker/opt/p0", "/LS/main/appl/cont/opt");
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "appl");
new Appl(this, "appl");
+ // create service brokers in optional actor interfaces
+ {
+ OptionalActorInterfaceBase oai = (OptionalActorInterfaceBase) getObject("/LS/main/appl/cont/worker/opt");
+ }
+
+ // wiring
+
// apply instance attribute configurations
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Optional.java b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Optional.java
index 02f13d1bd..7cc881fb3 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Optional.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Optional.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -45,6 +46,9 @@ public abstract class Optional extends ActorClassBase {
// own service implementations
// sub actors
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Optional1.java b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Optional1.java
index 147292367..da607cc3f 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Optional1.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Optional1.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -47,6 +48,9 @@ public class Optional1 extends Optional {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "sub1");
new AC1(this, "sub1");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Optional1Factory.java b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Optional1Factory.java
index beb5aff2b..332363a15 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Optional1Factory.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Optional1Factory.java
@@ -3,23 +3,16 @@ package org.eclipse.etrice.examples.dynamicactors4;
import org.eclipse.etrice.examples.dynamicactors4.Optional1;
import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;
import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;
-import org.eclipse.etrice.runtime.java.modelbase.PathToPeers;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
public class Optional1Factory implements IOptionalActorFactory {
- private PathToPeers path2peers = new PathToPeers();
-
public Optional1 create(OptionalActorInterfaceBase ai, String name) {
- // set port mappings of this sub tree
- path2peers.put("/sub1/p0", "/p0");
- path2peers.put("/sub1/hlp", "/sub1/helper/p0");
- path2peers.put("/sub1/helper/p0", "/sub1/hlp");
- ai.setPath2peers(path2peers);
-
// instantiate sub tree
Optional1 actor = new Optional1(ai, name);
- ai.setPath2peers(null);
+ // wiring
+ InterfaceItemBase.connect(ai, "p0", name+"/sub1/p0");
return actor;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Optional2.java b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Optional2.java
index b2d29816f..8cb3d48f2 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Optional2.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Optional2.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -47,6 +48,9 @@ public class Optional2 extends Optional {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "sub2");
new AC2(this, "sub2");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Optional2Factory.java b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Optional2Factory.java
index d26235952..c525dd005 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Optional2Factory.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Optional2Factory.java
@@ -3,21 +3,16 @@ package org.eclipse.etrice.examples.dynamicactors4;
import org.eclipse.etrice.examples.dynamicactors4.Optional2;
import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;
import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;
-import org.eclipse.etrice.runtime.java.modelbase.PathToPeers;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
public class Optional2Factory implements IOptionalActorFactory {
- private PathToPeers path2peers = new PathToPeers();
-
public Optional2 create(OptionalActorInterfaceBase ai, String name) {
- // set port mappings of this sub tree
- path2peers.put("/sub2/deep_sub/p0", "/p0");
- ai.setPath2peers(path2peers);
-
// instantiate sub tree
Optional2 actor = new Optional2(ai, name);
- ai.setPath2peers(null);
+ // wiring
+ InterfaceItemBase.connect(ai, "p0", name+"/sub2/deep_sub/p0");
return actor;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/OptionalInterface.java b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/OptionalInterface.java
index 1ea388bdc..6cfea74fd 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/OptionalInterface.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/OptionalInterface.java
@@ -20,12 +20,12 @@ class OptionalInterface extends ScalarOptionalActorInterfaceBase {
}
@Override
- protected void logCreation(String actorClass, String name) {
+ protected void logCreation(String actorClass, String name) {
DebuggingService.getInstance().addMessageActorCreate(this, actorClass, name);
}
@Override
- protected void logDeletion(String name) {
+ protected void logDeletion(String name) {
DebuggingService.getInstance().addMessageActorDestroy(this, name);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/OptionalReplicatedInterface.java b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/OptionalReplicatedInterface.java
index 51c8a2168..8b0052890 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/OptionalReplicatedInterface.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/OptionalReplicatedInterface.java
@@ -20,12 +20,12 @@ class OptionalReplicatedInterface extends ReplicatedOptionalActorInterfaceBase {
}
@Override
- protected void logCreation(String actorClass, String name) {
+ protected void logCreation(String actorClass, String name) {
DebuggingService.getInstance().addMessageActorCreate(this, actorClass, name);
}
@Override
- protected void logDeletion(String name) {
+ protected void logDeletion(String name) {
DebuggingService.getInstance().addMessageActorDestroy(this, name);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/PC.java b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/PC.java
index 285bc44b9..ff340449e 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/PC.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/PC.java
@@ -58,10 +58,10 @@ public class PC {
if (messageStrings[msg.getEvtId()] != "timerTick"){
DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
}
- if (msg instanceof EventWithDataMessage)
- getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
- else
- getActor().receiveEvent(this, msg.getEvtId(), null);
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
}
}
@@ -133,10 +133,10 @@ public class PC {
if (messageStrings[msg.getEvtId()] != "timerTick"){
DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
}
- if (msg instanceof EventWithDataMessage)
- getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
- else
- getActor().receiveEvent(this, msg.getEvtId(), null);
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/PWorker.java b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/PWorker.java
index 6bd531e9c..ed3a2c119 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/PWorker.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/PWorker.java
@@ -59,10 +59,10 @@ public class PWorker {
if (messageStrings[msg.getEvtId()] != "timerTick"){
DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
}
- if (msg instanceof EventWithDataMessage)
- getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
- else
- getActor().receiveEvent(this, msg.getEvtId(), null);
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
}
}
@@ -146,10 +146,10 @@ public class PWorker {
if (messageStrings[msg.getEvtId()] != "timerTick"){
DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
}
- if (msg instanceof EventWithDataMessage)
- getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
- else
- getActor().receiveEvent(this, msg.getEvtId(), null);
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Worker.java b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Worker.java
index 5a139626a..8cb38590a 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Worker.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors4/src-gen/org/eclipse/etrice/examples/dynamicactors4/Worker.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -56,6 +57,9 @@ public class Worker extends ActorClassBase {
// sub actors
opt = new OptionalInterface(this, "opt");
+
+ // wiring
+
}
@@ -91,16 +95,17 @@ public class Worker extends ActorClassBase {
public static final int TRIG_fct__create = IFITEM_fct + EVT_SHIFT*PWorker.IN_create;
// state names
- protected static final String stateStrings[] = {"<no state>","<top>","Ready"
+ protected static final String stateStrings[] = {
+ "<no state>",
+ "<top>",
+ "Ready"
};
-
+
// history
- protected int history[] = {NO_STATE,NO_STATE,NO_STATE};
+ protected int history[] = {NO_STATE, NO_STATE, NO_STATE};
private void setState(int new_state) {
DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
- if (stateStrings[new_state]!="Idle") {
- }
this.state = new_state;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/Appl.java b/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/Appl.java
index 221aaa402..c6a8d7ef9 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/Appl.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/Appl.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -47,6 +48,9 @@ public class Appl extends ActorClassBase {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "cont");
new Container(this, "cont");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/Container.java b/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/Container.java
index fb38dfbf0..ba7f06c05 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/Container.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/Container.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -55,6 +56,10 @@ public class Container extends ActorClassBase {
// sub actors
opt = new OptionalInterface(this, "opt");
+
+ // wiring
+ InterfaceItemBase.connect(this, "opt/p0", "p0");
+
}
@@ -91,17 +96,18 @@ public class Container extends ActorClassBase {
public static final int TRIG_p0__hello = IFITEM_p0 + EVT_SHIFT*PC.OUT_hello;
// state names
- protected static final String stateStrings[] = {"<no state>","<top>","CreateOptional",
- "Done"
+ protected static final String stateStrings[] = {
+ "<no state>",
+ "<top>",
+ "CreateOptional",
+ "Done"
};
-
+
// history
- protected int history[] = {NO_STATE,NO_STATE,NO_STATE,NO_STATE};
+ protected int history[] = {NO_STATE, NO_STATE, NO_STATE, NO_STATE};
private void setState(int new_state) {
DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
- if (stateStrings[new_state]!="Idle") {
- }
this.state = new_state;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/Node_nodeRef1_main.java b/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/Node_nodeRef1_main.java
index 06dbb22e1..ef98cea7b 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/Node_nodeRef1_main.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/Node_nodeRef1_main.java
@@ -8,10 +8,12 @@ import org.eclipse.etrice.runtime.java.messaging.MessageService;
import org.eclipse.etrice.runtime.java.messaging.MessageServiceController;
import org.eclipse.etrice.runtime.java.messaging.RTServices;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;
import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBroker;
@@ -42,15 +44,18 @@ public class Node_nodeRef1_main extends SubSystemClassBase {
// thread mappings
addPathToThread("/LS/main/appl", THREAD_PHYSICALTHREAD1);
addPathToThread("/LS/main/appl/cont", THREAD_PHYSICALTHREAD1);
-
- // port to peer port mappings
- addPathToPeers("/LS/main/appl/cont/p0", "/LS/main/appl/cont/opt/p0");
- addPathToPeers("/LS/main/appl/cont/opt/p0", "/LS/main/appl/cont/p0");
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "appl");
new Appl(this, "appl");
+ // create service brokers in optional actor interfaces
+ {
+ OptionalActorInterfaceBase oai = (OptionalActorInterfaceBase) getObject("/LS/main/appl/cont/opt");
+ }
+
+ // wiring
+
// apply instance attribute configurations
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/Optional.java b/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/Optional.java
index 6cc291d2f..f951a6b30 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/Optional.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/Optional.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -48,6 +49,9 @@ public class Optional extends ActorClassBase {
// own service implementations
// sub actors
+
+ // wiring
+
}
@@ -83,16 +87,17 @@ public class Optional extends ActorClassBase {
public static final int TRIG_p0__sayHello = IFITEM_p0 + EVT_SHIFT*PC.IN_sayHello;
// state names
- protected static final String stateStrings[] = {"<no state>","<top>","Ready"
+ protected static final String stateStrings[] = {
+ "<no state>",
+ "<top>",
+ "Ready"
};
-
+
// history
- protected int history[] = {NO_STATE,NO_STATE,NO_STATE};
+ protected int history[] = {NO_STATE, NO_STATE, NO_STATE};
private void setState(int new_state) {
DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
- if (stateStrings[new_state]!="Idle") {
- }
this.state = new_state;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/OptionalFactory.java b/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/OptionalFactory.java
index ac40afd03..7e8084444 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/OptionalFactory.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/OptionalFactory.java
@@ -3,20 +3,16 @@ package org.eclipse.etrice.examples.dynamicactors5;
import org.eclipse.etrice.examples.dynamicactors5.Optional;
import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;
import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;
-import org.eclipse.etrice.runtime.java.modelbase.PathToPeers;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
public class OptionalFactory implements IOptionalActorFactory {
- private PathToPeers path2peers = new PathToPeers();
-
public Optional create(OptionalActorInterfaceBase ai, String name) {
- // set port mappings of this sub tree
- ai.setPath2peers(path2peers);
-
// instantiate sub tree
Optional actor = new Optional(ai, name);
- ai.setPath2peers(null);
+ // wiring
+ InterfaceItemBase.connect(ai, "p0", name+"/p0");
return actor;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/OptionalInterface.java b/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/OptionalInterface.java
index 7fb4675c6..ae27855bb 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/OptionalInterface.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/OptionalInterface.java
@@ -20,12 +20,12 @@ class OptionalInterface extends ScalarOptionalActorInterfaceBase {
}
@Override
- protected void logCreation(String actorClass, String name) {
+ protected void logCreation(String actorClass, String name) {
DebuggingService.getInstance().addMessageActorCreate(this, actorClass, name);
}
@Override
- protected void logDeletion(String name) {
+ protected void logDeletion(String name) {
DebuggingService.getInstance().addMessageActorDestroy(this, name);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/OptionalReplicatedInterface.java b/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/OptionalReplicatedInterface.java
index c45c1ffbb..ad0e5aa42 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/OptionalReplicatedInterface.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/OptionalReplicatedInterface.java
@@ -20,12 +20,12 @@ class OptionalReplicatedInterface extends ReplicatedOptionalActorInterfaceBase {
}
@Override
- protected void logCreation(String actorClass, String name) {
+ protected void logCreation(String actorClass, String name) {
DebuggingService.getInstance().addMessageActorCreate(this, actorClass, name);
}
@Override
- protected void logDeletion(String name) {
+ protected void logDeletion(String name) {
DebuggingService.getInstance().addMessageActorDestroy(this, name);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/PC.java b/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/PC.java
index 2f81505f5..5b2942c74 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/PC.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors5/src-gen/org/eclipse/etrice/examples/dynamicactors5/PC.java
@@ -58,10 +58,10 @@ public class PC {
if (messageStrings[msg.getEvtId()] != "timerTick"){
DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
}
- if (msg instanceof EventWithDataMessage)
- getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
- else
- getActor().receiveEvent(this, msg.getEvtId(), null);
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
}
}
@@ -133,10 +133,10 @@ public class PC {
if (messageStrings[msg.getEvtId()] != "timerTick"){
DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
}
- if (msg instanceof EventWithDataMessage)
- getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
- else
- getActor().receiveEvent(this, msg.getEvtId(), null);
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors6/genmodel.egm b/examples/org.eclipse.etrice.examples.dynamicactors6/genmodel.egm
index 337c652ab..5148d14dd 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors6/genmodel.egm
+++ b/examples/org.eclipse.etrice.examples.dynamicactors6/genmodel.egm
@@ -7,7 +7,7 @@
<ports name="p0" objId="3" peers="//@systemInstances.0/@instances.0/@instances.0/@instances.0/@instances.0/@ports.0" kind="internal" bindings="//@systemInstances.0/@instances.0/@instances.0/@instances.0/@bindings.0">
<port href="model/DynAct6.room#Port:Container$p0"/>
</ports>
- <instances xsi:type="etricegen:ActorInterfaceInstance" name="opt" optionalInstances="//@optionalInstances.0">
+ <instances xsi:type="etricegen:ActorInterfaceInstance" name="opt" optionalInstances="//@optionalInstances.1">
<ports name="p0" objId="4" peers="//@systemInstances.0/@instances.0/@instances.0/@instances.0/@ports.0" kind="interface" bindings="//@systemInstances.0/@instances.0/@instances.0/@instances.0/@bindings.0">
<port href="model/DynAct6.room#Port:Optional2$p0"/>
</ports>
@@ -104,54 +104,106 @@
<actorClass href="model/DynAct6.room#ActorClass:Optional2"/>
<stateMachine/>
</xpActorClasses>
+ <optionalInstances name="Optional1">
+ <ports name="p0" objId="5" peers="//@optionalInstances.0/@instances.0/@ports.0" kind="interface" bindings="//@optionalInstances.0/@bindings.0">
+ <port href="model/DynAct6.room#Port:Optional1$p0"/>
+ </ports>
+ <instances xsi:type="etricegen:ActorInstance" name="sub1" objId="6">
+ <ports name="p0" objId="7" peers="//@optionalInstances.0/@ports.0" bindings="//@optionalInstances.0/@bindings.0">
+ <port href="model/DynAct6.room#Port:AC1$p0"/>
+ </ports>
+ <actorClass href="model/DynAct6.room#ActorClass:AC1"/>
+ </instances>
+ <bindings ports="//@optionalInstances.0/@ports.0 //@optionalInstances.0/@instances.0/@ports.0">
+ <binding href="model/DynAct6.room#Binding:Optional1$p0!.-p0!sub1"/>
+ </bindings>
+ <actorClass href="model/DynAct6.room#ActorClass:Optional1"/>
+ </optionalInstances>
<optionalInstances name="Optional2">
- <ports name="p0" objId="5" peers="//@optionalInstances.0/@instances.0/@instances.0/@instances.0/@ports.0" kind="interface" bindings="//@optionalInstances.0/@bindings.0">
+ <ports name="p0" objId="8" peers="//@optionalInstances.1/@instances.0/@instances.0/@instances.0/@ports.0" kind="interface" bindings="//@optionalInstances.1/@bindings.0">
<port href="model/DynAct6.room#Port:Optional2$p0"/>
</ports>
- <instances xsi:type="etricegen:ActorInstance" name="sub2" objId="6">
- <ports name="p0" kind="relay" bindings="//@optionalInstances.0/@instances.0/@bindings.0 //@optionalInstances.0/@bindings.0">
+ <instances xsi:type="etricegen:ActorInstance" name="sub2" objId="9">
+ <ports name="p0" kind="relay" bindings="//@optionalInstances.1/@instances.0/@bindings.0 //@optionalInstances.1/@bindings.0">
<port href="model/DynAct6.room#Port:AC2$p0"/>
</ports>
- <instances xsi:type="etricegen:ActorInstance" name="deep_sub" objId="7">
- <ports name="p0" kind="relay" bindings="//@optionalInstances.0/@instances.0/@instances.0/@bindings.0 //@optionalInstances.0/@instances.0/@bindings.0">
+ <instances xsi:type="etricegen:ActorInstance" name="deep_sub" objId="10">
+ <ports name="p0" kind="relay" bindings="//@optionalInstances.1/@instances.0/@instances.0/@bindings.0 //@optionalInstances.1/@instances.0/@bindings.0">
<port href="model/DynAct6.room#Port:AC3$p0"/>
</ports>
<instances xsi:type="etricegen:ActorInterfaceInstance" name="nestedOpt">
- <ports name="p0" objId="8" peers="//@optionalInstances.0/@ports.0" kind="interface" bindings="//@optionalInstances.0/@instances.0/@instances.0/@bindings.0">
+ <ports name="p0" objId="11" peers="//@optionalInstances.1/@ports.0" kind="interface" bindings="//@optionalInstances.1/@instances.0/@instances.0/@bindings.0">
<port href="model/DynAct6.room#Port:Optional1$p0"/>
</ports>
<actorClass href="model/DynAct6.room#ActorClass:Optional1"/>
</instances>
- <bindings ports="//@optionalInstances.0/@instances.0/@instances.0/@ports.0 //@optionalInstances.0/@instances.0/@instances.0/@instances.0/@ports.0">
+ <bindings ports="//@optionalInstances.1/@instances.0/@instances.0/@ports.0 //@optionalInstances.1/@instances.0/@instances.0/@instances.0/@ports.0">
<binding href="model/DynAct6.room#Binding:AC3$p0!.-p0!nestedOpt"/>
</bindings>
<actorClass href="model/DynAct6.room#ActorClass:AC3"/>
</instances>
- <bindings ports="//@optionalInstances.0/@instances.0/@ports.0 //@optionalInstances.0/@instances.0/@instances.0/@ports.0">
+ <bindings ports="//@optionalInstances.1/@instances.0/@ports.0 //@optionalInstances.1/@instances.0/@instances.0/@ports.0">
<binding href="model/DynAct6.room#Binding:AC2$p0!.-p0!deep_sub"/>
</bindings>
<actorClass href="model/DynAct6.room#ActorClass:AC2"/>
</instances>
- <bindings ports="//@optionalInstances.0/@ports.0 //@optionalInstances.0/@instances.0/@ports.0">
+ <bindings ports="//@optionalInstances.1/@ports.0 //@optionalInstances.1/@instances.0/@ports.0">
<binding href="model/DynAct6.room#Binding:Optional2$p0!.-p0!sub2"/>
</bindings>
<actorClass href="model/DynAct6.room#ActorClass:Optional2"/>
</optionalInstances>
- <optionalInstances name="Optional1">
- <ports name="p0" objId="9" peers="//@optionalInstances.1/@instances.0/@ports.0" kind="interface" bindings="//@optionalInstances.1/@bindings.0">
+ <optionalActorClasses href="model/DynAct6.room#ActorClass:Optional1"/>
+ <optionalActorClasses href="model/DynAct6.room#ActorClass:Optional2"/>
+ <wiredInstances xsi:type="etricegen:WiredActorClass">
+ <actorClass href="model/DynAct6.room#ActorClass:AC1"/>
+ </wiredInstances>
+ <wiredInstances xsi:type="etricegen:WiredActorClass">
+ <openBindings>
+ <path>nestedOpt</path>
+ <path>p0</path>
+ <port href="model/DynAct6.room#Port:AC3$p0"/>
+ </openBindings>
+ <actorClass href="model/DynAct6.room#ActorClass:AC3"/>
+ </wiredInstances>
+ <wiredInstances xsi:type="etricegen:WiredActorClass">
+ <openBindings>
+ <path>deep_sub</path>
+ <path>nestedOpt</path>
+ <path>p0</path>
+ <port href="model/DynAct6.room#Port:AC2$p0"/>
+ </openBindings>
+ <actorClass href="model/DynAct6.room#ActorClass:AC2"/>
+ </wiredInstances>
+ <wiredInstances xsi:type="etricegen:WiredActorClass">
+ <wires>
+ <path1>opt</path1>
+ <path1>p0</path1>
+ <path2>p0</path2>
+ </wires>
+ <actorClass href="model/DynAct6.room#ActorClass:Container"/>
+ </wiredInstances>
+ <wiredInstances xsi:type="etricegen:WiredActorClass">
+ <actorClass href="model/DynAct6.room#ActorClass:Appl"/>
+ </wiredInstances>
+ <wiredInstances xsi:type="etricegen:WiredActorClass">
+ <openBindings>
+ <path>sub1</path>
+ <path>p0</path>
<port href="model/DynAct6.room#Port:Optional1$p0"/>
- </ports>
- <instances xsi:type="etricegen:ActorInstance" name="sub1" objId="10">
- <ports name="p0" objId="11" peers="//@optionalInstances.1/@ports.0" bindings="//@optionalInstances.1/@bindings.0">
- <port href="model/DynAct6.room#Port:AC1$p0"/>
- </ports>
- <actorClass href="model/DynAct6.room#ActorClass:AC1"/>
- </instances>
- <bindings ports="//@optionalInstances.1/@ports.0 //@optionalInstances.1/@instances.0/@ports.0">
- <binding href="model/DynAct6.room#Binding:Optional1$p0!.-p0!sub1"/>
- </bindings>
+ </openBindings>
<actorClass href="model/DynAct6.room#ActorClass:Optional1"/>
- </optionalInstances>
- <optionalActorClasses href="model/DynAct6.room#ActorClass:Optional2"/>
- <optionalActorClasses href="model/DynAct6.room#ActorClass:Optional1"/>
+ </wiredInstances>
+ <wiredInstances xsi:type="etricegen:WiredActorClass">
+ <openBindings>
+ <path>sub2</path>
+ <path>deep_sub</path>
+ <path>nestedOpt</path>
+ <path>p0</path>
+ <port href="model/DynAct6.room#Port:Optional2$p0"/>
+ </openBindings>
+ <actorClass href="model/DynAct6.room#ActorClass:Optional2"/>
+ </wiredInstances>
+ <wiredInstances xsi:type="etricegen:WiredSubSystemClass">
+ <subSystemClass href="model/DynAct6.room#SubSystemClass:Main"/>
+ </wiredInstances>
</etricegen:Root>
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/AC1.java b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/AC1.java
index 669356df6..a633144af 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/AC1.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/AC1.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -48,6 +49,9 @@ public class AC1 extends ActorClassBase {
// own service implementations
// sub actors
+
+ // wiring
+
}
@@ -82,16 +86,17 @@ public class AC1 extends ActorClassBase {
public static final int TRIG_p0__sayHello = IFITEM_p0 + EVT_SHIFT*PC.IN_sayHello;
// state names
- protected static final String stateStrings[] = {"<no state>","<top>","Ready"
+ protected static final String stateStrings[] = {
+ "<no state>",
+ "<top>",
+ "Ready"
};
-
+
// history
- protected int history[] = {NO_STATE,NO_STATE,NO_STATE};
+ protected int history[] = {NO_STATE, NO_STATE, NO_STATE};
private void setState(int new_state) {
DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
- if (stateStrings[new_state]!="Idle") {
- }
this.state = new_state;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/AC2.java b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/AC2.java
index 51c97f3ce..31af6b63a 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/AC2.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/AC2.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -47,6 +48,9 @@ public class AC2 extends ActorClassBase {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "deep_sub");
new AC3(this, "deep_sub");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/AC3.java b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/AC3.java
index f6f5d9e7a..fc7385617 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/AC3.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/AC3.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -48,6 +49,9 @@ public class AC3 extends ActorClassBase {
// sub actors
nestedOpt = new Optional1Interface(this, "nestedOpt");
+
+ // wiring
+
}
@@ -78,16 +82,17 @@ public class AC3 extends ActorClassBase {
public static final int POLLING = 0;
// state names
- protected static final String stateStrings[] = {"<no state>","<top>","Ready"
+ protected static final String stateStrings[] = {
+ "<no state>",
+ "<top>",
+ "Ready"
};
-
+
// history
- protected int history[] = {NO_STATE,NO_STATE,NO_STATE};
+ protected int history[] = {NO_STATE, NO_STATE, NO_STATE};
private void setState(int new_state) {
DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
- if (stateStrings[new_state]!="Idle") {
- }
this.state = new_state;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Appl.java b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Appl.java
index 3e24bbf29..a0c19def7 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Appl.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Appl.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -47,6 +48,9 @@ public class Appl extends ActorClassBase {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "cont");
new Container(this, "cont");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Container.java b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Container.java
index 4263802dd..62d427420 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Container.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Container.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -55,6 +56,10 @@ public class Container extends ActorClassBase {
// sub actors
opt = new Optional2Interface(this, "opt");
+
+ // wiring
+ InterfaceItemBase.connect(this, "opt/p0", "p0");
+
}
@@ -91,17 +96,18 @@ public class Container extends ActorClassBase {
public static final int TRIG_p0__hello = IFITEM_p0 + EVT_SHIFT*PC.OUT_hello;
// state names
- protected static final String stateStrings[] = {"<no state>","<top>","CreateOptional2",
- "Done"
+ protected static final String stateStrings[] = {
+ "<no state>",
+ "<top>",
+ "CreateOptional2",
+ "Done"
};
-
+
// history
- protected int history[] = {NO_STATE,NO_STATE,NO_STATE,NO_STATE};
+ protected int history[] = {NO_STATE, NO_STATE, NO_STATE, NO_STATE};
private void setState(int new_state) {
DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
- if (stateStrings[new_state]!="Idle") {
- }
this.state = new_state;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Node_nodeRef1_main.java b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Node_nodeRef1_main.java
index d83ba8611..c67f6772e 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Node_nodeRef1_main.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Node_nodeRef1_main.java
@@ -8,10 +8,12 @@ import org.eclipse.etrice.runtime.java.messaging.MessageService;
import org.eclipse.etrice.runtime.java.messaging.MessageServiceController;
import org.eclipse.etrice.runtime.java.messaging.RTServices;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;
import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBroker;
@@ -42,15 +44,18 @@ public class Node_nodeRef1_main extends SubSystemClassBase {
// thread mappings
addPathToThread("/LS/main/appl", THREAD_PHYSICALTHREAD1);
addPathToThread("/LS/main/appl/cont", THREAD_PHYSICALTHREAD1);
-
- // port to peer port mappings
- addPathToPeers("/LS/main/appl/cont/p0", "/LS/main/appl/cont/opt/p0");
- addPathToPeers("/LS/main/appl/cont/opt/p0", "/LS/main/appl/cont/p0");
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "appl");
new Appl(this, "appl");
+ // create service brokers in optional actor interfaces
+ {
+ OptionalActorInterfaceBase oai = (OptionalActorInterfaceBase) getObject("/LS/main/appl/cont/opt");
+ }
+
+ // wiring
+
// apply instance attribute configurations
}
@@ -74,16 +79,16 @@ public class Node_nodeRef1_main extends SubSystemClassBase {
}
public IOptionalActorFactory getFactory(String optionalActorClass, String actorClass) {
- if (optionalActorClass.equals("Optional2")) {
- if ("Optional2".equals(actorClass)) {
- return new Optional2Factory();
- }
- }
- else if (optionalActorClass.equals("Optional1")) {
+ if (optionalActorClass.equals("Optional1")) {
if ("Optional1".equals(actorClass)) {
return new Optional1Factory();
}
}
+ else if (optionalActorClass.equals("Optional2")) {
+ if ("Optional2".equals(actorClass)) {
+ return new Optional2Factory();
+ }
+ }
return null;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional1.java b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional1.java
index df999c94e..cfceaf3a3 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional1.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional1.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -47,6 +48,9 @@ public class Optional1 extends ActorClassBase {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "sub1");
new AC1(this, "sub1");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional1Factory.java b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional1Factory.java
index 04b06e178..b39edfa85 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional1Factory.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional1Factory.java
@@ -3,21 +3,16 @@ package org.eclipse.etrice.examples.dynamicactors6;
import org.eclipse.etrice.examples.dynamicactors6.Optional1;
import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;
import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;
-import org.eclipse.etrice.runtime.java.modelbase.PathToPeers;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
public class Optional1Factory implements IOptionalActorFactory {
- private PathToPeers path2peers = new PathToPeers();
-
public Optional1 create(OptionalActorInterfaceBase ai, String name) {
- // set port mappings of this sub tree
- path2peers.put("/sub1/p0", "/p0");
- ai.setPath2peers(path2peers);
-
// instantiate sub tree
Optional1 actor = new Optional1(ai, name);
- ai.setPath2peers(null);
+ // wiring
+ InterfaceItemBase.connect(ai, "p0", name+"/sub1/p0");
return actor;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional1Interface.java b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional1Interface.java
index e0557ac4a..157bd0893 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional1Interface.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional1Interface.java
@@ -20,12 +20,12 @@ class Optional1Interface extends ScalarOptionalActorInterfaceBase {
}
@Override
- protected void logCreation(String actorClass, String name) {
+ protected void logCreation(String actorClass, String name) {
DebuggingService.getInstance().addMessageActorCreate(this, actorClass, name);
}
@Override
- protected void logDeletion(String name) {
+ protected void logDeletion(String name) {
DebuggingService.getInstance().addMessageActorDestroy(this, name);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional1ReplicatedInterface.java b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional1ReplicatedInterface.java
index 51669a9a5..a78e90a66 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional1ReplicatedInterface.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional1ReplicatedInterface.java
@@ -20,12 +20,12 @@ class Optional1ReplicatedInterface extends ReplicatedOptionalActorInterfaceBase
}
@Override
- protected void logCreation(String actorClass, String name) {
+ protected void logCreation(String actorClass, String name) {
DebuggingService.getInstance().addMessageActorCreate(this, actorClass, name);
}
@Override
- protected void logDeletion(String name) {
+ protected void logDeletion(String name) {
DebuggingService.getInstance().addMessageActorDestroy(this, name);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional2.java b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional2.java
index 6615bca61..878dd0da0 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional2.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional2.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -47,6 +48,9 @@ public class Optional2 extends ActorClassBase {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "sub2");
new AC2(this, "sub2");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional2Factory.java b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional2Factory.java
index 0311055d0..e8f5b3fcd 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional2Factory.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional2Factory.java
@@ -3,21 +3,16 @@ package org.eclipse.etrice.examples.dynamicactors6;
import org.eclipse.etrice.examples.dynamicactors6.Optional2;
import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;
import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;
-import org.eclipse.etrice.runtime.java.modelbase.PathToPeers;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
public class Optional2Factory implements IOptionalActorFactory {
- private PathToPeers path2peers = new PathToPeers();
-
public Optional2 create(OptionalActorInterfaceBase ai, String name) {
- // set port mappings of this sub tree
- path2peers.put("/sub2/deep_sub/nestedOpt/p0", "/p0");
- ai.setPath2peers(path2peers);
-
// instantiate sub tree
Optional2 actor = new Optional2(ai, name);
- ai.setPath2peers(null);
+ // wiring
+ InterfaceItemBase.connect(ai, "p0", name+"/sub2/deep_sub/nestedOpt/p0");
return actor;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional2Interface.java b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional2Interface.java
index 3ddd34b2c..7b38edee3 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional2Interface.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional2Interface.java
@@ -20,12 +20,12 @@ class Optional2Interface extends ScalarOptionalActorInterfaceBase {
}
@Override
- protected void logCreation(String actorClass, String name) {
+ protected void logCreation(String actorClass, String name) {
DebuggingService.getInstance().addMessageActorCreate(this, actorClass, name);
}
@Override
- protected void logDeletion(String name) {
+ protected void logDeletion(String name) {
DebuggingService.getInstance().addMessageActorDestroy(this, name);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional2ReplicatedInterface.java b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional2ReplicatedInterface.java
index 2f547db99..a163fc77c 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional2ReplicatedInterface.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/Optional2ReplicatedInterface.java
@@ -20,12 +20,12 @@ class Optional2ReplicatedInterface extends ReplicatedOptionalActorInterfaceBase
}
@Override
- protected void logCreation(String actorClass, String name) {
+ protected void logCreation(String actorClass, String name) {
DebuggingService.getInstance().addMessageActorCreate(this, actorClass, name);
}
@Override
- protected void logDeletion(String name) {
+ protected void logDeletion(String name) {
DebuggingService.getInstance().addMessageActorDestroy(this, name);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/PC.java b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/PC.java
index 47f6b0939..f62179066 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/PC.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors6/src-gen/org/eclipse/etrice/examples/dynamicactors6/PC.java
@@ -58,10 +58,10 @@ public class PC {
if (messageStrings[msg.getEvtId()] != "timerTick"){
DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
}
- if (msg instanceof EventWithDataMessage)
- getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
- else
- getActor().receiveEvent(this, msg.getEvtId(), null);
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
}
}
@@ -133,10 +133,10 @@ public class PC {
if (messageStrings[msg.getEvtId()] != "timerTick"){
DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
}
- if (msg instanceof EventWithDataMessage)
- getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
- else
- getActor().receiveEvent(this, msg.getEvtId(), null);
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/AC1.java b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/AC1.java
index 9527dfb4c..cb89d956e 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/AC1.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/AC1.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -51,6 +52,9 @@ public class AC1 extends ActorClassBase {
// own service implementations
// sub actors
+
+ // wiring
+
}
@@ -90,16 +94,17 @@ public class AC1 extends ActorClassBase {
public static final int TRIG_pin__sayHello = IFITEM_pin + EVT_SHIFT*PC.IN_sayHello;
// state names
- protected static final String stateStrings[] = {"<no state>","<top>","Ready"
+ protected static final String stateStrings[] = {
+ "<no state>",
+ "<top>",
+ "Ready"
};
-
+
// history
- protected int history[] = {NO_STATE,NO_STATE,NO_STATE};
+ protected int history[] = {NO_STATE, NO_STATE, NO_STATE};
private void setState(int new_state) {
DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
- if (stateStrings[new_state]!="Idle") {
- }
this.state = new_state;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/AC2.java b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/AC2.java
index 42c2419fc..0415903cb 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/AC2.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/AC2.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -51,6 +52,9 @@ public class AC2 extends ActorClassBase {
// own service implementations
// sub actors
+
+ // wiring
+
}
@@ -90,16 +94,17 @@ public class AC2 extends ActorClassBase {
public static final int TRIG_pin__hello = IFITEM_pin + EVT_SHIFT*PC.OUT_hello;
// state names
- protected static final String stateStrings[] = {"<no state>","<top>","Ready"
+ protected static final String stateStrings[] = {
+ "<no state>",
+ "<top>",
+ "Ready"
};
-
+
// history
- protected int history[] = {NO_STATE,NO_STATE,NO_STATE};
+ protected int history[] = {NO_STATE, NO_STATE, NO_STATE};
private void setState(int new_state) {
DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
- if (stateStrings[new_state]!="Idle") {
- }
this.state = new_state;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Appl.java b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Appl.java
index e55017b53..557964737 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Appl.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Appl.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -48,6 +49,9 @@ public class Appl extends ActorClassBase {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "ctrl");
new Controller(this, "ctrl");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Container.java b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Container.java
index 5d797d058..4c06772d0 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Container.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Container.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -59,6 +60,10 @@ public class Container extends ActorClassBase {
// sub actors
opt1 = new Optional1Interface(this, "opt1");
opt2 = new Optional2Interface(this, "opt2");
+
+ // wiring
+ InterfaceItemBase.connect(this, "opt1/pout", "opt2/pin");
+
}
@@ -96,16 +101,17 @@ public class Container extends ActorClassBase {
public static final int TRIG_fct__destroyOpts = IFITEM_fct + EVT_SHIFT*PCtrl.IN_destroyOpts;
// state names
- protected static final String stateStrings[] = {"<no state>","<top>","Ready"
+ protected static final String stateStrings[] = {
+ "<no state>",
+ "<top>",
+ "Ready"
};
-
+
// history
- protected int history[] = {NO_STATE,NO_STATE,NO_STATE};
+ protected int history[] = {NO_STATE, NO_STATE, NO_STATE};
private void setState(int new_state) {
DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
- if (stateStrings[new_state]!="Idle") {
- }
this.state = new_state;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Controller.java b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Controller.java
index 0659aaae5..7b22411ee 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Controller.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Controller.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -57,6 +58,12 @@ public class Controller extends ActorClassBase {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "cont");
new Container(this, "cont");
+
+ // wiring
+ InterfaceItemBase.connect(this, "cont/fct", "pcont");
+ InterfaceItemBase.connect(this, "cont/opt1/pin", "pout");
+ InterfaceItemBase.connect(this, "cont/opt2/pout", "pin");
+
}
@@ -109,21 +116,22 @@ public class Controller extends ActorClassBase {
public static final int TRIG_pin__hello = IFITEM_pin + EVT_SHIFT*PC.OUT_hello;
// state names
- protected static final String stateStrings[] = {"<no state>","<top>","CreateOptionals",
- "Sending",
- "Done",
- "Destroy",
- "CreateAgain",
- "SendAgain"
+ protected static final String stateStrings[] = {
+ "<no state>",
+ "<top>",
+ "CreateOptionals",
+ "Sending",
+ "Done",
+ "Destroy",
+ "CreateAgain",
+ "SendAgain"
};
-
+
// history
- protected int history[] = {NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE};
+ protected int history[] = {NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE};
private void setState(int new_state) {
DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
- if (stateStrings[new_state]!="Idle") {
- }
this.state = new_state;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Node_nodeRef1_main.java b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Node_nodeRef1_main.java
index 997accffd..a34d2e3b8 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Node_nodeRef1_main.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Node_nodeRef1_main.java
@@ -8,10 +8,12 @@ import org.eclipse.etrice.runtime.java.messaging.MessageService;
import org.eclipse.etrice.runtime.java.messaging.MessageServiceController;
import org.eclipse.etrice.runtime.java.messaging.RTServices;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;
import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBroker;
@@ -43,21 +45,21 @@ public class Node_nodeRef1_main extends SubSystemClassBase {
addPathToThread("/LS/main/appl", THREAD_PHYSICALTHREAD1);
addPathToThread("/LS/main/appl/ctrl", THREAD_PHYSICALTHREAD1);
addPathToThread("/LS/main/appl/ctrl/cont", THREAD_PHYSICALTHREAD1);
-
- // port to peer port mappings
- addPathToPeers("/LS/main/appl/ctrl/pcont", "/LS/main/appl/ctrl/cont/fct");
- addPathToPeers("/LS/main/appl/ctrl/pout", "/LS/main/appl/ctrl/cont/opt1/pin");
- addPathToPeers("/LS/main/appl/ctrl/pin", "/LS/main/appl/ctrl/cont/opt2/pout");
- addPathToPeers("/LS/main/appl/ctrl/cont/fct", "/LS/main/appl/ctrl/pcont");
- addPathToPeers("/LS/main/appl/ctrl/cont/opt1/pout", "/LS/main/appl/ctrl/cont/opt2/pin");
- addPathToPeers("/LS/main/appl/ctrl/cont/opt1/pin", "/LS/main/appl/ctrl/pout");
- addPathToPeers("/LS/main/appl/ctrl/cont/opt2/pout", "/LS/main/appl/ctrl/pin");
- addPathToPeers("/LS/main/appl/ctrl/cont/opt2/pin", "/LS/main/appl/ctrl/cont/opt1/pout");
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "appl");
new Appl(this, "appl");
+ // create service brokers in optional actor interfaces
+ {
+ OptionalActorInterfaceBase oai = (OptionalActorInterfaceBase) getObject("/LS/main/appl/ctrl/cont/opt1");
+ }
+ {
+ OptionalActorInterfaceBase oai = (OptionalActorInterfaceBase) getObject("/LS/main/appl/ctrl/cont/opt2");
+ }
+
+ // wiring
+
// apply instance attribute configurations
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional1.java b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional1.java
index fcd0a8773..d70d2c0bf 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional1.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional1.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -47,6 +48,9 @@ public class Optional1 extends ActorClassBase {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "sub1");
new AC1(this, "sub1");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional1Factory.java b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional1Factory.java
index d1e0680d4..bceaa78a9 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional1Factory.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional1Factory.java
@@ -3,22 +3,17 @@ package org.eclipse.etrice.examples.dynamicactors7;
import org.eclipse.etrice.examples.dynamicactors7.Optional1;
import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;
import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;
-import org.eclipse.etrice.runtime.java.modelbase.PathToPeers;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
public class Optional1Factory implements IOptionalActorFactory {
- private PathToPeers path2peers = new PathToPeers();
-
public Optional1 create(OptionalActorInterfaceBase ai, String name) {
- // set port mappings of this sub tree
- path2peers.put("/sub1/pout", "/pout");
- path2peers.put("/sub1/pin", "/pin");
- ai.setPath2peers(path2peers);
-
// instantiate sub tree
Optional1 actor = new Optional1(ai, name);
- ai.setPath2peers(null);
+ // wiring
+ InterfaceItemBase.connect(ai, "pin", name+"/sub1/pin");
+ InterfaceItemBase.connect(ai, "pout", name+"/sub1/pout");
return actor;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional1Interface.java b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional1Interface.java
index af7843c4d..87a47dc9f 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional1Interface.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional1Interface.java
@@ -23,12 +23,12 @@ class Optional1Interface extends ScalarOptionalActorInterfaceBase {
}
@Override
- protected void logCreation(String actorClass, String name) {
+ protected void logCreation(String actorClass, String name) {
DebuggingService.getInstance().addMessageActorCreate(this, actorClass, name);
}
@Override
- protected void logDeletion(String name) {
+ protected void logDeletion(String name) {
DebuggingService.getInstance().addMessageActorDestroy(this, name);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional1ReplicatedInterface.java b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional1ReplicatedInterface.java
index 7a0d3a5e8..873038813 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional1ReplicatedInterface.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional1ReplicatedInterface.java
@@ -23,12 +23,12 @@ class Optional1ReplicatedInterface extends ReplicatedOptionalActorInterfaceBase
}
@Override
- protected void logCreation(String actorClass, String name) {
+ protected void logCreation(String actorClass, String name) {
DebuggingService.getInstance().addMessageActorCreate(this, actorClass, name);
}
@Override
- protected void logDeletion(String name) {
+ protected void logDeletion(String name) {
DebuggingService.getInstance().addMessageActorDestroy(this, name);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional2.java b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional2.java
index 574d28ee3..3a852c865 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional2.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional2.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -47,6 +48,9 @@ public class Optional2 extends ActorClassBase {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "sub2");
new AC2(this, "sub2");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional2Factory.java b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional2Factory.java
index 87822de28..932a656c9 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional2Factory.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional2Factory.java
@@ -3,22 +3,17 @@ package org.eclipse.etrice.examples.dynamicactors7;
import org.eclipse.etrice.examples.dynamicactors7.Optional2;
import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;
import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;
-import org.eclipse.etrice.runtime.java.modelbase.PathToPeers;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
public class Optional2Factory implements IOptionalActorFactory {
- private PathToPeers path2peers = new PathToPeers();
-
public Optional2 create(OptionalActorInterfaceBase ai, String name) {
- // set port mappings of this sub tree
- path2peers.put("/sub2/pout", "/pout");
- path2peers.put("/sub2/pin", "/pin");
- ai.setPath2peers(path2peers);
-
// instantiate sub tree
Optional2 actor = new Optional2(ai, name);
- ai.setPath2peers(null);
+ // wiring
+ InterfaceItemBase.connect(ai, "pout", name+"/sub2/pout");
+ InterfaceItemBase.connect(ai, "pin", name+"/sub2/pin");
return actor;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional2Interface.java b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional2Interface.java
index 160b042d7..3c73afe6f 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional2Interface.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional2Interface.java
@@ -23,12 +23,12 @@ class Optional2Interface extends ScalarOptionalActorInterfaceBase {
}
@Override
- protected void logCreation(String actorClass, String name) {
+ protected void logCreation(String actorClass, String name) {
DebuggingService.getInstance().addMessageActorCreate(this, actorClass, name);
}
@Override
- protected void logDeletion(String name) {
+ protected void logDeletion(String name) {
DebuggingService.getInstance().addMessageActorDestroy(this, name);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional2ReplicatedInterface.java b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional2ReplicatedInterface.java
index 6302d4b10..8d11c0a44 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional2ReplicatedInterface.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/Optional2ReplicatedInterface.java
@@ -23,12 +23,12 @@ class Optional2ReplicatedInterface extends ReplicatedOptionalActorInterfaceBase
}
@Override
- protected void logCreation(String actorClass, String name) {
+ protected void logCreation(String actorClass, String name) {
DebuggingService.getInstance().addMessageActorCreate(this, actorClass, name);
}
@Override
- protected void logDeletion(String name) {
+ protected void logDeletion(String name) {
DebuggingService.getInstance().addMessageActorDestroy(this, name);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/PC.java b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/PC.java
index 89600c4ff..d4616afb1 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/PC.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/PC.java
@@ -58,10 +58,10 @@ public class PC {
if (messageStrings[msg.getEvtId()] != "timerTick"){
DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
}
- if (msg instanceof EventWithDataMessage)
- getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
- else
- getActor().receiveEvent(this, msg.getEvtId(), null);
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
}
}
@@ -133,10 +133,10 @@ public class PC {
if (messageStrings[msg.getEvtId()] != "timerTick"){
DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
}
- if (msg instanceof EventWithDataMessage)
- getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
- else
- getActor().receiveEvent(this, msg.getEvtId(), null);
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/PCtrl.java b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/PCtrl.java
index 40ea4835a..08d0ab967 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/PCtrl.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors7/src-gen/org/eclipse/etrice/examples/dynamicactors7/PCtrl.java
@@ -59,10 +59,10 @@ public class PCtrl {
if (messageStrings[msg.getEvtId()] != "timerTick"){
DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
}
- if (msg instanceof EventWithDataMessage)
- getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
- else
- getActor().receiveEvent(this, msg.getEvtId(), null);
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
}
}
@@ -134,10 +134,10 @@ public class PCtrl {
if (messageStrings[msg.getEvtId()] != "timerTick"){
DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
}
- if (msg instanceof EventWithDataMessage)
- getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
- else
- getActor().receiveEvent(this, msg.getEvtId(), null);
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Appl.java b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Appl.java
index e75e0ba42..4160dab15 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Appl.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Appl.java
@@ -9,6 +9,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -51,6 +52,9 @@ public class Appl extends ActorClassBase implements IPersistable {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "cont");
new Container(this, "cont");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Container.java b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Container.java
index 836567435..d94f6efc8 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Container.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Container.java
@@ -9,6 +9,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -73,6 +74,11 @@ public class Container extends ActorClassBase implements IPersistable {
// sub actors
opt = new OptionalInterface(this, "opt");
optarr = new OptionalReplicatedInterface(this, "optarr");
+
+ // wiring
+ InterfaceItemBase.connect(this, "opt/fct", "op");
+ InterfaceItemBase.connect(this, "optarr/fct", "opa");
+
}
@@ -121,21 +127,22 @@ public class Container extends ActorClassBase implements IPersistable {
public static final int TRIG_opa__hello = IFITEM_opa + EVT_SHIFT*PStep.OUT_hello;
// state names
- protected static final String stateStrings[] = {"<no state>","<top>","Init",
- "DestroyAndCreate",
- "DestroyAndRestore",
- "Done",
- "LoadInArray",
- "ReceivedHello"
+ protected static final String stateStrings[] = {
+ "<no state>",
+ "<top>",
+ "Init",
+ "DestroyAndCreate",
+ "DestroyAndRestore",
+ "Done",
+ "LoadInArray",
+ "ReceivedHello"
};
-
+
// history
- protected int history[] = {NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE};
+ protected int history[] = {NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE};
private void setState(int new_state) {
DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
- if (stateStrings[new_state]!="Idle") {
- }
this.state = new_state;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/DeepSub1.java b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/DeepSub1.java
index 6d6051624..1e3821c2c 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/DeepSub1.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/DeepSub1.java
@@ -9,6 +9,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -52,6 +53,9 @@ public class DeepSub1 extends ActorClassBase implements IPersistable {
// own service implementations
// sub actors
+
+ // wiring
+
}
@@ -97,21 +101,22 @@ public class DeepSub1 extends ActorClassBase implements IPersistable {
public static final int TRIG_fct__sayHello = IFITEM_fct + EVT_SHIFT*PStep.IN_sayHello;
// state names
- protected static final String stateStrings[] = {"<no state>","<top>","Step1",
- "Step2",
- "Step3",
- "Step5",
- "Step6",
- "Step7"
+ protected static final String stateStrings[] = {
+ "<no state>",
+ "<top>",
+ "Step1",
+ "Step2",
+ "Step3",
+ "Step5",
+ "Step6",
+ "Step7"
};
-
+
// history
- protected int history[] = {NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE};
+ protected int history[] = {NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE};
private void setState(int new_state) {
DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
- if (stateStrings[new_state]!="Idle") {
- }
this.state = new_state;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Node_nodeRef1_main.java b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Node_nodeRef1_main.java
index 7a6b65fc6..a5be17d55 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Node_nodeRef1_main.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Node_nodeRef1_main.java
@@ -8,10 +8,12 @@ import org.eclipse.etrice.runtime.java.messaging.MessageService;
import org.eclipse.etrice.runtime.java.messaging.MessageServiceController;
import org.eclipse.etrice.runtime.java.messaging.RTServices;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;
import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBroker;
@@ -42,17 +44,21 @@ public class Node_nodeRef1_main extends SubSystemClassBase {
// thread mappings
addPathToThread("/LogSys1/main/main", THREAD_PHYSICALTHREAD1);
addPathToThread("/LogSys1/main/main/cont", THREAD_PHYSICALTHREAD1);
-
- // port to peer port mappings
- addPathToPeers("/LogSys1/main/main/cont/op", "/LogSys1/main/main/cont/opt/fct");
- addPathToPeers("/LogSys1/main/main/cont/opa", "/LogSys1/main/main/cont/optarr/fct");
- addPathToPeers("/LogSys1/main/main/cont/opt/fct", "/LogSys1/main/main/cont/op");
- addPathToPeers("/LogSys1/main/main/cont/optarr/fct", "/LogSys1/main/main/cont/opa");
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "main");
new Appl(this, "main");
+ // create service brokers in optional actor interfaces
+ {
+ OptionalActorInterfaceBase oai = (OptionalActorInterfaceBase) getObject("/LogSys1/main/main/cont/opt");
+ }
+ {
+ OptionalActorInterfaceBase oai = (OptionalActorInterfaceBase) getObject("/LogSys1/main/main/cont/optarr");
+ }
+
+ // wiring
+
// apply instance attribute configurations
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Optional.java b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Optional.java
index 88bd83a26..41dd9f3f2 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Optional.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Optional.java
@@ -9,6 +9,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -49,6 +50,9 @@ public abstract class Optional extends ActorClassBase implements IPersistable {
// own service implementations
// sub actors
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Optional1.java b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Optional1.java
index d25d63858..a9e927c45 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Optional1.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Optional1.java
@@ -9,6 +9,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -51,6 +52,9 @@ public class Optional1 extends Optional implements IPersistable {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "sub");
new Sub1(this, "sub");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Optional1Factory.java b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Optional1Factory.java
index 36721e6a7..a884e564b 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Optional1Factory.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Optional1Factory.java
@@ -3,23 +3,16 @@ package org.eclipse.etrice.examples.dynamicactors8;
import org.eclipse.etrice.examples.dynamicactors8.Optional1;
import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;
import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;
-import org.eclipse.etrice.runtime.java.modelbase.PathToPeers;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
public class Optional1Factory implements IOptionalActorFactory {
- private PathToPeers path2peers = new PathToPeers();
-
public Optional1 create(OptionalActorInterfaceBase ai, String name) {
- // set port mappings of this sub tree
- path2peers.put("/sub/fct", "/fct");
- path2peers.put("/sub/dp", "/sub/deep/fct");
- path2peers.put("/sub/deep/fct", "/sub/dp");
- ai.setPath2peers(path2peers);
-
// instantiate sub tree
Optional1 actor = new Optional1(ai, name);
- ai.setPath2peers(null);
+ // wiring
+ InterfaceItemBase.connect(ai, "fct", name+"/sub/fct");
return actor;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Optional2.java b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Optional2.java
index cd616cb28..d368edaad 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Optional2.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Optional2.java
@@ -9,6 +9,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -51,6 +52,9 @@ public class Optional2 extends Optional implements IPersistable {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "sub");
new Sub2(this, "sub");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Optional2Factory.java b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Optional2Factory.java
index 661aa7f69..75c61f4af 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Optional2Factory.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Optional2Factory.java
@@ -3,21 +3,16 @@ package org.eclipse.etrice.examples.dynamicactors8;
import org.eclipse.etrice.examples.dynamicactors8.Optional2;
import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;
import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;
-import org.eclipse.etrice.runtime.java.modelbase.PathToPeers;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
public class Optional2Factory implements IOptionalActorFactory {
- private PathToPeers path2peers = new PathToPeers();
-
public Optional2 create(OptionalActorInterfaceBase ai, String name) {
- // set port mappings of this sub tree
- path2peers.put("/sub/fct", "/fct");
- ai.setPath2peers(path2peers);
-
// instantiate sub tree
Optional2 actor = new Optional2(ai, name);
- ai.setPath2peers(null);
+ // wiring
+ InterfaceItemBase.connect(ai, "fct", name+"/sub/fct");
return actor;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/OptionalInterface.java b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/OptionalInterface.java
index 999038619..28e6f149b 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/OptionalInterface.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/OptionalInterface.java
@@ -20,12 +20,12 @@ class OptionalInterface extends ScalarOptionalActorInterfaceBase {
}
@Override
- protected void logCreation(String actorClass, String name) {
+ protected void logCreation(String actorClass, String name) {
DebuggingService.getInstance().addMessageActorCreate(this, actorClass, name);
}
@Override
- protected void logDeletion(String name) {
+ protected void logDeletion(String name) {
DebuggingService.getInstance().addMessageActorDestroy(this, name);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/OptionalReplicatedInterface.java b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/OptionalReplicatedInterface.java
index f556340b0..564ec30d1 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/OptionalReplicatedInterface.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/OptionalReplicatedInterface.java
@@ -20,12 +20,12 @@ class OptionalReplicatedInterface extends ReplicatedOptionalActorInterfaceBase {
}
@Override
- protected void logCreation(String actorClass, String name) {
+ protected void logCreation(String actorClass, String name) {
DebuggingService.getInstance().addMessageActorCreate(this, actorClass, name);
}
@Override
- protected void logDeletion(String name) {
+ protected void logDeletion(String name) {
DebuggingService.getInstance().addMessageActorDestroy(this, name);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/PStep.java b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/PStep.java
index 9c7c3f1c8..2caae2e3d 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/PStep.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/PStep.java
@@ -59,10 +59,10 @@ public class PStep {
if (messageStrings[msg.getEvtId()] != "timerTick"){
DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
}
- if (msg instanceof EventWithDataMessage)
- getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
- else
- getActor().receiveEvent(this, msg.getEvtId(), null);
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
}
}
@@ -134,10 +134,10 @@ public class PStep {
if (messageStrings[msg.getEvtId()] != "timerTick"){
DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
}
- if (msg instanceof EventWithDataMessage)
- getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
- else
- getActor().receiveEvent(this, msg.getEvtId(), null);
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Sub1.java b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Sub1.java
index 48d9ed95d..7ed059ac6 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Sub1.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Sub1.java
@@ -9,6 +9,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -75,6 +76,10 @@ public class Sub1 extends ActorClassBase implements IPersistable {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "deep");
new DeepSub1(this, "deep");
+
+ // wiring
+ InterfaceItemBase.connect(this, "deep/fct", "dp");
+
}
@@ -161,21 +166,22 @@ public class Sub1 extends ActorClassBase implements IPersistable {
public static final int TRIG_fct__sayHello = IFITEM_fct + EVT_SHIFT*PStep.IN_sayHello;
// state names
- protected static final String stateStrings[] = {"<no state>","<top>","Step3",
- "Step1",
- "Step2",
- "Step3_StepA",
- "Step3_StepB",
- "Step3_StepC"
+ protected static final String stateStrings[] = {
+ "<no state>",
+ "<top>",
+ "Step3",
+ "Step1",
+ "Step2",
+ "Step3_StepA",
+ "Step3_StepB",
+ "Step3_StepC"
};
-
+
// history
- protected int history[] = {NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE};
+ protected int history[] = {NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE};
private void setState(int new_state) {
DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
- if (stateStrings[new_state]!="Idle") {
- }
this.state = new_state;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Sub2.java b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Sub2.java
index 5ee2e53b0..ed332a88d 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Sub2.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors8/src-gen/org/eclipse/etrice/examples/dynamicactors8/Sub2.java
@@ -9,6 +9,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -52,6 +53,9 @@ public class Sub2 extends ActorClassBase implements IPersistable {
// own service implementations
// sub actors
+
+ // wiring
+
}
@@ -89,16 +93,17 @@ public class Sub2 extends ActorClassBase implements IPersistable {
public static final int TRIG_fct__sayHello = IFITEM_fct + EVT_SHIFT*PStep.IN_sayHello;
// state names
- protected static final String stateStrings[] = {"<no state>","<top>","Ready"
+ protected static final String stateStrings[] = {
+ "<no state>",
+ "<top>",
+ "Ready"
};
-
+
// history
- protected int history[] = {NO_STATE,NO_STATE,NO_STATE};
+ protected int history[] = {NO_STATE, NO_STATE, NO_STATE};
private void setState(int new_state) {
DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
- if (stateStrings[new_state]!="Idle") {
- }
this.state = new_state;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors9/model/diagrams/org.eclipse.etrice.examples.dynamicactors9.Sender.behavior b/examples/org.eclipse.etrice.examples.dynamicactors9/model/diagrams/org.eclipse.etrice.examples.dynamicactors9.Sender.behavior
index 95f468f89..2837e60a3 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors9/model/diagrams/org.eclipse.etrice.examples.dynamicactors9.Sender.behavior
+++ b/examples/org.eclipse.etrice.examples.dynamicactors9/model/diagrams/org.eclipse.etrice.examples.dynamicactors9.Sender.behavior
@@ -65,7 +65,7 @@
<graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="139" height="90" x="463" y="120">
<graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="79" height="30" x="30" y="30" cornerHeight="20" cornerWidth="20">
<graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="15" height="8" x="54" y="3" cornerHeight="5" cornerWidth="5"/>
- <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="39" y="24">
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="true" transparency="0.0" x="39" y="24">
<points x="-3" y="-3"/>
<points x="-3" y="3"/>
<points x="-11" y="3"/>
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/Container.java b/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/Container.java
index db38760c2..b0ff72e17 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/Container.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/Container.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -50,6 +51,9 @@ public class Container extends ActorClassBase {
// sub actors
pp = new PingPongInterface(this, "pp");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/Node_nodeRef1_subSysRef1.java b/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/Node_nodeRef1_subSysRef1.java
index 168f9faa7..15d7c26b0 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/Node_nodeRef1_subSysRef1.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/Node_nodeRef1_subSysRef1.java
@@ -8,6 +8,7 @@ import org.eclipse.etrice.runtime.java.messaging.MessageService;
import org.eclipse.etrice.runtime.java.messaging.MessageServiceController;
import org.eclipse.etrice.runtime.java.messaging.RTServices;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;
import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
@@ -45,9 +46,6 @@ public class Node_nodeRef1_subSysRef1 extends SubSystemClassBase {
addPathToThread("/LogSys1/subSysRef1/actorRef1", THREAD_PHYSICALTHREAD1);
addPathToThread("/LogSys1/subSysRef1/actorRef1/container", THREAD_PHYSICALTHREAD1);
addPathToThread("/LogSys1/subSysRef1/timingService", THREAD_PHYSICALTHREAD1);
-
- // port to peer port mappings
- addPathToPeers("/LogSys1/subSysRef1/actorRef1/container/pp/room_basic_service_timing_PTimer", "/LogSys1/subSysRef1/timingService/timer");
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "actorRef1");
@@ -55,12 +53,15 @@ public class Node_nodeRef1_subSysRef1 extends SubSystemClassBase {
DebuggingService.getInstance().addMessageActorCreate(this, "timingService");
new ATimingService(this, "timingService");
- // wire optional actor interfaces with services
+ // create service brokers in optional actor interfaces
{
OptionalActorInterfaceBase oai = (OptionalActorInterfaceBase) getObject("/LogSys1/subSysRef1/actorRef1/container/pp");
new InterfaceItemBroker(oai, "room_basic_service_timing_PTimer", 0);
+ InterfaceItemBase.connect(this, "/LogSys1/subSysRef1/timingService/timer", "/LogSys1/subSysRef1/actorRef1/container/pp/room_basic_service_timing_PTimer");
}
+ // wiring
+
// apply instance attribute configurations
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/PingPong.java b/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/PingPong.java
index 247e2d505..92740a410 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/PingPong.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/PingPong.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -51,6 +52,10 @@ public class PingPong extends ActorClassBase {
new Receiver(this, "receiver");
DebuggingService.getInstance().addMessageActorCreate(this, "sender");
new Sender(this, "sender");
+
+ // wiring
+ InterfaceItemBase.connect(this, "receiver/sender", "sender/receiver");
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/PingPongFactory.java b/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/PingPongFactory.java
index d44c783e2..8e631c190 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/PingPongFactory.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/PingPongFactory.java
@@ -3,23 +3,16 @@ package org.eclipse.etrice.examples.dynamicactors9;
import org.eclipse.etrice.examples.dynamicactors9.PingPong;
import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;
import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;
-import org.eclipse.etrice.runtime.java.modelbase.PathToPeers;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
public class PingPongFactory implements IOptionalActorFactory {
- private PathToPeers path2peers = new PathToPeers();
-
public PingPong create(OptionalActorInterfaceBase ai, String name) {
- // set port mappings of this sub tree
- path2peers.put("/receiver/sender", "/sender/receiver");
- path2peers.put("/receiver/timing", "/room_basic_service_timing_PTimer");
- path2peers.put("/sender/receiver", "/receiver/sender");
- ai.setPath2peers(path2peers);
-
// instantiate sub tree
PingPong actor = new PingPong(ai, name);
- ai.setPath2peers(null);
+ // wiring
+ InterfaceItemBase.connect(ai, "room_basic_service_timing_PTimer", name+"/receiver/timing");
return actor;
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/PingPongProtocol.java b/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/PingPongProtocol.java
index 3a7a78e88..3fb0ab4d2 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/PingPongProtocol.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/PingPongProtocol.java
@@ -58,10 +58,10 @@ public class PingPongProtocol {
if (messageStrings[msg.getEvtId()] != "timerTick"){
DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
}
- if (msg instanceof EventWithDataMessage)
- getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
- else
- getActor().receiveEvent(this, msg.getEvtId(), null);
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
}
}
@@ -133,10 +133,10 @@ public class PingPongProtocol {
if (messageStrings[msg.getEvtId()] != "timerTick"){
DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
}
- if (msg instanceof EventWithDataMessage)
- getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
- else
- getActor().receiveEvent(this, msg.getEvtId(), null);
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
}
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/PingPongTop.java b/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/PingPongTop.java
index 2cd41a340..5b1b1d67b 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/PingPongTop.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/PingPongTop.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -49,6 +50,9 @@ public class PingPongTop extends ActorClassBase {
// sub actors
DebuggingService.getInstance().addMessageActorCreate(this, "container");
new Container(this, "container");
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/Receiver.java b/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/Receiver.java
index b22d421ec..3dffaa8d2 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/Receiver.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/Receiver.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -53,6 +54,9 @@ public class Receiver extends ActorClassBase {
// own service implementations
// sub actors
+
+ // wiring
+
}
diff --git a/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/Sender.java b/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/Sender.java
index 9fbd710a6..170b6cbeb 100644
--- a/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/Sender.java
+++ b/examples/org.eclipse.etrice.examples.dynamicactors9/src-gen/org/eclipse/etrice/examples/dynamicactors9/Sender.java
@@ -5,6 +5,7 @@ import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -48,6 +49,9 @@ public class Sender extends ActorClassBase {
// own service implementations
// sub actors
+
+ // wiring
+
}
@@ -104,7 +108,6 @@ public class Sender extends ActorClassBase {
receiver.ping();
}
protected void entry_ReceivedPong() {
- System.out.println(((org.eclipse.etrice.runtime.java.messaging.RTObject)getRoot()).toStringRecursive());
System.out.println("Done, enter 'quit' to exit");
}
diff --git a/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/builder/Wiring.java b/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/builder/Wiring.java
index 9f739ac59..c7fbcdb75 100644
--- a/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/builder/Wiring.java
+++ b/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/builder/Wiring.java
@@ -476,7 +476,7 @@ public class Wiring {
// propagate unsatisfied requested services
for (ActorContainerRef ref : refs) {
WiredStructureClass sub = null;
- if (ref instanceof ActorRef)
+ if (ref instanceof ActorRef && ((ActorRef)ref).getRefType()==ReferenceType.FIXED)
sub = getWiredActorClass(((ActorRef) ref).getType());
if (sub!=null) {
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassGen.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassGen.xtend
index 06a7c1ff8..2bd891a7d 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassGen.xtend
@@ -29,6 +29,9 @@ import org.eclipse.etrice.core.room.PrimitiveType
import org.eclipse.etrice.core.room.Attribute
import org.eclipse.etrice.generator.java.Main
import org.eclipse.etrice.core.genmodel.builder.GenmodelConstants
+import org.eclipse.etrice.core.genmodel.etricegen.WiredActorClass
+import org.eclipse.etrice.core.room.ActorClass
+import java.util.HashMap
@Singleton
class ActorClassGen extends GenericActorClassGenerator {
@@ -44,18 +47,21 @@ class ActorClassGen extends GenericActorClassGenerator {
@Inject extension StateMachineGen
def doGenerate(Root root) {
+ val HashMap<ActorClass, WiredActorClass> ac2wired = new HashMap<ActorClass, WiredActorClass>
+ root.wiredInstances.filter(w|w instanceof WiredActorClass).forEach[w|ac2wired.put((w as WiredActorClass).actorClass, w as WiredActorClass)]
for (xpac: root.xpActorClasses) {
+ val wired = ac2wired.get(xpac.actorClass)
val manualBehavior = xpac.actorClass.isBehaviorAnnotationPresent("BehaviorManual")
val path = xpac.actorClass.generationTargetPath+xpac.actorClass.getPath
val infopath = xpac.actorClass.generationInfoPath+xpac.actorClass.getPath
var file = xpac.actorClass.getJavaFileName
if (manualBehavior)
file = "Abstract"+file
- fileIO.generateFile("generating ActorClass implementation", path, infopath, file, root.generate(xpac, manualBehavior))
+ fileIO.generateFile("generating ActorClass implementation", path, infopath, file, root.generate(xpac, wired, manualBehavior))
}
}
- def generate(Root root, ExpandedActorClass xpac, boolean manualBehavior) {
+ def generate(Root root, ExpandedActorClass xpac, WiredActorClass wired, boolean manualBehavior) {
val ac = xpac.actorClass
val clsname = if (manualBehavior) "Abstract"+ac.name else ac.name
val ctor = ac.operations.filter(op|op.constructor).head
@@ -84,6 +90,7 @@ class ActorClassGen extends GenericActorClassGenerator {
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
import «baseClassImport»;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+ import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -177,6 +184,12 @@ class ActorClassGen extends GenericActorClassGenerator {
new «sub.type.name»(this, "«sub.name»");
«ENDIF»
«ENDFOR»
+
+ // wiring
+ «FOR wire: wired.wires»
+ «if (wire.dataDriven) "DataPortBase" else "InterfaceItemBase"».connect(this, "«wire.path1.join('/')»", "«wire.path2.join('/')»");
+ «ENDFOR»
+
«IF ctor!=null»
{
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeGen.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeGen.xtend
index 59d62aff9..ae713c53f 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeGen.xtend
@@ -36,6 +36,10 @@ import com.google.common.collect.Sets
import com.google.common.collect.Lists
import org.eclipse.etrice.core.genmodel.etricegen.StructureInstance
import org.eclipse.etrice.generator.java.Main
+import org.eclipse.etrice.core.genmodel.etricegen.WiredSubSystemClass
+import java.util.HashMap
+import org.eclipse.etrice.core.room.SubSystemClass
+import org.eclipse.etrice.core.genmodel.etricegen.InstanceBase
@Singleton
class NodeGen {
@@ -51,9 +55,12 @@ class NodeGen {
@Inject IDiagnostician diagnostician
def doGenerate(Root root) {
+ val HashMap<SubSystemClass, WiredSubSystemClass> sscc2wired = new HashMap<SubSystemClass, WiredSubSystemClass>
+ root.wiredInstances.filter(w|w instanceof WiredSubSystemClass).forEach[w|sscc2wired.put((w as WiredSubSystemClass).subSystemClass, w as WiredSubSystemClass)]
for (nr : ETMapUtil::getNodeRefs()) {
for (instpath : ETMapUtil::getSubSystemInstancePaths(nr)) {
val ssi = root.getInstance(instpath) as SubSystemInstance
+ val wired = sscc2wired.get(ssi.subSystemClass)
val path = ssi.subSystemClass.generationTargetPath+ssi.subSystemClass.getPath
val infopath = ssi.subSystemClass.generationInfoPath+ssi.subSystemClass.getPath
val file = nr.getJavaFileName(ssi)
@@ -67,7 +74,7 @@ class NodeGen {
usedThreads.add(thread)
}
- fileIO.generateFile("generating Node implementation", path, infopath, file, root.generate(ssi, usedThreads))
+ fileIO.generateFile("generating Node implementation", path, infopath, file, root.generate(ssi, wired, usedThreads))
if (dataConfigExt.hasVariableService(ssi))
varService.doGenerate(root, ssi);
}
@@ -88,7 +95,8 @@ class NodeGen {
return result
}
- def generate(Root root, SubSystemInstance comp, HashSet<PhysicalThread> usedThreads) {
+
+ def generate(Root root, SubSystemInstance comp, WiredSubSystemClass wired, HashSet<PhysicalThread> usedThreads) {
val cc = comp.subSystemClass
val models = root.getReferencedModels(cc)
val nr = ETMapUtil::getNodeRef(comp)
@@ -109,6 +117,7 @@ class NodeGen {
import org.eclipse.etrice.runtime.java.messaging.MessageServiceController;
import org.eclipse.etrice.runtime.java.messaging.RTServices;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
+ import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;
import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;
import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
@@ -158,22 +167,6 @@ class NodeGen {
«FOR ai : comp.allContainedInstances»
addPathToThread("«ai.path»", «ETMapUtil::getPhysicalThread(ai).threadId»);
«ENDFOR»
-
- // port to peer port mappings
- «FOR ai : comp.allSubInstances»
- «val ports = if (ai instanceof ActorInstance) (ai as ActorInstance).orderedIfItemInstances else ai.ports»
- «FOR pi : ports»
- «IF pi.peers.size>0»
- addPathToPeers("«pi.path»", «FOR peer : pi.peers SEPARATOR ","»"«peer.path»"«ENDFOR»);
- «ENDIF»
- «ENDFOR»
- «val services = if (ai instanceof ActorInterfaceInstance) (ai as ActorInterfaceInstance).providedServices else null»
- «IF services!=null»
- «FOR svc: services»
- addPathToPeers("«ai.path»/«svc.protocol.fullyQualifiedName»", "«svc.path»");
- «ENDFOR»
- «ENDIF»
- «ENDFOR»
// sub actors
«FOR sub : cc.actorRefs»
@@ -192,16 +185,22 @@ class NodeGen {
«ENDIF»
«ENDFOR»
- // wire optional actor interfaces with services
+ // create service brokers in optional actor interfaces
«FOR aii: comp.allSubInstances.filter(inst|inst instanceof ActorInterfaceInstance).map(inst|inst as ActorInterfaceInstance)»
{
OptionalActorInterfaceBase oai = (OptionalActorInterfaceBase) getObject("«aii.getPath()»");
«FOR svc: aii.providedServices»
new InterfaceItemBroker(oai, "«svc.protocol.fullyQualifiedName»", 0);
+ InterfaceItemBase.connect(this, "«svc.path»", "«aii.getPath()+InstanceBase::pathDelim+svc.protocol.fullyQualifiedName»");
«ENDFOR»
}
«ENDFOR»
+ // wiring
+ «FOR wire: wired.wires»
+ «if (wire.dataDriven) "DataPortBase" else "InterfaceItemBase"».connect(this, "«wire.path1.join('/')»", "«wire.path2.join('/')»");
+ «ENDFOR»
+
// apply instance attribute configurations
«FOR ai: comp.allContainedInstances»
«val cfg = configGenAddon.genActorInstanceConfig(ai, "inst")»
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/OptionalActorFactoryGen.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/OptionalActorFactoryGen.xtend
index f4e627d40..0ca795a36 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/OptionalActorFactoryGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/OptionalActorFactoryGen.xtend
@@ -5,8 +5,12 @@ import org.eclipse.etrice.generator.base.IGeneratorFileIo
import org.eclipse.etrice.generator.generic.RoomExtensions
import org.eclipse.etrice.core.genmodel.etricegen.Root
import org.eclipse.etrice.core.genmodel.etricegen.OptionalActorInstance
-import org.eclipse.etrice.core.genmodel.etricegen.ActorInstance
import org.eclipse.etrice.core.genmodel.etricegen.InterfaceItemInstance
+import org.eclipse.etrice.core.room.ActorClass
+import java.util.HashMap
+import org.eclipse.etrice.core.genmodel.etricegen.WiredActorClass
+import org.eclipse.etrice.core.room.util.RoomHelpers
+import org.eclipse.etrice.core.room.CommunicationType
class OptionalActorFactoryGen {
@@ -15,16 +19,19 @@ class OptionalActorFactoryGen {
@Inject extension RoomExtensions
def doGenerate(Root root) {
+ val HashMap<ActorClass, WiredActorClass> ac2wired = new HashMap<ActorClass, WiredActorClass>
+ root.wiredInstances.filter(w|w instanceof WiredActorClass).forEach[w|ac2wired.put((w as WiredActorClass).actorClass, w as WiredActorClass)]
for (oi: root.optionalInstances) {
val ac = oi.actorClass
+ val wired = ac2wired.get(ac)
val path = ac.generationTargetPath+ac.path
val infopath = ac.generationInfoPath+ac.path
val file = ac.getJavaFactoryFileName
- fileIO.generateFile("generating ActorClass Interface implementation", path, infopath, file, root.generate(oi))
+ fileIO.generateFile("generating ActorClass Interface implementation", path, infopath, file, root.generate(oi, wired))
}
}
- def generate(Root root, OptionalActorInstance oi) {
+ def generate(Root root, OptionalActorInstance oi, WiredActorClass wired) {
val ac = oi.actorClass
val clsname = ac.javaFactoryName
'''
@@ -33,28 +40,24 @@ class OptionalActorFactoryGen {
import «ac.package».«ac.name»;
import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;
import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;
- import org.eclipse.etrice.runtime.java.modelbase.PathToPeers;
+ import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
public class «clsname» implements IOptionalActorFactory {
- private PathToPeers path2peers = new PathToPeers();
-
public «ac.name» create(OptionalActorInterfaceBase ai, String name) {
- // set port mappings of this sub tree
- «FOR ai : oi.allSubInstances»
- «val ports = if (ai instanceof ActorInstance) (ai as ActorInstance).orderedIfItemInstances else ai.ports»
- «FOR pi : ports»
- «IF pi.peers.size>0»
- path2peers.put("«oi.relPath(pi)»", «FOR peer : pi.peers SEPARATOR ","»"«oi.relPath(peer)»"«ENDFOR»);
- «ENDIF»
- «ENDFOR»
- «ENDFOR»
- ai.setPath2peers(path2peers);
-
// instantiate sub tree
«ac.name» actor = new «ac.name»(ai, name);
- ai.setPath2peers(null);
+ // wiring
+ «FOR port: RoomHelpers::getAllEndPorts(ac).filter(p|RoomHelpers::isExternal(p))»
+ «if (RoomHelpers::isDataDriven(port)) "DataPortBase" else "InterfaceItemBase"».connect(ai, "«port.name»", name+"/«port.name»");
+ «ENDFOR»
+ «FOR open: wired.openBindings»
+ «if (RoomHelpers::isDataDriven(open.port)) "DataPortBase" else "InterfaceItemBase"».connect(ai, "«open.port.name»", name+"/«open.path.join('/')»");
+ «ENDFOR»
+ «FOR req: wired.requiredServices»
+ «if (req.protocol.commType==CommunicationType::DATA_DRIVEN) "DataPortBase" else "InterfaceItemBase"».connect(ai, "«req.protocol.fullyQualifiedName»", name+"/«req.path.join('/')»");
+ «ENDFOR»
return actor;
}
diff --git a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassGen.java b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassGen.java
index 85199e256..2d8af1252 100644
--- a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassGen.java
+++ b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassGen.java
@@ -13,11 +13,15 @@ package org.eclipse.etrice.generator.java.gen;
import com.google.common.base.Objects;
import com.google.inject.Inject;
import com.google.inject.Singleton;
+import java.util.HashMap;
import java.util.List;
import org.eclipse.emf.common.util.EList;
import org.eclipse.etrice.core.genmodel.builder.GenmodelConstants;
import org.eclipse.etrice.core.genmodel.etricegen.ExpandedActorClass;
import org.eclipse.etrice.core.genmodel.etricegen.Root;
+import org.eclipse.etrice.core.genmodel.etricegen.Wire;
+import org.eclipse.etrice.core.genmodel.etricegen.WiredActorClass;
+import org.eclipse.etrice.core.genmodel.etricegen.WiredStructureClass;
import org.eclipse.etrice.core.room.ActorClass;
import org.eclipse.etrice.core.room.ActorRef;
import org.eclipse.etrice.core.room.Attribute;
@@ -50,6 +54,7 @@ import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.xbase.lib.Extension;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
+import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
@Singleton
@SuppressWarnings("all")
@@ -84,34 +89,52 @@ public class ActorClassGen extends GenericActorClassGenerator {
private StateMachineGen _stateMachineGen;
public void doGenerate(final Root root) {
+ HashMap<ActorClass,WiredActorClass> _hashMap = new HashMap<ActorClass, WiredActorClass>();
+ final HashMap<ActorClass,WiredActorClass> ac2wired = _hashMap;
+ EList<WiredStructureClass> _wiredInstances = root.getWiredInstances();
+ final Function1<WiredStructureClass,Boolean> _function = new Function1<WiredStructureClass,Boolean>() {
+ public Boolean apply(final WiredStructureClass w) {
+ return Boolean.valueOf((w instanceof WiredActorClass));
+ }
+ };
+ Iterable<WiredStructureClass> _filter = IterableExtensions.<WiredStructureClass>filter(_wiredInstances, _function);
+ final Procedure1<WiredStructureClass> _function_1 = new Procedure1<WiredStructureClass>() {
+ public void apply(final WiredStructureClass w) {
+ ActorClass _actorClass = ((WiredActorClass) w).getActorClass();
+ ac2wired.put(_actorClass, ((WiredActorClass) w));
+ }
+ };
+ IterableExtensions.<WiredStructureClass>forEach(_filter, _function_1);
EList<ExpandedActorClass> _xpActorClasses = root.getXpActorClasses();
for (final ExpandedActorClass xpac : _xpActorClasses) {
{
ActorClass _actorClass = xpac.getActorClass();
- final boolean manualBehavior = RoomHelpers.isBehaviorAnnotationPresent(_actorClass, "BehaviorManual");
+ final WiredActorClass wired = ac2wired.get(_actorClass);
ActorClass _actorClass_1 = xpac.getActorClass();
- String _generationTargetPath = this._roomExtensions.getGenerationTargetPath(_actorClass_1);
+ final boolean manualBehavior = RoomHelpers.isBehaviorAnnotationPresent(_actorClass_1, "BehaviorManual");
ActorClass _actorClass_2 = xpac.getActorClass();
- String _path = this._roomExtensions.getPath(_actorClass_2);
- final String path = (_generationTargetPath + _path);
+ String _generationTargetPath = this._roomExtensions.getGenerationTargetPath(_actorClass_2);
ActorClass _actorClass_3 = xpac.getActorClass();
- String _generationInfoPath = this._roomExtensions.getGenerationInfoPath(_actorClass_3);
+ String _path = this._roomExtensions.getPath(_actorClass_3);
+ final String path = (_generationTargetPath + _path);
ActorClass _actorClass_4 = xpac.getActorClass();
- String _path_1 = this._roomExtensions.getPath(_actorClass_4);
- final String infopath = (_generationInfoPath + _path_1);
+ String _generationInfoPath = this._roomExtensions.getGenerationInfoPath(_actorClass_4);
ActorClass _actorClass_5 = xpac.getActorClass();
- String file = this._javaExtensions.getJavaFileName(_actorClass_5);
+ String _path_1 = this._roomExtensions.getPath(_actorClass_5);
+ final String infopath = (_generationInfoPath + _path_1);
+ ActorClass _actorClass_6 = xpac.getActorClass();
+ String file = this._javaExtensions.getJavaFileName(_actorClass_6);
if (manualBehavior) {
String _plus = ("Abstract" + file);
file = _plus;
}
- CharSequence _generate = this.generate(root, xpac, manualBehavior);
+ CharSequence _generate = this.generate(root, xpac, wired, manualBehavior);
this.fileIO.generateFile("generating ActorClass implementation", path, infopath, file, _generate);
}
}
}
- public CharSequence generate(final Root root, final ExpandedActorClass xpac, final boolean manualBehavior) {
+ public CharSequence generate(final Root root, final ExpandedActorClass xpac, final WiredActorClass wired, final boolean manualBehavior) {
CharSequence _xblockexpression = null;
{
final ActorClass ac = xpac.getActorClass();
@@ -228,6 +251,8 @@ public class ActorClassGen extends GenericActorClassGenerator {
_builder.newLineIfNotEmpty();
_builder.append("import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;");
_builder.newLine();
+ _builder.append("import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;");
+ _builder.newLine();
_builder.append("import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;");
_builder.newLine();
_builder.append("import org.eclipse.etrice.runtime.java.debugging.DebuggingService;");
@@ -639,6 +664,37 @@ public class ActorClassGen extends GenericActorClassGenerator {
}
}
}
+ _builder.append("\t\t");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("// wiring");
+ _builder.newLine();
+ {
+ EList<Wire> _wires = wired.getWires();
+ for(final Wire wire : _wires) {
+ _builder.append("\t\t");
+ String _xifexpression_5 = null;
+ boolean _isDataDriven = wire.isDataDriven();
+ if (_isDataDriven) {
+ _xifexpression_5 = "DataPortBase";
+ } else {
+ _xifexpression_5 = "InterfaceItemBase";
+ }
+ _builder.append(_xifexpression_5, " ");
+ _builder.append(".connect(this, \"");
+ EList<String> _path1 = wire.getPath1();
+ String _join = IterableExtensions.join(_path1, "/");
+ _builder.append(_join, " ");
+ _builder.append("\", \"");
+ EList<String> _path2 = wire.getPath2();
+ String _join_1 = IterableExtensions.join(_path2, "/");
+ _builder.append(_join_1, " ");
+ _builder.append("\");");
+ _builder.newLineIfNotEmpty();
+ }
+ }
+ _builder.append("\t\t");
+ _builder.newLine();
{
boolean _notEquals_3 = (!Objects.equal(ctor, null));
if (_notEquals_3) {
diff --git a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/NodeGen.java b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/NodeGen.java
index e1e0cae2d..74ca694f3 100644
--- a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/NodeGen.java
+++ b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/NodeGen.java
@@ -17,6 +17,7 @@ import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -34,13 +35,16 @@ import org.eclipse.etrice.core.genmodel.etricegen.AbstractInstance;
import org.eclipse.etrice.core.genmodel.etricegen.ActorInstance;
import org.eclipse.etrice.core.genmodel.etricegen.ActorInterfaceInstance;
import org.eclipse.etrice.core.genmodel.etricegen.IDiagnostician;
+import org.eclipse.etrice.core.genmodel.etricegen.InstanceBase;
import org.eclipse.etrice.core.genmodel.etricegen.InterfaceItemInstance;
import org.eclipse.etrice.core.genmodel.etricegen.OptionalActorInstance;
-import org.eclipse.etrice.core.genmodel.etricegen.PortInstance;
import org.eclipse.etrice.core.genmodel.etricegen.Root;
import org.eclipse.etrice.core.genmodel.etricegen.ServiceImplInstance;
import org.eclipse.etrice.core.genmodel.etricegen.StructureInstance;
import org.eclipse.etrice.core.genmodel.etricegen.SubSystemInstance;
+import org.eclipse.etrice.core.genmodel.etricegen.Wire;
+import org.eclipse.etrice.core.genmodel.etricegen.WiredStructureClass;
+import org.eclipse.etrice.core.genmodel.etricegen.WiredSubSystemClass;
import org.eclipse.etrice.core.room.ActorClass;
import org.eclipse.etrice.core.room.ActorRef;
import org.eclipse.etrice.core.room.CommunicationType;
@@ -65,6 +69,7 @@ import org.eclipse.xtext.xbase.lib.Functions.Function1;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
import org.eclipse.xtext.xbase.lib.IteratorExtensions;
import org.eclipse.xtext.xbase.lib.ListExtensions;
+import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
@Singleton
@SuppressWarnings("all")
@@ -97,6 +102,22 @@ public class NodeGen {
private IDiagnostician diagnostician;
public void doGenerate(final Root root) {
+ HashMap<SubSystemClass,WiredSubSystemClass> _hashMap = new HashMap<SubSystemClass, WiredSubSystemClass>();
+ final HashMap<SubSystemClass,WiredSubSystemClass> sscc2wired = _hashMap;
+ EList<WiredStructureClass> _wiredInstances = root.getWiredInstances();
+ final Function1<WiredStructureClass,Boolean> _function = new Function1<WiredStructureClass,Boolean>() {
+ public Boolean apply(final WiredStructureClass w) {
+ return Boolean.valueOf((w instanceof WiredSubSystemClass));
+ }
+ };
+ Iterable<WiredStructureClass> _filter = IterableExtensions.<WiredStructureClass>filter(_wiredInstances, _function);
+ final Procedure1<WiredStructureClass> _function_1 = new Procedure1<WiredStructureClass>() {
+ public void apply(final WiredStructureClass w) {
+ SubSystemClass _subSystemClass = ((WiredSubSystemClass) w).getSubSystemClass();
+ sscc2wired.put(_subSystemClass, ((WiredSubSystemClass) w));
+ }
+ };
+ IterableExtensions.<WiredStructureClass>forEach(_filter, _function_1);
Collection<NodeRef> _nodeRefs = ETMapUtil.getNodeRefs();
for (final NodeRef nr : _nodeRefs) {
List<String> _subSystemInstancePaths = ETMapUtil.getSubSystemInstancePaths(nr);
@@ -105,14 +126,16 @@ public class NodeGen {
StructureInstance _instance = root.getInstance(instpath);
final SubSystemInstance ssi = ((SubSystemInstance) _instance);
SubSystemClass _subSystemClass = ssi.getSubSystemClass();
- String _generationTargetPath = this._roomExtensions.getGenerationTargetPath(_subSystemClass);
+ final WiredSubSystemClass wired = sscc2wired.get(_subSystemClass);
SubSystemClass _subSystemClass_1 = ssi.getSubSystemClass();
- String _path = this._roomExtensions.getPath(_subSystemClass_1);
- final String path = (_generationTargetPath + _path);
+ String _generationTargetPath = this._roomExtensions.getGenerationTargetPath(_subSystemClass_1);
SubSystemClass _subSystemClass_2 = ssi.getSubSystemClass();
- String _generationInfoPath = this._roomExtensions.getGenerationInfoPath(_subSystemClass_2);
+ String _path = this._roomExtensions.getPath(_subSystemClass_2);
+ final String path = (_generationTargetPath + _path);
SubSystemClass _subSystemClass_3 = ssi.getSubSystemClass();
- String _path_1 = this._roomExtensions.getPath(_subSystemClass_3);
+ String _generationInfoPath = this._roomExtensions.getGenerationInfoPath(_subSystemClass_3);
+ SubSystemClass _subSystemClass_4 = ssi.getSubSystemClass();
+ String _path_1 = this._roomExtensions.getPath(_subSystemClass_4);
final String infopath = (_generationInfoPath + _path_1);
final String file = this._javaExtensions.getJavaFileName(nr, ssi);
this.checkDataPorts(ssi);
@@ -123,14 +146,14 @@ public class NodeGen {
for (final PhysicalThread thread : _threads) {
{
EList<ActorInstance> _allContainedInstances = ssi.getAllContainedInstances();
- final Function1<ActorInstance,Boolean> _function = new Function1<ActorInstance,Boolean>() {
+ final Function1<ActorInstance,Boolean> _function_2 = new Function1<ActorInstance,Boolean>() {
public Boolean apply(final ActorInstance ai) {
PhysicalThread _physicalThread = ETMapUtil.getPhysicalThread(ai);
boolean _equals = Objects.equal(_physicalThread, thread);
return Boolean.valueOf(_equals);
}
};
- final Iterable<ActorInstance> instancesOnThread = IterableExtensions.<ActorInstance>filter(_allContainedInstances, _function);
+ final Iterable<ActorInstance> instancesOnThread = IterableExtensions.<ActorInstance>filter(_allContainedInstances, _function_2);
boolean _isEmpty = IterableExtensions.isEmpty(instancesOnThread);
boolean _not = (!_isEmpty);
if (_not) {
@@ -138,7 +161,7 @@ public class NodeGen {
}
}
}
- CharSequence _generate = this.generate(root, ssi, usedThreads);
+ CharSequence _generate = this.generate(root, ssi, wired, usedThreads);
this.fileIO.generateFile("generating Node implementation", path, infopath, file, _generate);
boolean _hasVariableService = this.dataConfigExt.hasVariableService(ssi);
if (_hasVariableService) {
@@ -185,7 +208,7 @@ public class NodeGen {
return result;
}
- public CharSequence generate(final Root root, final SubSystemInstance comp, final HashSet<PhysicalThread> usedThreads) {
+ public CharSequence generate(final Root root, final SubSystemInstance comp, final WiredSubSystemClass wired, final HashSet<PhysicalThread> usedThreads) {
CharSequence _xblockexpression = null;
{
final SubSystemClass cc = comp.getSubSystemClass();
@@ -231,6 +254,8 @@ public class NodeGen {
_builder.newLine();
_builder.append("import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;");
_builder.newLine();
+ _builder.append("import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;");
+ _builder.newLine();
_builder.append("import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;");
_builder.newLine();
_builder.append("import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;");
@@ -400,92 +425,6 @@ public class NodeGen {
_builder.newLineIfNotEmpty();
}
}
- _builder.append("\t\t");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("// port to peer port mappings");
- _builder.newLine();
- {
- BasicEList<AbstractInstance> _allSubInstances = this._roomExtensions.getAllSubInstances(comp);
- for(final AbstractInstance ai_1 : _allSubInstances) {
- _builder.append("\t\t");
- EList<? extends InterfaceItemInstance> _xifexpression = null;
- if ((ai_1 instanceof ActorInstance)) {
- EList<InterfaceItemInstance> _orderedIfItemInstances = ((ActorInstance) ai_1).getOrderedIfItemInstances();
- _xifexpression = _orderedIfItemInstances;
- } else {
- EList<PortInstance> _ports = ai_1.getPorts();
- _xifexpression = _ports;
- }
- final EList<? extends InterfaceItemInstance> ports = _xifexpression;
- _builder.newLineIfNotEmpty();
- {
- for(final InterfaceItemInstance pi : ports) {
- {
- EList<InterfaceItemInstance> _peers = pi.getPeers();
- int _size = _peers.size();
- boolean _greaterThan = (_size > 0);
- if (_greaterThan) {
- _builder.append("\t\t");
- _builder.append("addPathToPeers(\"");
- String _path_1 = pi.getPath();
- _builder.append(_path_1, " ");
- _builder.append("\", ");
- {
- EList<InterfaceItemInstance> _peers_1 = pi.getPeers();
- boolean _hasElements = false;
- for(final InterfaceItemInstance peer : _peers_1) {
- if (!_hasElements) {
- _hasElements = true;
- } else {
- _builder.appendImmediate(",", " ");
- }
- _builder.append("\"");
- String _path_2 = peer.getPath();
- _builder.append(_path_2, " ");
- _builder.append("\"");
- }
- }
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
- _builder.append("\t\t");
- EList<ServiceImplInstance> _xifexpression_1 = null;
- if ((ai_1 instanceof ActorInterfaceInstance)) {
- EList<ServiceImplInstance> _providedServices = ((ActorInterfaceInstance) ai_1).getProvidedServices();
- _xifexpression_1 = _providedServices;
- } else {
- _xifexpression_1 = null;
- }
- final EList<ServiceImplInstance> services = _xifexpression_1;
- _builder.newLineIfNotEmpty();
- {
- boolean _notEquals = (!Objects.equal(services, null));
- if (_notEquals) {
- {
- for(final ServiceImplInstance svc : services) {
- _builder.append("\t\t");
- _builder.append("addPathToPeers(\"");
- String _path_3 = ai_1.getPath();
- _builder.append(_path_3, " ");
- _builder.append("/");
- ProtocolClass _protocol = svc.getProtocol();
- String _fullyQualifiedName = this._roomExtensions.getFullyQualifiedName(_protocol);
- _builder.append(_fullyQualifiedName, " ");
- _builder.append("\", \"");
- String _path_4 = svc.getPath();
- _builder.append(_path_4, " ");
- _builder.append("\");");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
- }
- }
_builder.newLine();
_builder.append("\t\t");
_builder.append("// sub actors");
@@ -495,8 +434,8 @@ public class NodeGen {
for(final ActorRef sub : _actorRefs) {
{
int _multiplicity = sub.getMultiplicity();
- boolean _greaterThan_1 = (_multiplicity > 1);
- if (_greaterThan_1) {
+ boolean _greaterThan = (_multiplicity > 1);
+ if (_greaterThan) {
_builder.append("\t\t");
_builder.append("for (int i=0; i<");
int _multiplicity_1 = sub.getMultiplicity();
@@ -560,16 +499,16 @@ public class NodeGen {
_builder.append("\t\t");
_builder.newLine();
_builder.append("\t\t");
- _builder.append("// wire optional actor interfaces with services");
+ _builder.append("// create service brokers in optional actor interfaces");
_builder.newLine();
{
- BasicEList<AbstractInstance> _allSubInstances_1 = this._roomExtensions.getAllSubInstances(comp);
+ BasicEList<AbstractInstance> _allSubInstances = this._roomExtensions.getAllSubInstances(comp);
final Function1<AbstractInstance,Boolean> _function_1 = new Function1<AbstractInstance,Boolean>() {
public Boolean apply(final AbstractInstance inst) {
return Boolean.valueOf((inst instanceof ActorInterfaceInstance));
}
};
- Iterable<AbstractInstance> _filter = IterableExtensions.<AbstractInstance>filter(_allSubInstances_1, _function_1);
+ Iterable<AbstractInstance> _filter = IterableExtensions.<AbstractInstance>filter(_allSubInstances, _function_1);
final Function1<AbstractInstance,ActorInterfaceInstance> _function_2 = new Function1<AbstractInstance,ActorInterfaceInstance>() {
public ActorInterfaceInstance apply(final AbstractInstance inst) {
return ((ActorInterfaceInstance) inst);
@@ -583,21 +522,35 @@ public class NodeGen {
_builder.append("\t\t");
_builder.append("\t");
_builder.append("OptionalActorInterfaceBase oai = (OptionalActorInterfaceBase) getObject(\"");
- String _path_5 = aii.getPath();
- _builder.append(_path_5, " ");
+ String _path_1 = aii.getPath();
+ _builder.append(_path_1, " ");
_builder.append("\");");
_builder.newLineIfNotEmpty();
{
- EList<ServiceImplInstance> _providedServices_1 = aii.getProvidedServices();
- for(final ServiceImplInstance svc_1 : _providedServices_1) {
+ EList<ServiceImplInstance> _providedServices = aii.getProvidedServices();
+ for(final ServiceImplInstance svc : _providedServices) {
_builder.append("\t\t");
_builder.append("\t");
_builder.append("new InterfaceItemBroker(oai, \"");
- ProtocolClass _protocol_1 = svc_1.getProtocol();
- String _fullyQualifiedName_1 = this._roomExtensions.getFullyQualifiedName(_protocol_1);
- _builder.append(_fullyQualifiedName_1, " ");
+ ProtocolClass _protocol = svc.getProtocol();
+ String _fullyQualifiedName = this._roomExtensions.getFullyQualifiedName(_protocol);
+ _builder.append(_fullyQualifiedName, " ");
_builder.append("\", 0);");
_builder.newLineIfNotEmpty();
+ _builder.append("\t\t");
+ _builder.append("\t");
+ _builder.append("InterfaceItemBase.connect(this, \"");
+ String _path_2 = svc.getPath();
+ _builder.append(_path_2, " ");
+ _builder.append("\", \"");
+ String _path_3 = aii.getPath();
+ String _plus = (_path_3 + Character.valueOf(InstanceBase.pathDelim));
+ ProtocolClass _protocol_1 = svc.getProtocol();
+ String _fullyQualifiedName_1 = this._roomExtensions.getFullyQualifiedName(_protocol_1);
+ String _plus_1 = (_plus + _fullyQualifiedName_1);
+ _builder.append(_plus_1, " ");
+ _builder.append("\");");
+ _builder.newLineIfNotEmpty();
}
}
_builder.append("\t\t");
@@ -608,33 +561,62 @@ public class NodeGen {
_builder.append("\t\t");
_builder.newLine();
_builder.append("\t\t");
+ _builder.append("// wiring");
+ _builder.newLine();
+ {
+ EList<Wire> _wires = wired.getWires();
+ for(final Wire wire : _wires) {
+ _builder.append("\t\t");
+ String _xifexpression = null;
+ boolean _isDataDriven = wire.isDataDriven();
+ if (_isDataDriven) {
+ _xifexpression = "DataPortBase";
+ } else {
+ _xifexpression = "InterfaceItemBase";
+ }
+ _builder.append(_xifexpression, " ");
+ _builder.append(".connect(this, \"");
+ EList<String> _path1 = wire.getPath1();
+ String _join = IterableExtensions.join(_path1, "/");
+ _builder.append(_join, " ");
+ _builder.append("\", \"");
+ EList<String> _path2 = wire.getPath2();
+ String _join_1 = IterableExtensions.join(_path2, "/");
+ _builder.append(_join_1, " ");
+ _builder.append("\");");
+ _builder.newLineIfNotEmpty();
+ }
+ }
+ _builder.append("\t\t");
+ _builder.newLine();
+ _builder.append("\t\t");
_builder.append("// apply instance attribute configurations");
_builder.newLine();
{
EList<ActorInstance> _allContainedInstances_1 = comp.getAllContainedInstances();
- for(final ActorInstance ai_2 : _allContainedInstances_1) {
+ for(final ActorInstance ai_1 : _allContainedInstances_1) {
_builder.append("\t\t");
- final CharSequence cfg = this.configGenAddon.genActorInstanceConfig(ai_2, "inst");
+ final CharSequence cfg = this.configGenAddon.genActorInstanceConfig(ai_1, "inst");
_builder.newLineIfNotEmpty();
{
int _length = cfg.length();
- boolean _greaterThan_2 = (_length > 0);
- if (_greaterThan_2) {
+ boolean _greaterThan_1 = (_length > 0);
+ if (_greaterThan_1) {
_builder.append("\t\t");
_builder.append("{");
_builder.newLine();
_builder.append("\t\t");
_builder.append("\t");
- ActorClass _actorClass = ai_2.getActorClass();
+ ActorClass _actorClass = ai_1.getActorClass();
String _name_11 = _actorClass.getName();
_builder.append(_name_11, " ");
_builder.append(" inst = (");
- ActorClass _actorClass_1 = ai_2.getActorClass();
+ ActorClass _actorClass_1 = ai_1.getActorClass();
String _name_12 = _actorClass_1.getName();
_builder.append(_name_12, " ");
_builder.append(") getObject(\"");
- String _path_6 = ai_2.getPath();
- _builder.append(_path_6, " ");
+ String _path_4 = ai_1.getPath();
+ _builder.append(_path_4, " ");
_builder.append("\");");
_builder.newLineIfNotEmpty();
_builder.append("\t\t");
diff --git a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/OptionalActorFactoryGen.java b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/OptionalActorFactoryGen.java
index b2cb7cbf4..871cbb72e 100644
--- a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/OptionalActorFactoryGen.java
+++ b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/OptionalActorFactoryGen.java
@@ -1,20 +1,30 @@
package org.eclipse.etrice.generator.java.gen;
+import com.google.common.base.Objects;
import com.google.inject.Inject;
-import org.eclipse.emf.common.util.BasicEList;
+import java.util.HashMap;
+import java.util.List;
import org.eclipse.emf.common.util.EList;
-import org.eclipse.etrice.core.genmodel.etricegen.AbstractInstance;
-import org.eclipse.etrice.core.genmodel.etricegen.ActorInstance;
import org.eclipse.etrice.core.genmodel.etricegen.InterfaceItemInstance;
+import org.eclipse.etrice.core.genmodel.etricegen.OpenBinding;
+import org.eclipse.etrice.core.genmodel.etricegen.OpenServiceConnection;
import org.eclipse.etrice.core.genmodel.etricegen.OptionalActorInstance;
-import org.eclipse.etrice.core.genmodel.etricegen.PortInstance;
import org.eclipse.etrice.core.genmodel.etricegen.Root;
+import org.eclipse.etrice.core.genmodel.etricegen.WiredActorClass;
+import org.eclipse.etrice.core.genmodel.etricegen.WiredStructureClass;
import org.eclipse.etrice.core.room.ActorClass;
+import org.eclipse.etrice.core.room.CommunicationType;
+import org.eclipse.etrice.core.room.Port;
+import org.eclipse.etrice.core.room.ProtocolClass;
+import org.eclipse.etrice.core.room.util.RoomHelpers;
import org.eclipse.etrice.generator.base.IGeneratorFileIo;
import org.eclipse.etrice.generator.generic.RoomExtensions;
import org.eclipse.etrice.generator.java.gen.JavaExtensions;
import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.xbase.lib.Extension;
+import org.eclipse.xtext.xbase.lib.Functions.Function1;
+import org.eclipse.xtext.xbase.lib.IterableExtensions;
+import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
@SuppressWarnings("all")
public class OptionalActorFactoryGen {
@@ -30,10 +40,27 @@ public class OptionalActorFactoryGen {
private RoomExtensions _roomExtensions;
public void doGenerate(final Root root) {
+ HashMap<ActorClass,WiredActorClass> _hashMap = new HashMap<ActorClass, WiredActorClass>();
+ final HashMap<ActorClass,WiredActorClass> ac2wired = _hashMap;
+ EList<WiredStructureClass> _wiredInstances = root.getWiredInstances();
+ final Function1<WiredStructureClass,Boolean> _function = new Function1<WiredStructureClass,Boolean>() {
+ public Boolean apply(final WiredStructureClass w) {
+ return Boolean.valueOf((w instanceof WiredActorClass));
+ }
+ };
+ Iterable<WiredStructureClass> _filter = IterableExtensions.<WiredStructureClass>filter(_wiredInstances, _function);
+ final Procedure1<WiredStructureClass> _function_1 = new Procedure1<WiredStructureClass>() {
+ public void apply(final WiredStructureClass w) {
+ ActorClass _actorClass = ((WiredActorClass) w).getActorClass();
+ ac2wired.put(_actorClass, ((WiredActorClass) w));
+ }
+ };
+ IterableExtensions.<WiredStructureClass>forEach(_filter, _function_1);
EList<OptionalActorInstance> _optionalInstances = root.getOptionalInstances();
for (final OptionalActorInstance oi : _optionalInstances) {
{
final ActorClass ac = oi.getActorClass();
+ final WiredActorClass wired = ac2wired.get(ac);
String _generationTargetPath = this._roomExtensions.getGenerationTargetPath(ac);
String _path = this._roomExtensions.getPath(ac);
final String path = (_generationTargetPath + _path);
@@ -41,13 +68,13 @@ public class OptionalActorFactoryGen {
String _path_1 = this._roomExtensions.getPath(ac);
final String infopath = (_generationInfoPath + _path_1);
final String file = this._javaExtensions.getJavaFactoryFileName(ac);
- CharSequence _generate = this.generate(root, oi);
+ CharSequence _generate = this.generate(root, oi, wired);
this.fileIO.generateFile("generating ActorClass Interface implementation", path, infopath, file, _generate);
}
}
}
- public CharSequence generate(final Root root, final OptionalActorInstance oi) {
+ public CharSequence generate(final Root root, final OptionalActorInstance oi, final WiredActorClass wired) {
CharSequence _xblockexpression = null;
{
final ActorClass ac = oi.getActorClass();
@@ -71,7 +98,7 @@ public class OptionalActorFactoryGen {
_builder.newLine();
_builder.append("import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;");
_builder.newLine();
- _builder.append("import org.eclipse.etrice.runtime.java.modelbase.PathToPeers;");
+ _builder.append("import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;");
_builder.newLine();
_builder.newLine();
_builder.append("public class ");
@@ -81,74 +108,12 @@ public class OptionalActorFactoryGen {
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
- _builder.append("private PathToPeers path2peers = new PathToPeers();");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
_builder.append("public ");
String _name_1 = ac.getName();
_builder.append(_name_1, " ");
_builder.append(" create(OptionalActorInterfaceBase ai, String name) {");
_builder.newLineIfNotEmpty();
_builder.append("\t\t");
- _builder.append("// set port mappings of this sub tree");
- _builder.newLine();
- {
- BasicEList<AbstractInstance> _allSubInstances = this._roomExtensions.getAllSubInstances(oi);
- for(final AbstractInstance ai : _allSubInstances) {
- _builder.append("\t\t");
- EList<? extends InterfaceItemInstance> _xifexpression = null;
- if ((ai instanceof ActorInstance)) {
- EList<InterfaceItemInstance> _orderedIfItemInstances = ((ActorInstance) ai).getOrderedIfItemInstances();
- _xifexpression = _orderedIfItemInstances;
- } else {
- EList<PortInstance> _ports = ai.getPorts();
- _xifexpression = _ports;
- }
- final EList<? extends InterfaceItemInstance> ports = _xifexpression;
- _builder.newLineIfNotEmpty();
- {
- for(final InterfaceItemInstance pi : ports) {
- {
- EList<InterfaceItemInstance> _peers = pi.getPeers();
- int _size = _peers.size();
- boolean _greaterThan = (_size > 0);
- if (_greaterThan) {
- _builder.append("\t\t");
- _builder.append("path2peers.put(\"");
- String _relPath = this.relPath(oi, pi);
- _builder.append(_relPath, " ");
- _builder.append("\", ");
- {
- EList<InterfaceItemInstance> _peers_1 = pi.getPeers();
- boolean _hasElements = false;
- for(final InterfaceItemInstance peer : _peers_1) {
- if (!_hasElements) {
- _hasElements = true;
- } else {
- _builder.appendImmediate(",", " ");
- }
- _builder.append("\"");
- String _relPath_1 = this.relPath(oi, peer);
- _builder.append(_relPath_1, " ");
- _builder.append("\"");
- }
- }
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
- }
- }
- _builder.append("\t\t");
- _builder.append("ai.setPath2peers(path2peers);");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.newLine();
- _builder.append("\t\t");
_builder.append("// instantiate sub tree");
_builder.newLine();
_builder.append("\t\t");
@@ -162,8 +127,88 @@ public class OptionalActorFactoryGen {
_builder.append("\t\t");
_builder.newLine();
_builder.append("\t\t");
- _builder.append("ai.setPath2peers(null);");
+ _builder.append("// wiring");
_builder.newLine();
+ {
+ List<Port> _allEndPorts = RoomHelpers.getAllEndPorts(ac);
+ final Function1<Port,Boolean> _function = new Function1<Port,Boolean>() {
+ public Boolean apply(final Port p) {
+ boolean _isExternal = RoomHelpers.isExternal(p);
+ return Boolean.valueOf(_isExternal);
+ }
+ };
+ Iterable<Port> _filter = IterableExtensions.<Port>filter(_allEndPorts, _function);
+ for(final Port port : _filter) {
+ _builder.append("\t\t");
+ String _xifexpression = null;
+ boolean _isDataDriven = RoomHelpers.isDataDriven(port);
+ if (_isDataDriven) {
+ _xifexpression = "DataPortBase";
+ } else {
+ _xifexpression = "InterfaceItemBase";
+ }
+ _builder.append(_xifexpression, " ");
+ _builder.append(".connect(ai, \"");
+ String _name_4 = port.getName();
+ _builder.append(_name_4, " ");
+ _builder.append("\", name+\"/");
+ String _name_5 = port.getName();
+ _builder.append(_name_5, " ");
+ _builder.append("\");");
+ _builder.newLineIfNotEmpty();
+ }
+ }
+ {
+ EList<OpenBinding> _openBindings = wired.getOpenBindings();
+ for(final OpenBinding open : _openBindings) {
+ _builder.append("\t\t");
+ String _xifexpression_1 = null;
+ Port _port = open.getPort();
+ boolean _isDataDriven_1 = RoomHelpers.isDataDriven(_port);
+ if (_isDataDriven_1) {
+ _xifexpression_1 = "DataPortBase";
+ } else {
+ _xifexpression_1 = "InterfaceItemBase";
+ }
+ _builder.append(_xifexpression_1, " ");
+ _builder.append(".connect(ai, \"");
+ Port _port_1 = open.getPort();
+ String _name_6 = _port_1.getName();
+ _builder.append(_name_6, " ");
+ _builder.append("\", name+\"/");
+ EList<String> _path = open.getPath();
+ String _join = IterableExtensions.join(_path, "/");
+ _builder.append(_join, " ");
+ _builder.append("\");");
+ _builder.newLineIfNotEmpty();
+ }
+ }
+ {
+ EList<OpenServiceConnection> _requiredServices = wired.getRequiredServices();
+ for(final OpenServiceConnection req : _requiredServices) {
+ _builder.append("\t\t");
+ String _xifexpression_2 = null;
+ ProtocolClass _protocol = req.getProtocol();
+ CommunicationType _commType = _protocol.getCommType();
+ boolean _equals = Objects.equal(_commType, CommunicationType.DATA_DRIVEN);
+ if (_equals) {
+ _xifexpression_2 = "DataPortBase";
+ } else {
+ _xifexpression_2 = "InterfaceItemBase";
+ }
+ _builder.append(_xifexpression_2, " ");
+ _builder.append(".connect(ai, \"");
+ ProtocolClass _protocol_1 = req.getProtocol();
+ String _fullyQualifiedName = this._roomExtensions.getFullyQualifiedName(_protocol_1);
+ _builder.append(_fullyQualifiedName, " ");
+ _builder.append("\", name+\"/");
+ EList<String> _path_1 = req.getPath();
+ String _join_1 = IterableExtensions.join(_path_1, "/");
+ _builder.append(_join_1, " ");
+ _builder.append("\");");
+ _builder.newLineIfNotEmpty();
+ }
+ }
_builder.append("\t\t");
_builder.newLine();
_builder.append("\t\t");
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors1.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors1.zip
index c168ddad5..00424a3c4 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors1.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors1.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors2.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors2.zip
index f6ebe39a9..e4831bb89 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors2.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors2.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors3.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors3.zip
index 84d435310..9d607b7d2 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors3.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors3.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors4.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors4.zip
index 86f97ea49..156ead08f 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors4.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors4.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors5.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors5.zip
index 4402dbb04..c11a8965b 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors5.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors5.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors6.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors6.zip
index 1da6167a1..90b373467 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors6.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors6.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors7.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors7.zip
index 56cd01de2..efb22795b 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors7.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors7.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors8.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors8.zip
index 52c28cc7c..f8519f7b8 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors8.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors8.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors9.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors9.zip
index 5df90f136..464c0988f 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors9.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors9.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.c.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.c.zip
index 5bc3a2428..5f1ac138b 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.c.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.c.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.java.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.java.zip
index 78c21aa47..ca82ef561 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.java.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.java.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.c.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.c.zip
index a8b0b5d1f..b46447d83 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.c.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.c.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.java.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.java.zip
index f498db24a..4c4ed9a4e 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.java.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.java.zip
Binary files differ
diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/IRTObject.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/IRTObject.java
index 42d95caba..63ff03668 100644
--- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/IRTObject.java
+++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/IRTObject.java
@@ -15,28 +15,85 @@ package org.eclipse.etrice.runtime.java.messaging;
import java.util.List;
/**
- * The runtime object interface
+ * The runtime object interface for all runtime objects. Those objects form a tree with a single root.
+ * Since each object has a name it also has a unique path in the tree.
+ *
* @author Thomas Schuetz
* @author Henrik Rentz-Reichert
*
*/
+/**
+ * @author hrentz
+ *
+ */
public interface IRTObject {
+ /**
+ * The delimiter character for path segments.
+ */
static final char PATH_DELIM = '/';
+
+ /**
+ * The delimiter character for path segments when the path should be used as name.
+ */
static final char PATHNAME_DELIM = '_';
+
+ /**
+ * An empty name.
+ */
static final String NO_NAME = "<no name>";
+ /**
+ * @return the name of the object (has to be unique among siblings)
+ */
String getName();
+
+ /**
+ * @return a list of all child objects
+ */
List<IRTObject> getChildren();
+
+ /**
+ * @return the parent object in the instance tree
+ */
IRTObject getParent();
+
+ /**
+ * @return the root object of the tree (that has no parent)
+ */
IRTObject getRoot();
+
+ /**
+ * @param name the name of a child
+ * @return the child with the given name or {@code null} if not found
+ */
IRTObject getChild(String name);
+
+ /**
+ * @param path a path with segments delimited by {@link #PATH_DELIM}. It can be relative or absolute.
+ * @return the object with this instance path or {@code null}
+ */
IRTObject getObject(String path);
+ /**
+ * @param delim a delimiter character
+ * @return the path with segments delimited by the given character
+ */
String getInstancePath(char delim);
+
+ /**
+ * @return the absolute instance path of this object using {@link #PATH_DELIM}
+ */
String getInstancePath();
+
+ /**
+ * @return the absolute instance path of this object using {@link #PATHNAME_DELIM}
+ */
String getInstancePathName();
+ /**
+ * @param path an absolute path
+ * @return the thread to which this path is mapped (used to query this path from the parent object or from the sub system)
+ */
int getThreadForPath(String path);
- List<String> getPeersForPath(String path);
}
diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/RTObject.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/RTObject.java
index e10425759..39705aeb1 100644
--- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/RTObject.java
+++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/RTObject.java
@@ -9,7 +9,6 @@
package org.eclipse.etrice.runtime.java.messaging;
import java.util.ArrayList;
-import java.util.List;
/**
* An implementation of the IRTObject interface using a hierarchical structure
@@ -89,7 +88,7 @@ public class RTObject implements IRTObject {
String first = segments[0];
for (String segment : segments) {
- if (segment==first) {
+ if (isAbsolute && segment==first) {
if (!segment.equals(current.getName()))
return null;
}
@@ -131,16 +130,6 @@ public class RTObject implements IRTObject {
return parent.getThreadForPath(path);
return -1;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.etrice.runtime.java.messaging.IRTObject#getPeersForPath(java.lang.String)
- */
- @Override
- public List<String> getPeersForPath(String path) {
- if (parent!=null)
- return parent.getPeersForPath(path);
- return null;
- }
private String toStringRecursive(String indent) {
StringBuilder result = new StringBuilder(indent+toString()+"\n");
diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/DataPortBase.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/DataPortBase.java
index ba5d575e7..48d1df033 100644
--- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/DataPortBase.java
+++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/DataPortBase.java
@@ -35,4 +35,14 @@ public class DataPortBase extends RTObject {
return localId;
}
+ public static void connect(IRTObject obj, String path1, String path2) {
+ IRTObject obj1 = obj.getObject(path1);
+ IRTObject obj2 = obj.getObject(path2);
+ if (obj1 instanceof DataSendPort && obj2 instanceof DataReceivePort) {
+ ((DataReceivePort)obj2).connect((DataSendPort) obj1);
+ }
+ else if (obj2 instanceof DataSendPort && obj1 instanceof DataReceivePort) {
+ ((DataReceivePort)obj1).connect((DataSendPort) obj2);
+ }
+ }
}
diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/DataReceivePort.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/DataReceivePort.java
index f35b70c4a..d365b5a4f 100644
--- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/DataReceivePort.java
+++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/DataReceivePort.java
@@ -12,8 +12,6 @@
package org.eclipse.etrice.runtime.java.modelbase;
-import java.util.List;
-
import org.eclipse.etrice.runtime.java.messaging.IRTObject;
/**
@@ -28,12 +26,6 @@ public abstract class DataReceivePort extends DataPortBase {
*/
protected DataReceivePort(IRTObject parent, String name, int localId) {
super(parent, name, localId);
-
- List<String> peerPaths = getParent().getPeersForPath(getInstancePath());
- if (peerPaths!=null && !peerPaths.isEmpty()) {
- IRTObject object = getObject(peerPaths.get(0));
- connect((DataSendPort) object);
- }
}
/**
diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/DataSendPort.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/DataSendPort.java
index 189a441cd..4852f91b5 100644
--- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/DataSendPort.java
+++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/DataSendPort.java
@@ -12,8 +12,6 @@
package org.eclipse.etrice.runtime.java.modelbase;
-import java.util.List;
-
import org.eclipse.etrice.runtime.java.messaging.IRTObject;
/**
@@ -24,14 +22,5 @@ public class DataSendPort extends DataPortBase {
public DataSendPort(IRTObject parent, String name, int localId) {
super(parent, name, localId);
-
- List<String> peerPaths = getParent().getPeersForPath(getInstancePath());
- if (peerPaths!=null) {
- for (String peerPath : peerPaths) {
- IRTObject object = getObject(peerPath);
- if (object instanceof DataReceivePort)
- ((DataReceivePort)object).connect(this);
- }
- }
}
}
diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/IInterfaceItem.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/IInterfaceItem.java
new file mode 100644
index 000000000..851cca755
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/IInterfaceItem.java
@@ -0,0 +1,8 @@
+package org.eclipse.etrice.runtime.java.modelbase;
+
+import org.eclipse.etrice.runtime.java.messaging.IRTObject;
+
+public interface IInterfaceItem extends IRTObject {
+
+ IInterfaceItem connectWith(IInterfaceItem peer);
+}
diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/IInterfaceItemBroker.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/IInterfaceItemBroker.java
index d8b4dbb09..996b0f3eb 100644
--- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/IInterfaceItemBroker.java
+++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/IInterfaceItemBroker.java
@@ -12,6 +12,7 @@
package org.eclipse.etrice.runtime.java.modelbase;
+
/**
* This is just a marker interface.
*
@@ -19,6 +20,6 @@ package org.eclipse.etrice.runtime.java.modelbase;
* @author Henrik Rentz-Reichert
*
*/
-public interface IInterfaceItemBroker {
-
+public interface IInterfaceItemBroker extends IInterfaceItem {
+
}
diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/IReplicatedInterfaceItem.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/IReplicatedInterfaceItem.java
index 0899f67bc..ad0ee3eac 100644
--- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/IReplicatedInterfaceItem.java
+++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/IReplicatedInterfaceItem.java
@@ -16,7 +16,7 @@ package org.eclipse.etrice.runtime.java.modelbase;
* @author Henrik Rentz-Reichert
*
*/
-public interface IReplicatedInterfaceItem {
+public interface IReplicatedInterfaceItem extends IInterfaceItem {
InterfaceItemBase createSubInterfaceItem();
void removeItem(InterfaceItemBase item);
diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/InterfaceItemBase.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/InterfaceItemBase.java
index b05d3b820..df4441621 100644
--- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/InterfaceItemBase.java
+++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/InterfaceItemBase.java
@@ -8,8 +8,6 @@
package org.eclipse.etrice.runtime.java.modelbase;
-import java.util.List;
-
import org.eclipse.etrice.runtime.java.messaging.AbstractMessageReceiver;
import org.eclipse.etrice.runtime.java.messaging.Address;
import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
@@ -23,7 +21,7 @@ import org.eclipse.etrice.runtime.java.messaging.RTServices;
*
* @author Henrik Rentz-Reichert
*/
-public abstract class InterfaceItemBase extends AbstractMessageReceiver {
+public abstract class InterfaceItemBase extends AbstractMessageReceiver implements IInterfaceItem {
/**
* If this is part of an {@link IReplicatedInterfaceItem} then the
@@ -38,7 +36,7 @@ public abstract class InterfaceItemBase extends AbstractMessageReceiver {
private int localId;
private int idx;
protected Address peerAddress = null;
- private InterfaceItemBase peer;
+ private IInterfaceItem peer;
/**
@@ -67,27 +65,9 @@ public abstract class InterfaceItemBase extends AbstractMessageReceiver {
this.ownMsgReceiver = msgSvc;
}
-
- if (replicator==null)
- connectWithPeer();
- }
-
- protected void connectWithPeer() {
- List<String> peerPaths = getParent().getPeersForPath(getInstancePath());
- if (peerPaths!=null && !peerPaths.isEmpty()) {
- IRTObject object = getObject(peerPaths.get(0));
- InterfaceItemBase peer = null;
- if (object instanceof InterfaceItemBase) {
- peer = ((InterfaceItemBase) object);
- }
- else if (object instanceof IReplicatedInterfaceItem) {
- peer = ((IReplicatedInterfaceItem) object).createSubInterfaceItem();
- }
- connectWith(peer);
- }
}
- protected synchronized InterfaceItemBase connectWith(InterfaceItemBase peer) {
+ public synchronized IInterfaceItem connectWith(IInterfaceItem peer) {
if (peer!=null) {
this.peer = peer;
@@ -96,11 +76,18 @@ public abstract class InterfaceItemBase extends AbstractMessageReceiver {
return this.peer;
}
- // connect with each other
- peerAddress = peer.getAddress();
- peer.peerAddress = getAddress();
- this.peerMsgReceiver = peer.ownMsgReceiver;
- peer.peerMsgReceiver = ownMsgReceiver;
+ if (peer instanceof IReplicatedInterfaceItem)
+ peer = ((IReplicatedInterfaceItem) peer).createSubInterfaceItem();
+
+ if (peer instanceof InterfaceItemBase) {
+ InterfaceItemBase thePeer = (InterfaceItemBase) peer;
+
+ // connect with each other
+ peerAddress = thePeer.getAddress();
+ thePeer.peerAddress = getAddress();
+ this.peerMsgReceiver = thePeer.ownMsgReceiver;
+ thePeer.peerMsgReceiver = ownMsgReceiver;
+ }
}
@@ -110,7 +97,8 @@ public abstract class InterfaceItemBase extends AbstractMessageReceiver {
protected synchronized void disconnect() {
disconnectInternal();
if (peer!=null) {
- peer.disconnectInternal();
+ if (peer instanceof InterfaceItemBase)
+ ((InterfaceItemBase)peer).disconnectInternal();
peer = null;
}
}
@@ -170,4 +158,13 @@ public abstract class InterfaceItemBase extends AbstractMessageReceiver {
public String toString() {
return ((replicator!=null)?"sub ":"")+"port "+getName()+" "+getAddress()+" <-> "+getPeerAddress();
}
+
+ public static void connect(IRTObject obj, String path1, String path2) {
+ IRTObject obj1 = obj.getObject(path1);
+ IRTObject obj2 = obj.getObject(path2);
+
+ if (obj1 instanceof IInterfaceItem && obj2 instanceof IInterfaceItem) {
+ ((IInterfaceItem)obj1).connectWith((IInterfaceItem) obj2);
+ }
+ }
}
diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/InterfaceItemBroker.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/InterfaceItemBroker.java
index ba9be9804..70d2a2bf1 100644
--- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/InterfaceItemBroker.java
+++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/InterfaceItemBroker.java
@@ -12,9 +12,6 @@
package org.eclipse.etrice.runtime.java.modelbase;
-import java.util.List;
-
-import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.Message;
/**
@@ -39,8 +36,8 @@ public class InterfaceItemBroker extends InterfaceItemBase implements IInterface
// CAUTION: must NOT initialize firstPeer with null since is set in base class constructor and
// AFTERWARDS initialized ==> value is lost
- private IRTObject firstPeer;
- private InterfaceItemBase secondPeer;
+ private IInterfaceItem firstPeer;
+ private IInterfaceItem secondPeer;
public InterfaceItemBroker(IInterfaceItemOwner parent, String name, int localId) {
this(parent, name, localId, 0);
@@ -63,33 +60,19 @@ public class InterfaceItemBroker extends InterfaceItemBase implements IInterface
public void receive(Message msg) {
// ignore this, will never receive a message
}
-
- /* (non-Javadoc)
- * @see org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase#connectWithPeer()
- */
- protected void connectWithPeer() {
- List<String> peerPaths = getParent().getPeersForPath(getInstancePath());
- if (peerPaths!=null && !peerPaths.isEmpty()) {
- firstPeer = getObject(peerPaths.get(0));
- if (firstPeer instanceof InterfaceItemBroker) {
- if (((InterfaceItemBroker) firstPeer).firstPeer==null)
- ((InterfaceItemBroker) firstPeer).firstPeer = this;
- }
- }
- }
-
+
/* (non-Javadoc)
* @see org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase#connectWith(org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase)
*/
@Override
- public InterfaceItemBase connectWith(InterfaceItemBase peer) {
+ public IInterfaceItem connectWith(IInterfaceItem peer) {
if (firstPeer!=null) {
// we are already connected, lets connect our new peer with the previous one
secondPeer = peer;
// we don't want to change firstPeer, so make a copy
- IRTObject first = firstPeer;
+ IInterfaceItem first = firstPeer;
{
InterfaceItemBroker broker = this;
@@ -117,30 +100,18 @@ public class InterfaceItemBroker extends InterfaceItemBase implements IInterface
}
}
- InterfaceItemBase peer1 = null;
- InterfaceItemBase peer2 = peer;
-
- if (first instanceof IReplicatedInterfaceItem) {
- // get a new replicated sub port
- peer1 = ((IReplicatedInterfaceItem) first).createSubInterfaceItem();
- }
- else if (first instanceof InterfaceItemBase) {
- peer1 = (InterfaceItemBase) first;
- }
- else {
- assert(false): "unexpected peer kind";
- return null;
- }
-
- peer2.peerAddress = peer1.getAddress();
- peer2.peerMsgReceiver = peer1.ownMsgReceiver;
- peer1.peerAddress = peer2.getAddress();
- peer1.peerMsgReceiver = peer2.ownMsgReceiver;
-
- return peer1;
+ return first.connectWith(peer);
}
else {
firstPeer = peer;
+
+ if (firstPeer instanceof InterfaceItemBroker) {
+ // deal with the situation that two brokers aren't connected yet: make symmetrical and set also first peer
+ // of neighbor
+ InterfaceItemBroker neighbor = (InterfaceItemBroker) firstPeer;
+ if (neighbor.firstPeer==null)
+ neighbor.firstPeer = this;
+ }
return this;
}
@@ -158,7 +129,8 @@ public class InterfaceItemBroker extends InterfaceItemBase implements IInterface
public String toString() {
String peer1 = (firstPeer instanceof InterfaceItemBase)? (((InterfaceItemBase)firstPeer).getAddress().toString()+"("+firstPeer.getClass().toString()+")")
:(firstPeer instanceof ReplicatedInterfaceItemBase? (((ReplicatedInterfaceItemBase)firstPeer).toString()+"("+firstPeer.getClass().toString()+")"):"null");
- String peer2 = secondPeer==null? "null":(secondPeer.getAddress().toString()+"("+secondPeer.getClass().toString()+")");
+ String peer2 = (secondPeer instanceof InterfaceItemBase)? (((InterfaceItemBase)secondPeer).getAddress().toString()+"("+secondPeer.getClass().toString()+")")
+ :(secondPeer instanceof ReplicatedInterfaceItemBase? (((ReplicatedInterfaceItemBase)secondPeer).toString()+"("+secondPeer.getClass().toString()+")"):"null");
return "interface broker port "+getName()+" - 1. peer "+peer1+" 2. peer "+peer2;
}
}
diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/OptionalActorInterfaceBase.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/OptionalActorInterfaceBase.java
index dee0487b1..7ad1d4e6b 100644
--- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/OptionalActorInterfaceBase.java
+++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/OptionalActorInterfaceBase.java
@@ -15,9 +15,6 @@ package org.eclipse.etrice.runtime.java.modelbase;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.modelbase.RTSystemProtocol.RTSystemConjPort;
@@ -58,25 +55,6 @@ public abstract class OptionalActorInterfaceBase extends SystemPortOwner impleme
private String className;
/**
- * This map is set during optional actor creation by the factory.
- */
- private PathToPeers path2peers = null;
-
- /**
- * The path of this instance is used to determine correct mappings.
- * It is subtracted from incoming paths, then (relative) peer paths are looked up and
- * the result paths are turned into absolute ones by adding this again.
- *
- * @see #getPeersForPath(String)
- */
- private String parentPath;
-
- /**
- * This is equivalent to {@link #parentPath}+{@link #getName()}
- */
- private String ownPath;
-
- /**
* The thread (associated with the message service of this ID) that will be used by the
* optional actor instance.
*/
@@ -98,8 +76,6 @@ public abstract class OptionalActorInterfaceBase extends SystemPortOwner impleme
super(parent, name);
className = clsname;
subtreeThread = parent.getThread();
- parentPath = getInstancePath();
- ownPath = getInterfaceInstancePath();
RTSystemPort = new RTSystemConjPort(this, IFITEM_RTSystemPort);
}
@@ -123,112 +99,7 @@ public abstract class OptionalActorInterfaceBase extends SystemPortOwner impleme
public String getInterfaceInstancePath() {
return super.getInstancePath(PATH_DELIM);
}
-
- /**
- * If the path points to our <i>interior</i> (which should be always the case)
- * the we turn it into a relative one starting here.
- * It is important that our own interface item brokers are treated specially.
- *
- * @see org.eclipse.etrice.runtime.java.messaging.RTObject#getObject(java.lang.String)
- */
- @Override
- public IRTObject getObject(String path) {
- if (path.startsWith(ownPath)) {
- int sep = path.indexOf(PATH_DELIM, parentPath.length()+1);
- if (sep>=0 && sep<path.length()) {
- // we turn the path into a relative one and resolve it starting at this instance
-
- // path segment of the optional actor
- String optInst = path.substring(parentPath.length(), sep);
-
- // remainder
- path = path.substring(sep);
-
- // if remainder contains more than one segment it points into the optional actor
- if (path.indexOf(PATH_DELIM, 1)>=0)
- // we add the optional actor segment
- path = optInst+path;
- else {
- /* the port is our own port
- * a) on the interface ==> it is a broker and direct child
- * b) internal ==> it is a child of the optional actor
- */
- IRTObject obj = super.getObject(getName()+path);
- if (obj==null) {
- obj = super.getObject(getName()+optInst+path);
- }
- return obj;
- }
-
- // finally we have to prefix with our own name since the relative path has to start with that
- path = getName()+path;
- }
- }
-
- return super.getObject(path);
- }
-
- /**
- * Get list of peer paths.
- * <p>
- * This method delegates to its parent if {@link #getPath2peers()}{@code ==null}.
- * </p>
- * <p>
- * If an optional actor instance is created the used factory will set
- * its own path-to-peer mapping. Then the incoming path is made relative to
- * the created actor and the paths looked up in the map are made absolute again.
- *
- * @param path an absolute path
- * @return a list of absolute peer paths or {@code null} if not mapped
- */
- @Override
- public List<String> getPeersForPath(String path) {
- // if no mapping available we delegate to our parent (which is never null)
- if (getPath2peers()==null)
- return getParent().getPeersForPath(path);
-
- /* remove parent path+1 up to next delimiter (thus including the optional ref name)
- * e.g.
- * incoming path = /LS/appl/cont/opt/path/to/port
- * rel path = /path/to/port
- * result of lookup (to interface port) = /port
- * returned = /LS/appl/cont/opt/port (one of the interface port brokers)
- */
- int sep = path.indexOf(PATH_DELIM, parentPath.length()+1);
- if (sep<0 || sep>=path.length())
- return null;
-
- /* The optInstPath for scalar optional actors is parentPath/<name>.
- * However, for replicated actors it is parentPath/<name>:<idx>
- */
- String optInstPath = path.substring(0, sep);
- path = path.substring(sep);
-
- if (path.indexOf('/', 1)<0) {
- /*
- * This is an end port on the interface.
- * It is directly mapped to its broker (there is no mapping for it)
- */
- return Collections.singletonList(ownPath+path);
- }
-
- ArrayList<String> paths = getPath2peers().get(path);
- if (paths!=null) {
- ArrayList<String> result = new ArrayList<String>();
- for (String p : paths) {
- if (p.indexOf('/', 1)>=0)
- // it's a path nested in the optional instance
- p = optInstPath+p;
- else
- // its a path to one of my brokers (an immediate child)
- p = ownPath+p;
- result.add(p);
- }
- return result;
- }
- return paths;
- }
-
+
/**
* Get thread for path. The thread is passed to the optional actor creation method.
*
@@ -241,24 +112,6 @@ public abstract class OptionalActorInterfaceBase extends SystemPortOwner impleme
}
/**
- * This method is called by the optional actor factory to set the relative path mappings
- * for the created instance sub tree
- *
- * @param path2peers
- */
- public void setPath2peers(PathToPeers path2peers) {
- this.path2peers = path2peers;
- }
-
- /**
- * Returns the locally set path-to-peer mapping
- * @return the path2peers
- */
- protected PathToPeers getPath2peers() {
- return path2peers;
- }
-
- /**
* @return the class name for this optional actor
*/
public String getClassName() {
diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/PathToPeers.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/PathToPeers.java
deleted file mode 100644
index 0007b34ca..000000000
--- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/PathToPeers.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 protos software gmbh (http://www.protos.de).
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * CONTRIBUTORS:
- * Henrik Rentz-Reichert (initial contribution)
- *
- *******************************************************************************/
-
-package org.eclipse.etrice.runtime.java.modelbase;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-
-/**
- * @author Henrik Rentz-Reichert
- *
- */
-public class PathToPeers extends HashMap<String, ArrayList<String>> {
-
- private static final long serialVersionUID = 1L;
-
- public void put(String key, String value) {
- ArrayList<String> list = get(key);
- if (list==null) {
- list = new ArrayList<String>();
- put(key, list);
- }
- list.add(value);
- }
-
- public void put(String key, Collection<String> values) {
- ArrayList<String> list = get(key);
- if (list==null) {
- list = new ArrayList<String>(values);
- put(key, list);
- }
- else
- list.addAll(values);
- }
-
- public void put(String key, String[] values) {
- List<String> list = Arrays.asList(values);
- put(key, list);
- }
-
-} \ No newline at end of file
diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/ReplicatedInterfaceItemBase.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/ReplicatedInterfaceItemBase.java
index 2b757f02e..0ae2eb442 100644
--- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/ReplicatedInterfaceItemBase.java
+++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/ReplicatedInterfaceItemBase.java
@@ -14,9 +14,7 @@ package org.eclipse.etrice.runtime.java.modelbase;
import java.util.ArrayList;
import java.util.LinkedList;
-import java.util.List;
-import org.eclipse.etrice.runtime.java.messaging.IRTObject;
import org.eclipse.etrice.runtime.java.messaging.RTObject;
/**
@@ -40,25 +38,6 @@ public abstract class ReplicatedInterfaceItemBase extends RTObject implements IR
super(owner, name);
this.localId = localId;
-
- List<String> peerPaths = getParent().getPeersForPath(getInstancePath());
- if (peerPaths!=null) {
- for (String path : peerPaths) {
- IRTObject object = getObject(path);
- InterfaceItemBase peer = null;
- if (object instanceof InterfaceItemBase) {
- peer = ((InterfaceItemBase) object);
- }
- else if (object instanceof IReplicatedInterfaceItem) {
- if (object!=this) // avoid connecting to myself: occurs in a special situation with optional actors
- peer = ((IReplicatedInterfaceItem) object).createSubInterfaceItem();
- }
- if (peer!=null) {
- InterfaceItemBase item = createSubInterfaceItem();
- item.connectWith(peer);
- }
- }
- }
}
/* (non-Javadoc)
@@ -75,7 +54,7 @@ public abstract class ReplicatedInterfaceItemBase extends RTObject implements IR
public void removeItem(InterfaceItemBase item) {
boolean isRemoved = items.remove(item);
assert(isRemoved): "is own child";
- if(isRemoved) {
+ if (isRemoved) {
releasedIndices.push(item.getIdx());
}
}
@@ -123,5 +102,9 @@ public abstract class ReplicatedInterfaceItemBase extends RTObject implements IR
return "replicated port "+getName();
}
+ public IInterfaceItem connectWith(IInterfaceItem peer) {
+ return peer.connectWith(createSubInterfaceItem());
+ }
+
protected abstract InterfaceItemBase createInterfaceItem(IInterfaceItemOwner rcv, String name, int lid, int idx);
}
diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/SubSystemClassBase.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/SubSystemClassBase.java
index 498f6732e..66806a22f 100644
--- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/SubSystemClassBase.java
+++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/SubSystemClassBase.java
@@ -8,9 +8,6 @@
package org.eclipse.etrice.runtime.java.modelbase;
-import java.util.Collection;
-import java.util.List;
-
import org.eclipse.etrice.runtime.java.config.IVariableService;
import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import org.eclipse.etrice.runtime.java.messaging.Address;
@@ -39,7 +36,6 @@ public abstract class SubSystemClassBase extends RTObject implements IEventRecei
protected static final int IFITEM_RTSystemPort = 0;
private PathToThread path2thread = new PathToThread();
- private PathToPeers path2peers = new PathToPeers();
// for tests only
private TestSemaphore terminateSem=null;
@@ -190,47 +186,12 @@ public abstract class SubSystemClassBase extends RTObject implements IEventRecei
}
/**
- * add a peer for the given path
- * @param path
- * @param peer
- */
- public void addPathToPeer(String path, String peer) {
- path2peers.put(path, peer);
- }
-
- /**
- * add a collection of peers to the given path
- * @param path
- * @param peers
- */
- public void addPathToPeers(String path, Collection<String> peers) {
- path2peers.put(path, peers);
- }
-
- /**
- * add several peers to the given path
- * @param path
- * @param peers
- */
- public void addPathToPeers(String path, String... peers) {
- path2peers.put(path, peers);
- }
-
- /**
- * @param path
- * @return list of peer paths
- */
- public List<String> getPeersForPath(String path) {
- return path2peers.get(path);
- }
-
- /**
* Clears thread and peer mappings.
*/
public void resetAll() {
- path2peers.clear();
path2thread.clear();
}
+
/**
* @param optionalActorClass
* @param instanceActorClass
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/DynamicActorTest3.room b/tests/org.eclipse.etrice.generator.common.tests/models/DynamicActorTest3.room
index 3952d0d5e..9177079c1 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/DynamicActorTest3.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/DynamicActorTest3.room
@@ -17,11 +17,11 @@ RoomModel DynamicActorTest3 {
ActorClass Controller {
Structure {
- conjugated Port worker: PWorker
+ conjugated Port pwrk: PWorker
conjugated Port opt: PC
Attribute caseId: int32
ActorRef worker: Worker
- Binding worker and worker.fct
+ Binding pwrk and worker.fct
Binding opt and worker.opt
}
Behavior {
@@ -35,7 +35,7 @@ RoomModel DynamicActorTest3 {
Transition init: initial -> createOpt1 { }
Transition tr0: createOpt1 -> SendHello {
triggers {
- <ok: worker>
+ <ok: pwrk>
}
}
Transition tr1: SendHello -> TryCreateInvalid {
@@ -48,17 +48,17 @@ RoomModel DynamicActorTest3 {
}
Transition tr2: createOpt1 -> UnexpectedError {
triggers {
- <error: worker>
+ <error: pwrk>
}
}
Transition tr3: TryCreateInvalid -> ExpectedError {
triggers {
- <error: worker>
+ <error: pwrk>
}
}
State createOpt1 {
entry {
- "worker.create(\"Optional1\");"
+ "pwrk.create(\"Optional1\");"
}
}
State SendHello {
@@ -68,7 +68,7 @@ RoomModel DynamicActorTest3 {
}
State TryCreateInvalid {
entry {
- "worker.create(\"Optional\");"
+ "pwrk.create(\"Optional\");"
}
}
State UnexpectedError
diff --git a/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/modelbase/BrokerTest.java b/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/modelbase/BrokerTest.java
index d4c16cad4..adaa76520 100644
--- a/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/modelbase/BrokerTest.java
+++ b/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/modelbase/BrokerTest.java
@@ -47,20 +47,19 @@ public class BrokerTest extends TestCase {
top.addPathToThread("/TOP/Rcv0", 0);
top.addPathToThread("/TOP/Rcv1", 1);
top.addPathToThread("/TOP/Rcv2", 2);
- top.addPathToPeer("/TOP/Rcv0/Port0", "/TOP/Rcv2/Broker");
- top.addPathToPeer("/TOP/Rcv2/Broker", "/TOP/Rcv0/Port0");
- top.addPathToPeer("/TOP/Rcv1/Port1", "/TOP/Rcv2/Broker");
- top.addPathToPeer("/TOP/Rcv2/Broker", "/TOP/Rcv1/Port1");
MockEventReceiver eventRcv0 = new MockEventReceiver(top, "Rcv0");
MockEventReceiver eventRcv1 = new MockEventReceiver(top, "Rcv1");
MockEventReceiver eventRcv2 = new MockEventReceiver(top, "Rcv2");
- // caution: the order is relevant
PortBase port0 = new MockPort(eventRcv0, "Port0", 33, 0);
InterfaceItemBroker broker = new InterfaceItemBroker(eventRcv2, "Broker", 55, 10);
PortBase port1 = new MockPort(eventRcv1, "Port1", 44, 5);
+ // caution: the order is relevant
+ port0.connectWith(broker);
+ port1.connectWith(broker);
+
MessageServiceController msgSvcCtrl = RTServices.getInstance().getMsgSvcCtrl();
assertEquals(msgSvcCtrl.getMsgSvc(0), port0.getMsgReceiver());
assertEquals(msgSvcCtrl.getMsgSvc(1), port1.getMsgReceiver());
@@ -83,24 +82,22 @@ public class BrokerTest extends TestCase {
top.addPathToThread("/TOP/Rcv1", 1);
top.addPathToThread("/TOP/Rcv2", 2);
top.addPathToThread("/TOP/Rcv3", 2);
- top.addPathToPeer("/TOP/Rcv0/Port0", "/TOP/Rcv2/Broker");
- top.addPathToPeer("/TOP/Rcv2/Broker", "/TOP/Rcv0/Port0");
- top.addPathToPeer("/TOP/Rcv2/Broker", "/TOP/Rcv3/Broker");
- top.addPathToPeer("/TOP/Rcv3/Broker", "/TOP/Rcv2/Broker");
- top.addPathToPeer("/TOP/Rcv1/Port1", "/TOP/Rcv3/Broker");
- top.addPathToPeer("/TOP/Rcv3/Broker", "/TOP/Rcv1/Port1");
MockEventReceiver eventRcv0 = new MockEventReceiver(top, "Rcv0");
MockEventReceiver eventRcv1 = new MockEventReceiver(top, "Rcv1");
MockEventReceiver eventRcv2 = new MockEventReceiver(top, "Rcv2");
MockEventReceiver eventRcv3 = new MockEventReceiver(top, "Rcv3");
- // caution: the order is relevant
PortBase port0 = new MockPort(eventRcv0, "Port0", 33, 0);
- new InterfaceItemBroker(eventRcv2, "Broker", 55, 10);
- new InterfaceItemBroker(eventRcv3, "Broker", 66, 20);
+ InterfaceItemBroker broker0 = new InterfaceItemBroker(eventRcv2, "Broker", 55, 10);
+ InterfaceItemBroker broker1 = new InterfaceItemBroker(eventRcv3, "Broker", 66, 20);
PortBase port1 = new MockPort(eventRcv1, "Port1", 44, 5);
+ // caution: the order is relevant
+ port0.connectWith(broker1);
+ broker0.connectWith(broker1);
+ port1.connectWith(broker1);
+
assertEquals(port1.getAddress(), port0.getPeerAddress());
assertEquals(port0.getAddress(), port1.getPeerAddress());
}
@@ -113,14 +110,6 @@ public class BrokerTest extends TestCase {
top.addPathToThread("/TOP/Rcv2", 2);
top.addPathToThread("/TOP/Rcv3", 2);
top.addPathToThread("/TOP/Rcv4", 2);
- top.addPathToPeer("/TOP/Rcv0/Port0", "/TOP/Rcv2/Broker");
- top.addPathToPeer("/TOP/Rcv2/Broker", "/TOP/Rcv0/Port0");
- top.addPathToPeer("/TOP/Rcv2/Broker", "/TOP/Rcv3/Broker");
- top.addPathToPeer("/TOP/Rcv3/Broker", "/TOP/Rcv2/Broker");
- top.addPathToPeer("/TOP/Rcv3/Broker", "/TOP/Rcv4/Broker");
- top.addPathToPeer("/TOP/Rcv4/Broker", "/TOP/Rcv3/Broker");
- top.addPathToPeer("/TOP/Rcv1/Port1", "/TOP/Rcv4/Broker");
- top.addPathToPeer("/TOP/Rcv4/Broker", "/TOP/Rcv1/Port1");
MockEventReceiver eventRcv0 = new MockEventReceiver(top, "Rcv0");
MockEventReceiver eventRcv1 = new MockEventReceiver(top, "Rcv1");
@@ -128,13 +117,18 @@ public class BrokerTest extends TestCase {
MockEventReceiver eventRcv3 = new MockEventReceiver(top, "Rcv3");
MockEventReceiver eventRcv4 = new MockEventReceiver(top, "Rcv4");
- // caution: the order is relevant
- new InterfaceItemBroker(eventRcv2, "Broker", 55, 10);
- new InterfaceItemBroker(eventRcv3, "Broker", 66, 20);
- new InterfaceItemBroker(eventRcv4, "Broker", 77, 30);
+ InterfaceItemBroker broker0 = new InterfaceItemBroker(eventRcv2, "Broker", 55, 10);
+ InterfaceItemBroker broker1 = new InterfaceItemBroker(eventRcv3, "Broker", 66, 20);
+ InterfaceItemBroker broker2 = new InterfaceItemBroker(eventRcv4, "Broker", 77, 30);
PortBase port0 = new MockPort(eventRcv0, "Port0", 33, 0);
PortBase port1 = new MockPort(eventRcv1, "Port1", 44, 5);
+ // caution: the order is relevant
+ broker1.connectWith(broker0);
+ port0.connectWith(broker0);
+ broker2.connectWith(broker1);
+ port1.connectWith(broker2);
+
assertEquals(port1.getAddress(), port0.getPeerAddress());
assertEquals(port0.getAddress(), port1.getPeerAddress());
}
diff --git a/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/modelbase/PortBaseTest.java b/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/modelbase/PortBaseTest.java
index 8a3266b98..ef347ba78 100644
--- a/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/modelbase/PortBaseTest.java
+++ b/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/modelbase/PortBaseTest.java
@@ -37,14 +37,14 @@ public class PortBaseTest extends TestCase {
RTServices.getInstance().setSubSystem(top);
top.addPathToThread("/TOP/Rcv0", 0);
top.addPathToThread("/TOP/Rcv1", 1);
- top.addPathToPeer("/TOP/Rcv0/Port0", "/TOP/Rcv1/Port1");
- top.addPathToPeer("/TOP/Rcv1/Port1", "/TOP/Rcv0/Port0");
MockEventReceiver eventRcv0 = new MockEventReceiver(top, "Rcv0");
MockEventReceiver eventRcv1 = new MockEventReceiver(top, "Rcv1");
PortBase port0 = new MockPort(eventRcv0, "Port0", 33, 0);
PortBase port1 = new MockPort(eventRcv1, "Port1", 44, 5);
+ port0.connectWith(port1);
+
assertEquals(msgSvcCtrl.getMsgSvc(0), port0.getMsgReceiver());
assertEquals(msgSvcCtrl.getMsgSvc(1), port1.getMsgReceiver());
diff --git a/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/modelbase/ReplicatedPortBaseTest.java b/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/modelbase/ReplicatedPortBaseTest.java
index 481be915d..e33389443 100644
--- a/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/modelbase/ReplicatedPortBaseTest.java
+++ b/tests/org.eclipse.etrice.runtime.java.tests/src/org/eclipse/etrice/runtime/java/modelbase/ReplicatedPortBaseTest.java
@@ -59,10 +59,6 @@ public class ReplicatedPortBaseTest {
top.addPathToThread("/TOP/Rcv0", 0);
top.addPathToThread("/TOP/Rcv1", 1);
top.addPathToThread("/TOP/Rcv2", 1);
- top.addPathToPeer("/TOP/Rcv0/Port0", "/TOP/Rcv2/Port2");
- top.addPathToPeer("/TOP/Rcv1/Port1", "/TOP/Rcv2/Port2");
- top.addPathToPeer("/TOP/Rcv2/Port2", "/TOP/Rcv0/Port0");
- top.addPathToPeer("/TOP/Rcv2/Port2", "/TOP/Rcv1/Port1");
return top;
}
@@ -78,6 +74,9 @@ public class ReplicatedPortBaseTest {
PortBase port1 = new MockPort(eventRcv1, "Port1", 44, 5);
MockReplicatedPort port2 = new MockReplicatedPort(eventRcv2, "Port2", 55);
+ port0.connectWith(port2);
+ port1.connectWith(port2);
+
assertEquals(2, port2.getNInterfaceItems());
assertEquals(msgSvcCtrl.getMsgSvc(0), port0.getMsgReceiver());
@@ -123,6 +122,9 @@ public class ReplicatedPortBaseTest {
PortBase port0 = new MockPort(eventRcv0, "Port0", 33, 0);
PortBase port1 = new MockPort(eventRcv1, "Port1", 44, 5);
+ port2.connectWith(port0);
+ port2.connectWith(port1);
+
assertEquals(2, port2.getNInterfaceItems());
assertEquals(msgSvcCtrl.getMsgSvc(0), port0.getMsgReceiver());
@@ -167,6 +169,9 @@ public class ReplicatedPortBaseTest {
MockReplicatedPort port0 = new MockReplicatedPort(eventRcv0, "Port0", 33);
PortBase port1 = new MockPort(eventRcv1, "Port1", 44, 5);
MockReplicatedPort port2 = new MockReplicatedPort(eventRcv2, "Port2", 55);
+
+ port0.connectWith(port2);
+ port1.connectWith(port2);
assertEquals(1, port0.getNInterfaceItems());
assertEquals(2, port2.getNInterfaceItems());

Back to the top