Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorepaen2013-07-12 07:21:40 +0000
committerepaen2013-07-12 14:42:41 +0000
commitd9149c07da6e79281b8f7b03805e79e409391ea3 (patch)
treee88d60100ec6bd7f79c4c7f5550600526eccaecf
parentd65e1d1bdd43feadb43261b85aac2d8aef5e089c (diff)
downloadorg.eclipse.etrice-d9149c07da6e79281b8f7b03805e79e409391ea3.tar.gz
org.eclipse.etrice-d9149c07da6e79281b8f7b03805e79e409391ea3.tar.xz
org.eclipse.etrice-d9149c07da6e79281b8f7b03805e79e409391ea3.zip
Initial commit of AspectJ trace logging library and example project
based on HelloWorld tutorial Change-Id: Ieee4607f12a0846e764ee55df47d23d29edb75b9
-rw-r--r--examples/org.eclipse.etrice.tutorials.java.aspecttrace/.classpath23
-rw-r--r--examples/org.eclipse.etrice.tutorials.java.aspecttrace/.gitignore5
-rw-r--r--examples/org.eclipse.etrice.tutorials.java.aspecttrace/.project30
-rw-r--r--examples/org.eclipse.etrice.tutorials.java.aspecttrace/.settings/org.eclipse.jdt.core.prefs81
-rw-r--r--examples/org.eclipse.etrice.tutorials.java.aspecttrace/buckminster.cspec2
-rw-r--r--examples/org.eclipse.etrice.tutorials.java.aspecttrace/build.properties5
-rw-r--r--examples/org.eclipse.etrice.tutorials.java.aspecttrace/disableMSCLogger.ajproperties3
-rw-r--r--examples/org.eclipse.etrice.tutorials.java.aspecttrace/doc/README96
-rw-r--r--examples/org.eclipse.etrice.tutorials.java.aspecttrace/enableMSCLogger.ajproperties2
-rw-r--r--examples/org.eclipse.etrice.tutorials.java.aspecttrace/gen_PingPongJava_aspecttrace.launch15
-rw-r--r--examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/PingPong.room74
-rw-r--r--examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/diagrams/RoomModel1.PingPongTop.structure89
-rw-r--r--examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/diagrams/RoomModel1.Receiver.behavior135
-rw-r--r--examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/diagrams/RoomModel1.Receiver.structure36
-rw-r--r--examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/diagrams/RoomModel1.Sender.behavior135
-rw-r--r--examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/diagrams/RoomModel1.Sender.structure36
-rw-r--r--examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/diagrams/RoomModel1.SubSysClass1.structure38
-rw-r--r--examples/org.eclipse.etrice.tutorials.java.aspecttrace/src-aspects/PingPong_Model/aspects/trace/PingPongRTTrace.aj24
-rw-r--r--examples/org.eclipse.etrice.tutorials.java.aspecttrace/src-gen-info/readme.txt4
-rw-r--r--examples/org.eclipse.etrice.tutorials.java.aspecttrace/src-gen/readme.txt4
-rw-r--r--examples/org.eclipse.etrice.tutorials.java.aspecttrace/tmp/log/.gitignore2
-rw-r--r--runtime/org.eclipse.etrice.runtime.java.aspects/.classpath9
-rw-r--r--runtime/org.eclipse.etrice.runtime.java.aspects/.externalToolBuilders/org.eclipse.etrice.runtime.java.aspects.launch13
-rw-r--r--runtime/org.eclipse.etrice.runtime.java.aspects/.gitignore1
-rw-r--r--runtime/org.eclipse.etrice.runtime.java.aspects/.project39
-rw-r--r--runtime/org.eclipse.etrice.runtime.java.aspects/.settings/org.eclipse.jdt.core.prefs11
-rw-r--r--runtime/org.eclipse.etrice.runtime.java.aspects/META-INF/MANIFEST.MF7
-rw-r--r--runtime/org.eclipse.etrice.runtime.java.aspects/build.properties3
-rw-r--r--runtime/org.eclipse.etrice.runtime.java.aspects/build.xml25
-rw-r--r--runtime/org.eclipse.etrice.runtime.java.aspects/dist/org.eclipse.etrice.runtime.java.aspects.jarbin0 -> 8079 bytes
-rw-r--r--runtime/org.eclipse.etrice.runtime.java.aspects/src/org/eclipse/etrice/runtime/java/aspects/AbstractRTTrace.aj248
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/debugging/MSCLogger.java239
32 files changed, 1317 insertions, 117 deletions
diff --git a/examples/org.eclipse.etrice.tutorials.java.aspecttrace/.classpath b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/.classpath
new file mode 100644
index 000000000..7b57636d5
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/.classpath
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src-gen"/>
+ <classpathentry kind="src" path="src-aspects"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="src" path="/org.eclipse.etrice.modellib.java">
+ <attributes>
+ <attribute name="org.eclipse.ajdt.inpath" value="org.eclipse.ajdt.inpath"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="src" path="/org.eclipse.etrice.runtime.java">
+ <attributes>
+ <attribute name="org.eclipse.ajdt.inpath" value="org.eclipse.ajdt.inpath"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.ajdt.core.ASPECTJRT_CONTAINER"/>
+ <classpathentry kind="lib" path="/org.eclipse.etrice.runtime.java.aspects/dist/org.eclipse.etrice.runtime.java.aspects.jar">
+ <attributes>
+ <attribute name="org.eclipse.ajdt.aspectpath" value="org.eclipse.ajdt.aspectpath"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/examples/org.eclipse.etrice.tutorials.java.aspecttrace/.gitignore b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/.gitignore
new file mode 100644
index 000000000..c5b2f5b90
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/.gitignore
@@ -0,0 +1,5 @@
+bin
+src-gen/*
+!src-gen/readme.txt
+src-gen-info/*
+!src-gen-info/readme.txt
diff --git a/examples/org.eclipse.etrice.tutorials.java.aspecttrace/.project b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/.project
new file mode 100644
index 000000000..8315d1797
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/.project
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.etrice.tutorials.java.aspecttrace</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.ajdt.core.ajbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.xtend.shared.ui.xtendBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.ajdt.ui.ajnature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+ <nature>org.eclipse.xtend.shared.ui.xtendXPandNature</nature>
+ </natures>
+</projectDescription>
diff --git a/examples/org.eclipse.etrice.tutorials.java.aspecttrace/.settings/org.eclipse.jdt.core.prefs b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..f32203668
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,81 @@
+#Mon Sep 19 09:33:05 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=ignore
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/examples/org.eclipse.etrice.tutorials.java.aspecttrace/buckminster.cspec b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/buckminster.cspec
new file mode 100644
index 000000000..5f527bd99
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/buckminster.cspec
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<cs:cspec xmlns:cs="http://www.eclipse.org/buckminster/CSpec-1.0" name="org.eclipse.etrice.tutorials.java.aspecttrace" componentType="buckminster" version="0.3.0.qualifier"/>
diff --git a/examples/org.eclipse.etrice.tutorials.java.aspecttrace/build.properties b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/build.properties
new file mode 100644
index 000000000..d4e29431a
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/build.properties
@@ -0,0 +1,5 @@
+source.. = src/,\
+ src-gen/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/examples/org.eclipse.etrice.tutorials.java.aspecttrace/disableMSCLogger.ajproperties b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/disableMSCLogger.ajproperties
new file mode 100644
index 000000000..9ec253971
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/disableMSCLogger.ajproperties
@@ -0,0 +1,3 @@
+src.includes = src-gen/,\
+ src-aspects/
+src.excludes = src-aspects/PingPong_Model/aspects/trace/InProjectRTTrace.aj
diff --git a/examples/org.eclipse.etrice.tutorials.java.aspecttrace/doc/README b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/doc/README
new file mode 100644
index 000000000..1688b3435
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/doc/README
@@ -0,0 +1,96 @@
+AspectJ Synchronous MSC Trace Example
+=====================================
+
+This project shows how synchronous MSC trace functionality can be applied to an
+eTrice project using AspectJ. The example takes the PingPong model from the
+Java tutorial and adds a new aspect that can be woven with the generated
+eTrice code to automatically instrument method calls.
+
+Prerequisites
+-------------
+
+- An Eclipse environment with the following software installed:
+ - eTrice 0.3.0
+ - AspectJ
+ - the latest Kepler release can be found at
+ http://download.eclipse.org/tools/ajdt/43/update
+ - install the feature "AspectJ Development Tools"
+- Optional software:
+ Trace2UML
+ - used to view trace logs as graphical message sequence charts
+ - http://trace2uml.tigris.org
+
+Setup
+-----
+
+1. Open an Eclipse workspace.
+2. Add the following plugins to the Eclipse workspace:
+ - org.eclipse.etrice.runtime.java
+ - org.eclipse.etrice.modellib.java
+ - org.eclipse.etrice.runtime.java.aspects
+3. Import the example project org.eclipse.etrice.tutorials.java.aspecttrace
+
+Running the Example
+-------------------
+
+To run the example, perform the following steps:
+
+1. Run the launcher /gen_PingPongJava_aspecttrace.launch to generate the eTrice
+ implementation code for the example (the trace aspect should be applied
+ automatically)
+2. Run /src-gen/PingPong_Model/SubSysClass1Runner.java as a Java Application
+3. In the Console, after the sender actor reaches state "ReceivedPong" type
+ "quit" to write the traces and terminate
+4. Inspect the Synchronous MSC generated at /tmp/log/subSysRef1_Sync.seq
+
+To remove the aspect from the build path and disable the Synchronous trace:
+
+1. right click on the file /disableMSCLogger.ajproperties
+2. click on AspectJ Tools > Apply Build Configuration
+
+To add the aspect to the build path and enable the Synchronous trace:
+
+1. right click on the file /enableMSCLogger.ajproperties
+2. click on AspectJ Tools > Apply Build Configuration
+
+Example Details
+---------------
+
+The example project is a copy of the PingPong example from the eTrice Java
+tutorial. It has been converted to an AspectJ project by right clicking on the
+project in the Explorer and selecting Configure > Convert to AspectJ Project.
+
+AspectJ projects can be configured with "Inpath" and "Aspect Path" entries.
+Classes in the Inpath are considered as weaving targets by the AspectJ Builder.
+Aspects in the Aspect Path are applied to the project's source folder as well as
+classes in the Inpath.
+
+In this example, the eTrice Java Runtime and the eTrice Java Modellib are
+added to the Inpath so that the trace aspect can be woven into them. The
+example also adds the org.eclipse.etrice.runtime.java.aspects library to the
+Aspect Path to provide core trace functionality. PingPongRTTrace is a concrete
+extension of AbstractRTTrace in the aspect library.
+
+The PingPongRTTrace aspect can be easily enabled or disabled by adding and
+removing it in the Build Path. This is the purpose of the
+/enableMSCLogger.ajproperties and /disableMSCLogger.ajproperties files.
+
+Modifying PingPongRTTrace
+-------------------------
+
+The output of the synchronous MSC trace can be adjusted by modifying the
+PingPongRTTrace aspect. The aspect defines two pointcuts, traceScope and
+traceFilter which can be used to control the trace output. For details about
+defining pointcuts, refer to the AspectJ Programming Guide at:
+
+http://eclipse.org/aspectj/doc/released/progguide/index.html
+
+Here are some examples:
+
+To restrict traces to calls made by PingPong_Model classes modify traceScope:
+
+ public pointcut traceScope(): rtClasses() && within(PingPong_Model.*);
+
+To filter out calls made to and from PingPong_Model.Receiver actors, modify traceFilter:
+
+ public pointcut traceFilter(): this(PingPong_Model.Receiver) || target(PingPong_Model.Receiver); \ No newline at end of file
diff --git a/examples/org.eclipse.etrice.tutorials.java.aspecttrace/enableMSCLogger.ajproperties b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/enableMSCLogger.ajproperties
new file mode 100644
index 000000000..f2d28e612
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/enableMSCLogger.ajproperties
@@ -0,0 +1,2 @@
+src.includes = src-gen/,\
+ src-aspects/
diff --git a/examples/org.eclipse.etrice.tutorials.java.aspecttrace/gen_PingPongJava_aspecttrace.launch b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/gen_PingPongJava_aspecttrace.launch
new file mode 100644
index 000000000..ed4ed3460
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/gen_PingPongJava_aspecttrace.launch
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.etrice.generator.launch.java.launchConfigurationType">
+<booleanAttribute key="Debug" value="false"/>
+<booleanAttribute key="GenDocumentation" value="false"/>
+<booleanAttribute key="GenInstanceDiagram" value="false"/>
+<stringAttribute key="GenModelPath" value=""/>
+<booleanAttribute key="Lib" value="false"/>
+<booleanAttribute key="MSC" value="true"/>
+<listAttribute key="ModelFiles">
+<listEntry value="${workspace_loc:/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/PingPong.room}"/>
+</listAttribute>
+<booleanAttribute key="SaveGenModel" value="false"/>
+<booleanAttribute key="Verbose" value="false"/>
+<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${workspace}"/>
+</launchConfiguration>
diff --git a/examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/PingPong.room b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/PingPong.room
new file mode 100644
index 000000000..511b10917
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/PingPong.room
@@ -0,0 +1,74 @@
+RoomModel PingPong_Model {
+ LogicalSystem LogSys1 {
+ SubSystemRef subSysRef1:SubSysClass1
+ }
+ SubSystemClass SubSysClass1 {
+ ActorRef actorRef1:PingPongTop
+ LogicalThread defaultThread
+ }
+ ActorClass PingPongTop {
+ Structure {
+ ActorRef sender: Sender
+ ActorRef receiver: Receiver
+ Binding receiver.sender and sender.receiver
+ }
+ Behavior { }
+ }
+ ActorClass Sender {
+ Interface {
+ conjugated Port receiver: PPingPong
+ }
+ Structure {
+ external Port receiver
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> SendingPing { }
+ Transition tr0: SendingPing -> ReceivedPong {
+ triggers {
+ <pong: receiver>
+ }
+ }
+ State SendingPing {
+ entry {
+ "receiver.ping();"
+ }
+ }
+ State ReceivedPong
+ }
+ }
+ }
+ ActorClass Receiver {
+ Interface {
+ Port sender: PPingPong
+ }
+ Structure {
+ external Port sender
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> WaingForPing { }
+ Transition tr0: WaingForPing -> ReceivedPing {
+ triggers {
+ <ping: sender>
+ }
+ }
+ State WaingForPing
+ State ReceivedPing {
+ entry {
+ "sender.pong();"
+ }
+ }
+ }
+ }
+ }
+ ProtocolClass PPingPong {
+ incoming {
+ Message ping()
+ }
+ outgoing {
+ Message pong()
+ }
+ }
+
+} \ No newline at end of file
diff --git a/examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/diagrams/RoomModel1.PingPongTop.structure b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/diagrams/RoomModel1.PingPongTop.structure
new file mode 100644
index 000000000..df1c00b56
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/diagrams/RoomModel1.PingPongTop.structure
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="ASCII"?>
+<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" gridUnit="10" diagramTypeId="room.structure" name="Structure of PingPongTop" pictogramLinks="//@children.0/@link //@link //@children.0/@children.0/@link //@children.0/@children.1/@link //@children.0/@children.0/@children.0/@link //@children.0/@children.1/@children.1/@link //@connections.0/@link" verticalGridUnit="10" version="0.10.0">
+ <graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
+ <link>
+ <businessObjects href="../PingPong.room#ActorClass:PingPongTop"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="cls"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="880" height="580" x="40" y="40">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.2" lineWidth="4" transparency="0.5" width="800" height="500" x="40" y="40"/>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" foreground="//@colors.2" lineWidth="4" filled="false" transparency="0.0" width="800" height="500" x="40" y="40"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#ActorClass:PingPongTop"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="ref"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="240" height="140" x="96" y="188">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="180" height="80" x="30" y="30">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="20" height="10" x="150" y="50"/>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="20" height="10" x="145" y="65"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#ActorRef:PingPongTop$sender"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" referencedGraphicsAlgorithm="//@children.0/@children.0/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="port"/>
+ <properties key="item-kind" value="C"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="60" height="60" x="180" y="33">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="18" height="18" x="21" y="21"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#Port:Sender$receiver"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" incomingConnections="//@connections.0" referencedGraphicsAlgorithm="//@children.0/@children.0/@children.0/@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="39" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="receiver"/>
+ </children>
+ </children>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="180" height="80" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="sender&#xA;(Sender)"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="ref"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="240" height="140" x="439" y="194">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="180" height="80" x="30" y="30">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="20" height="10" x="150" y="50"/>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="20" height="10" x="145" y="65"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#ActorRef:PingPongTop$receiver"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" referencedGraphicsAlgorithm="//@children.0/@children.1/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="180" height="80" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="receiver&#xA;(Receiver)"/>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="port"/>
+ <properties key="item-kind" value=""/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="60" height="60" y="39">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.2" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="18" height="18" x="21" y="21"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#Port:Receiver$sender"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.0" referencedGraphicsAlgorithm="//@children.0/@children.1/@children.1/@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="39" font="//@fonts.0" value="sender"/>
+ </children>
+ </children>
+ </children>
+ </children>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.1/@children.1/@anchors.0" end="//@children.0/@children.0/@children.0/@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="../PingPong.room#Binding:PingPongTop$sender!receiver-receiver!sender"/>
+ </link>
+ </connections>
+ <colors red="227" green="238" blue="249"/>
+ <colors red="255" green="255" blue="255"/>
+ <colors/>
+ <colors red="200" green="200" blue="200"/>
+ <fonts name="Arial" size="8"/>
+</pi:Diagram>
diff --git a/examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/diagrams/RoomModel1.Receiver.behavior b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/diagrams/RoomModel1.Receiver.behavior
new file mode 100644
index 000000000..8a5814fa8
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/diagrams/RoomModel1.Receiver.behavior
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="ASCII"?>
+<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" gridUnit="10" diagramTypeId="room.behavior" name="Behavior of Receiver" pictogramLinks="//@link //@children.0/@link //@children.0/@children.1/@link //@children.0/@children.2/@link //@connections.0/@link //@children.0/@children.3/@link //@connections.1/@link" verticalGridUnit="10" version="0.10.0">
+ <graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
+ <link>
+ <businessObjects href="../PingPong.room#ActorClass:Receiver"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="sg"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="880" height="580" x="40" y="40">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.1" foreground="//@colors.2" lineWidth="4" transparency="0.5" width="800" height="500" x="40" y="40" cornerHeight="20" cornerWidth="20"/>
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="4" filled="false" transparency="0.0" width="800" height="500" x="40" y="40" cornerHeight="20" cornerWidth="20"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#StateGraph:Receiver$sg"/>
+ </link>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="800" height="80" y="40" font="//@fonts.1" horizontalAlignment="ALIGNMENT_RIGHT" verticalAlignment="ALIGNMENT_TOP" value="/"/>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="trp"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="40" height="40" x="99" y="73">
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.1" foreground="//@colors.2" lineWidth="2" transparency="0.0" width="20" height="20" x="10" y="10"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#StateGraph:Receiver$sg"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.0" referencedGraphicsAlgorithm="//@children.0/@children.1/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="40" height="20" y="10" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="I"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="state"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="152" height="90" x="319" y="191">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="92" 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="67" y="3" cornerHeight="5" cornerWidth="5"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="46" y="24">
+ <points x="-3" y="-3"/>
+ <points x="-3" y="3"/>
+ <points x="-11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="46" y="24">
+ <points x="3" y="-3"/>
+ <points x="3" y="3"/>
+ <points x="11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="46" y="24">
+ <points x="-2" y="-3"/>
+ <points x="-2" y="3"/>
+ <points x="2" y="3"/>
+ <points x="2" y="-3"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#SimpleState:Receiver$WaingForPing"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.1" incomingConnections="//@connections.0" referencedGraphicsAlgorithm="//@children.0/@children.2/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="92" height="30" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="WaingForPing"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="state"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="148" height="90" x="319" y="353">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="88" 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="63" y="3" cornerHeight="5" cornerWidth="5"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" x="44" y="24">
+ <points x="-3" y="-3"/>
+ <points x="-3" y="3"/>
+ <points x="-11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="44" y="24">
+ <points x="3" y="-3"/>
+ <points x="3" y="3"/>
+ <points x="11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="44" y="24">
+ <points x="-2" y="-3"/>
+ <points x="-2" y="3"/>
+ <points x="2" y="3"/>
+ <points x="2" y="-3"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#SimpleState:Receiver$ReceivedPing"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" incomingConnections="//@connections.1" referencedGraphicsAlgorithm="//@children.0/@children.3/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="88" height="30" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="ReceivedPing"/>
+ </children>
+ </children>
+ </children>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.1/@anchors.0" end="//@children.0/@children.2/@anchors.0">
+ <properties key="obj-type" value="trans"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../PingPong.room#InitialTransition:Receiver$initial"/>
+ </link>
+ <connectionDecorators visible="true" locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.2" lineWidth="1" filled="true" transparency="0.0">
+ <points x="-15" y="5"/>
+ <points/>
+ <points x="-15" y="-5"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ <connectionDecorators visible="true" active="true" locationRelative="true" location="0.5">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" x="10" font="//@fonts.0" value="init"/>
+ </connectionDecorators>
+ </connections>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.2/@anchors.0" end="//@children.0/@children.3/@anchors.0">
+ <properties key="obj-type" value="trans"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../PingPong.room#TriggeredTransition:Receiver$tr0"/>
+ </link>
+ <connectionDecorators visible="true" locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.2" lineWidth="1" filled="true" transparency="0.0">
+ <points x="-15" y="5"/>
+ <points/>
+ <points x="-15" y="-5"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ <connectionDecorators visible="true" active="true" locationRelative="true" location="0.5">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" x="10" font="//@fonts.0" value="tr0: &lt;ping:sender>"/>
+ </connectionDecorators>
+ </connections>
+ <colors red="227" green="238" blue="249"/>
+ <colors red="255" green="255" blue="255"/>
+ <colors/>
+ <colors red="200" green="200" blue="200"/>
+ <fonts name="Arial" size="8"/>
+ <fonts name="Arial" size="9" bold="true"/>
+</pi:Diagram>
diff --git a/examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/diagrams/RoomModel1.Receiver.structure b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/diagrams/RoomModel1.Receiver.structure
new file mode 100644
index 000000000..f6fe29974
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/diagrams/RoomModel1.Receiver.structure
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="ASCII"?>
+<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" gridUnit="10" diagramTypeId="room.structure" name="Structure of Receiver" pictogramLinks="//@children.0/@link //@link //@children.0/@children.0/@link" verticalGridUnit="10" version="0.10.0">
+ <graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
+ <link>
+ <businessObjects href="../PingPong.room#ActorClass:Receiver"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="cls"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="880" height="580" x="40" y="40">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.2" lineWidth="4" transparency="0.5" width="800" height="500" x="40" y="40"/>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" foreground="//@colors.2" lineWidth="4" filled="false" transparency="0.0" width="800" height="500" x="40" y="40"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#ActorClass:Receiver"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="port"/>
+ <properties key="item-kind" value=""/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="80" height="80" y="247">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.2" foreground="//@colors.2" lineWidth="2" transparency="0.0" width="40" height="40" x="20" y="20"/>
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.1" foreground="//@colors.1" lineWidth="2" transparency="0.0" width="20" height="20" x="30" y="30"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#Port:Receiver$sender"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" referencedGraphicsAlgorithm="//@children.0/@children.0/@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" value="sender"/>
+ </children>
+ </children>
+ </children>
+ <colors red="227" green="238" blue="249"/>
+ <colors red="255" green="255" blue="255"/>
+ <colors/>
+ <fonts name="Arial" size="8"/>
+</pi:Diagram>
diff --git a/examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/diagrams/RoomModel1.Sender.behavior b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/diagrams/RoomModel1.Sender.behavior
new file mode 100644
index 000000000..aeda95987
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/diagrams/RoomModel1.Sender.behavior
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="ASCII"?>
+<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" gridUnit="10" diagramTypeId="room.behavior" name="Behavior of Sender" pictogramLinks="//@link //@children.0/@link //@children.0/@children.1/@link //@children.0/@children.2/@link //@connections.0/@link //@children.0/@children.3/@link //@connections.1/@link" verticalGridUnit="10" version="0.10.0">
+ <graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
+ <link>
+ <businessObjects href="../PingPong.room#ActorClass:Sender"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="sg"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="880" height="580" x="40" y="40">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.1" foreground="//@colors.2" lineWidth="4" transparency="0.5" width="800" height="500" x="40" y="40" cornerHeight="20" cornerWidth="20"/>
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="4" filled="false" transparency="0.0" width="800" height="500" x="40" y="40" cornerHeight="20" cornerWidth="20"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#StateGraph:Sender$sg"/>
+ </link>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="800" height="80" y="40" font="//@fonts.1" horizontalAlignment="ALIGNMENT_RIGHT" verticalAlignment="ALIGNMENT_TOP" value="/"/>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="trp"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="40" height="40" x="83" y="63">
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.1" foreground="//@colors.2" lineWidth="2" transparency="0.0" width="20" height="20" x="10" y="10"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#StateGraph:Sender$sg"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.0" referencedGraphicsAlgorithm="//@children.0/@children.1/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="40" height="20" y="10" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="I"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="state"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="143" height="90" x="312" y="147">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="83" 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="58" y="3" cornerHeight="5" cornerWidth="5"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" x="41" y="24">
+ <points x="-3" y="-3"/>
+ <points x="-3" y="3"/>
+ <points x="-11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="41" y="24">
+ <points x="3" y="-3"/>
+ <points x="3" y="3"/>
+ <points x="11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="41" y="24">
+ <points x="-2" y="-3"/>
+ <points x="-2" y="3"/>
+ <points x="2" y="3"/>
+ <points x="2" y="-3"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#SimpleState:Sender$SendingPing"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.1" incomingConnections="//@connections.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="83" height="30" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="SendingPing"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="state"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="152" height="90" x="299" y="279">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="92" 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="67" y="3" cornerHeight="5" cornerWidth="5"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="46" y="24">
+ <points x="-3" y="-3"/>
+ <points x="-3" y="3"/>
+ <points x="-11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="46" y="24">
+ <points x="3" y="-3"/>
+ <points x="3" y="3"/>
+ <points x="11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="46" y="24">
+ <points x="-2" y="-3"/>
+ <points x="-2" y="3"/>
+ <points x="2" y="3"/>
+ <points x="2" y="-3"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#SimpleState:Sender$ReceivedPong"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" incomingConnections="//@connections.1" referencedGraphicsAlgorithm="//@children.0/@children.3/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="92" height="30" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="ReceivedPong"/>
+ </children>
+ </children>
+ </children>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.1/@anchors.0" end="//@children.0/@children.2/@anchors.0">
+ <properties key="obj-type" value="trans"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../PingPong.room#InitialTransition:Sender$initial"/>
+ </link>
+ <connectionDecorators visible="true" locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.2" lineWidth="1" filled="true" transparency="0.0">
+ <points x="-15" y="5"/>
+ <points/>
+ <points x="-15" y="-5"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ <connectionDecorators visible="true" active="true" locationRelative="true" location="0.5">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" x="10" font="//@fonts.0" value="init"/>
+ </connectionDecorators>
+ </connections>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.2/@anchors.0" end="//@children.0/@children.3/@anchors.0">
+ <properties key="obj-type" value="trans"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../PingPong.room#TriggeredTransition:Sender$tr0"/>
+ </link>
+ <connectionDecorators visible="true" locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.2" lineWidth="1" filled="true" transparency="0.0">
+ <points x="-15" y="5"/>
+ <points/>
+ <points x="-15" y="-5"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ <connectionDecorators visible="true" active="true" locationRelative="true" location="0.5">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" x="10" font="//@fonts.0" value="tr0: &lt;pong:receiver>"/>
+ </connectionDecorators>
+ </connections>
+ <colors red="227" green="238" blue="249"/>
+ <colors red="255" green="255" blue="255"/>
+ <colors/>
+ <colors red="200" green="200" blue="200"/>
+ <fonts name="Arial" size="8"/>
+ <fonts name="Arial" size="9" bold="true"/>
+</pi:Diagram>
diff --git a/examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/diagrams/RoomModel1.Sender.structure b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/diagrams/RoomModel1.Sender.structure
new file mode 100644
index 000000000..981d0495f
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/diagrams/RoomModel1.Sender.structure
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="ASCII"?>
+<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" gridUnit="10" diagramTypeId="room.structure" name="Structure of Sender" pictogramLinks="//@children.0/@link //@link //@children.0/@children.0/@link" verticalGridUnit="10" version="0.10.0">
+ <graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
+ <link>
+ <businessObjects href="../PingPong.room#ActorClass:Sender"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="cls"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="880" height="580" x="40" y="40">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.2" lineWidth="4" transparency="0.5" width="800" height="500" x="40" y="40"/>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" foreground="//@colors.2" lineWidth="4" filled="false" transparency="0.0" width="800" height="500" x="40" y="40"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#ActorClass:Sender"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="port"/>
+ <properties key="item-kind" value="C"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="80" height="80" x="800" y="212">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.2" lineWidth="2" transparency="0.0" width="40" height="40" x="20" y="20"/>
+ <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="../PingPong.room#Port:Sender$receiver"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" referencedGraphicsAlgorithm="//@children.0/@children.0/@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="receiver"/>
+ </children>
+ </children>
+ </children>
+ <colors red="227" green="238" blue="249"/>
+ <colors red="255" green="255" blue="255"/>
+ <colors/>
+ <fonts name="Arial" size="8"/>
+</pi:Diagram>
diff --git a/examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/diagrams/RoomModel1.SubSysClass1.structure b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/diagrams/RoomModel1.SubSysClass1.structure
new file mode 100644
index 000000000..c5fedd2b8
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/model/PingPong/diagrams/RoomModel1.SubSysClass1.structure
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="ASCII"?>
+<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" gridUnit="10" diagramTypeId="room.structure" name="Structure of SubSysClass1" pictogramLinks="//@children.0/@link //@link //@children.0/@children.0/@link" verticalGridUnit="10" version="0.10.0">
+ <graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
+ <link>
+ <businessObjects href="../PingPong.room#SubSystemClass:SubSysClass1"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="cls"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="880" height="580" x="40" y="40">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.2" lineWidth="4" transparency="0.5" width="800" height="500" x="40" y="40"/>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" foreground="//@colors.2" lineWidth="4" filled="false" transparency="0.0" width="800" height="500" x="40" y="40"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#SubSystemClass:SubSysClass1"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="ref"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="240" height="140" x="320" y="170">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="180" height="80" x="30" y="30">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="20" height="10" x="150" y="50"/>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="20" height="10" x="145" y="65"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#ActorRef:SubSysClass1$actorRef1"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" referencedGraphicsAlgorithm="//@children.0/@children.0/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="180" height="80" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="actorRef1&#xA;(PingPongTop)"/>
+ </children>
+ </children>
+ </children>
+ <colors red="227" green="238" blue="249"/>
+ <colors red="255" green="255" blue="255"/>
+ <colors/>
+ <colors red="200" green="200" blue="200"/>
+ <fonts name="Arial" size="8"/>
+</pi:Diagram>
diff --git a/examples/org.eclipse.etrice.tutorials.java.aspecttrace/src-aspects/PingPong_Model/aspects/trace/PingPongRTTrace.aj b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/src-aspects/PingPong_Model/aspects/trace/PingPongRTTrace.aj
new file mode 100644
index 000000000..36c80fe54
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/src-aspects/PingPong_Model/aspects/trace/PingPongRTTrace.aj
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * 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:
+ * Eyrak Paen (initial contribution)
+ *
+ *******************************************************************************/
+
+package PingPong_Model.aspects.trace;
+
+import org.eclipse.etrice.runtime.java.aspects.AbstractRTTrace;
+
+public aspect PingPongRTTrace extends AbstractRTTrace {
+
+ // concrete definition of abstract pointcut in super
+ public pointcut traceScope(): rtClasses();
+
+ // concrete definition of abstract pointcut in super
+ public pointcut traceFilter();
+}
diff --git a/examples/org.eclipse.etrice.tutorials.java.aspecttrace/src-gen-info/readme.txt b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/src-gen-info/readme.txt
new file mode 100644
index 000000000..1dc2b35ab
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/src-gen-info/readme.txt
@@ -0,0 +1,4 @@
+This directory is an eTrice code generation target.
+It will be erased every time the generator is executed.
+
+DO NOT PLACE OTHER FILES HERE!
diff --git a/examples/org.eclipse.etrice.tutorials.java.aspecttrace/src-gen/readme.txt b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/src-gen/readme.txt
new file mode 100644
index 000000000..1dc2b35ab
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/src-gen/readme.txt
@@ -0,0 +1,4 @@
+This directory is an eTrice code generation target.
+It will be erased every time the generator is executed.
+
+DO NOT PLACE OTHER FILES HERE!
diff --git a/examples/org.eclipse.etrice.tutorials.java.aspecttrace/tmp/log/.gitignore b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/tmp/log/.gitignore
new file mode 100644
index 000000000..d6b7ef32c
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.java.aspecttrace/tmp/log/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/runtime/org.eclipse.etrice.runtime.java.aspects/.classpath b/runtime/org.eclipse.etrice.runtime.java.aspects/.classpath
new file mode 100644
index 000000000..a6af4ec59
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.java.aspects/.classpath
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.etrice.runtime.java"/>
+ <classpathentry kind="con" path="org.eclipse.ajdt.core.ASPECTJRT_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/runtime/org.eclipse.etrice.runtime.java.aspects/.externalToolBuilders/org.eclipse.etrice.runtime.java.aspects.launch b/runtime/org.eclipse.etrice.runtime.java.aspects/.externalToolBuilders/org.eclipse.etrice.runtime.java.aspects.launch
new file mode 100644
index 000000000..b65829f25
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.java.aspects/.externalToolBuilders/org.eclipse.etrice.runtime.java.aspects.launch
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
+<booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/>
+<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
+<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${project}"/>
+<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.etrice.runtime.java.aspects"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/org.eclipse.etrice.runtime.java.aspects/build.xml}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value=""/>
+<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
+</launchConfiguration>
diff --git a/runtime/org.eclipse.etrice.runtime.java.aspects/.gitignore b/runtime/org.eclipse.etrice.runtime.java.aspects/.gitignore
new file mode 100644
index 000000000..ba077a403
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.java.aspects/.gitignore
@@ -0,0 +1 @@
+bin
diff --git a/runtime/org.eclipse.etrice.runtime.java.aspects/.project b/runtime/org.eclipse.etrice.runtime.java.aspects/.project
new file mode 100644
index 000000000..4cc0d387f
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.java.aspects/.project
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.etrice.runtime.java.aspects</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.ajdt.core.ajbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
+ <triggers>full,incremental,</triggers>
+ <arguments>
+ <dictionary>
+ <key>LaunchConfigHandle</key>
+ <value>&lt;project&gt;/.externalToolBuilders/org.eclipse.etrice.runtime.java.aspects.launch</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.ajdt.ui.ajnature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/runtime/org.eclipse.etrice.runtime.java.aspects/.settings/org.eclipse.jdt.core.prefs b/runtime/org.eclipse.etrice.runtime.java.aspects/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..8000cd6ca
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.java.aspects/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,11 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/runtime/org.eclipse.etrice.runtime.java.aspects/META-INF/MANIFEST.MF b/runtime/org.eclipse.etrice.runtime.java.aspects/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..e903b3386
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.java.aspects/META-INF/MANIFEST.MF
@@ -0,0 +1,7 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: eTrice Java Runtime Aspects
+Bundle-SymbolicName: org.eclipse.etrice.runtime.java.aspects
+Bundle-Version: 0.3.0.qualifier
+Export-Package: org.eclipse.etrice.runtime.java.aspects
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/runtime/org.eclipse.etrice.runtime.java.aspects/build.properties b/runtime/org.eclipse.etrice.runtime.java.aspects/build.properties
new file mode 100644
index 000000000..b107977f4
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.java.aspects/build.properties
@@ -0,0 +1,3 @@
+source.. = src/
+bin.includes = META-INF/,\
+ .
diff --git a/runtime/org.eclipse.etrice.runtime.java.aspects/build.xml b/runtime/org.eclipse.etrice.runtime.java.aspects/build.xml
new file mode 100644
index 000000000..3b7733551
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.java.aspects/build.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+======================================================================
+Bundles the aspects into a JAR library in the "release" folder
+
+NOTE: this build script must be run as part of the Eclipse build
+process. External build is not yet supported.
+======================================================================
+-->
+<project name="org.eclipse.etrice.runtime.java.aspects" default="package-jar">
+ <description>Contains aspects which apply to the eTrice Java runtime</description>
+ <target name="init">
+ <!-- TODO: set up basedir if not in eclipse -->
+ <!-- TODO: set up classpath with aspectj weaver if not in eclipse -->
+ <property name="jardir" value="${basedir}/dist" />
+ <property name="bindir" value="${basedir}/bin" />
+ <property name="srcdir" value="${basedir}/src" />
+ </target>
+ <target name="package-jar" depends="init">
+ <jar destfile="${jardir}/org.eclipse.etrice.runtime.java.aspects.jar">
+ <fileset dir="${bindir}" includes="**/*" />
+ <fileset dir="${srcdir}" includes="**/*" />
+ </jar>
+ </target>
+</project>
diff --git a/runtime/org.eclipse.etrice.runtime.java.aspects/dist/org.eclipse.etrice.runtime.java.aspects.jar b/runtime/org.eclipse.etrice.runtime.java.aspects/dist/org.eclipse.etrice.runtime.java.aspects.jar
new file mode 100644
index 000000000..359d70d4e
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.java.aspects/dist/org.eclipse.etrice.runtime.java.aspects.jar
Binary files differ
diff --git a/runtime/org.eclipse.etrice.runtime.java.aspects/src/org/eclipse/etrice/runtime/java/aspects/AbstractRTTrace.aj b/runtime/org.eclipse.etrice.runtime.java.aspects/src/org/eclipse/etrice/runtime/java/aspects/AbstractRTTrace.aj
new file mode 100644
index 000000000..a0e5b296e
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.java.aspects/src/org/eclipse/etrice/runtime/java/aspects/AbstractRTTrace.aj
@@ -0,0 +1,248 @@
+/*******************************************************************************
+ * 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:
+ * Eyrak Paen (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.runtime.java.aspects;
+
+import java.util.Map;
+import java.util.Deque;
+import java.util.HashMap;
+import java.util.LinkedList;
+import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
+import org.eclipse.etrice.runtime.java.messaging.IRTObject;
+import org.eclipse.etrice.runtime.java.messaging.RTObject;
+import org.eclipse.etrice.runtime.java.modelbase.RTSystem;
+import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+
+/**
+ * A simple trace aspect that produces synchronous MSC traces using the eTrice
+ * MSCLogger provided by DebuggingService.
+ */
+public abstract aspect AbstractRTTrace {
+ DebuggingService dbgSvc = DebuggingService.getInstance();
+
+ /**
+ * Used to keep track of the object context of constructor calls. Each
+ * thread has its own stack of objects.
+ */
+ Map<Thread, Deque<Object>> ctorFrames = new HashMap<Thread, Deque<Object>>();
+
+ /**
+ * Used to keep track of the object context of superclass inits. Each
+ * thread has its own stack of objects.
+ */
+ Map<Thread, Deque<Object>> initFrames = new HashMap<Thread, Deque<Object>>();
+
+ /**
+ * Used to keep track of the object context of superclass inits. Each
+ * thread has its own stack of objects.
+ */
+ Map<Thread, Object> lastFinishedInit = new HashMap<Thread, Object>();
+
+ /**
+ * Matches joinpoints in classes that implement IRTObject, except for
+ * concrete base implementation RTObject. Provided as a convenience for
+ * subclasses.
+ */
+ public pointcut rtClasses(): within(RTObject+ && !RTObject);
+
+ /**
+ * Matches join points in SubSystemClassBase constructor. Allows exclusion
+ * of joinpoints that occur before DebuggingService is initialized.
+ */
+ pointcut subsystemConstructors(): withincode(SubSystemClassBase+.new(..));
+
+ /**
+ * Matches calls to methods of IRTObject, to reduce verboseness of traces.
+ */
+ pointcut traceCallFilter(): call(* IRTObject.*(..));
+
+ /**
+ * Includes join points from trace pointcuts. Concrete extensions of this
+ * aspect must implement this pointcut.
+ */
+ public abstract pointcut traceScope();
+
+ /**
+ * Excludes join points from trace pointcuts. Concrete extensions of this
+ * aspect must implement this pointcut.
+ */
+ public abstract pointcut traceFilter();
+
+ /**
+ * Matches method calls from IRTObject to IRTObject. The pointcut uses the
+ * abstract pointcuts {@link AbstractRTTrace.traceScope} and
+ * {@link AbstractRTTrace.traceFilter} to control which join points are
+ * included and excluded, respectively. {@link AbstractRTTrace.traceFilter} is
+ * applied as a logical NOT.
+ *
+ * This pointcut also filters out calls to IRTObject methods and calls to
+ * the SubSystem constructors that might occur before DebuggingService is
+ * initialized.
+ */
+ pointcut rtMethodCall(IRTObject src, IRTObject tgt):
+ traceScope() &&
+ !traceFilter() &&
+ !traceCallFilter() &&
+ call(* *(..)) &&
+ !cflow(subsystemConstructors()) &&
+ this(src) && this(IRTObject) &&
+ target(tgt) && target(IRTObject);
+
+ pointcut rtConstructor():
+ traceScope() &&
+ !traceFilter() &&
+ !cflow(subsystemConstructors()) &&
+ !call(RTSystem.new(..)) && !initialization(RTSystem.new(..));
+
+ pointcut rtConstructorCall(IRTObject src):
+ rtConstructor() &&
+ call(*.new(..)) &&
+ this(src) && this(IRTObject);
+
+ pointcut rtConstructorInit(IRTObject tgt):
+ rtConstructor() &&
+ initialization(*.new(..)) &&
+ this(tgt) && this(IRTObject);
+
+ /**
+ * Logs trace messages before called methods using the MSCLogger provided
+ * by the DebuggerService singleton.
+ */
+ before(IRTObject src, IRTObject tgt): rtMethodCall(src, tgt) {
+ String srcLabel = getRTObjectLabel(src);
+ String tgtLabel = getRTObjectLabel(tgt);
+ String msgLabel = getMessageLabel(thisJoinPoint.getSignature().getName());
+ dbgSvc.getSyncLogger().addMessageSyncCall(srcLabel, tgtLabel, msgLabel);
+ }
+
+ /**
+ * Logs trace messages after called methods using the MSCLogger provided
+ * by the DebuggerService singleton.
+ */
+ after(IRTObject src, IRTObject tgt): rtMethodCall(src, tgt) {
+ String srcLabel = getRTObjectLabel(src);
+ String tgtLabel = getRTObjectLabel(tgt);
+ String msgLabel = getMessageLabel(thisJoinPoint.getSignature().getName());
+ dbgSvc.getSyncLogger().addMessageSyncReturn(srcLabel, tgtLabel, msgLabel);
+ }
+
+ before(IRTObject src): rtConstructorCall(src) {
+ // add src object to constructor call stack
+ Deque<Object> stack = getCtorStack(Thread.currentThread());
+ // if src is already on the stack, this means that we're past the superclass initializations but still inside src's init
+ if(stack.isEmpty() || src != stack.peekFirst()) {
+ stack.offerFirst(src);
+ }
+ // Testing
+ //System.out.println("ctor called in "+getObjectLabel(src));
+ }
+
+ before(IRTObject tgt): rtConstructorInit(tgt) {
+ Deque<Object> initStack = getInitStack(Thread.currentThread());
+ Deque<Object> stack = getCtorStack(Thread.currentThread());
+
+ Object src = stack.peekFirst();
+ if((initStack.isEmpty() || tgt != initStack.peekFirst()) &&
+ tgt != lastFinishedInit.get(Thread.currentThread())) {
+ String srcLabel = getObjectLabel(src);
+ String tgtLabel = getObjectLabel(tgt);
+ dbgSvc.getSyncLogger().addMessageCreate(srcLabel, tgtLabel);
+ // Testing
+ // System.out.println("(!)");
+ }
+ initStack.offerFirst(tgt);
+ // Testing
+ /*String srcLabel = getObjectLabel(src);
+ String tgtLabel = getObjectLabel(tgt);
+ System.out.println(srcLabel+"->"+tgtLabel+" (dtn="+thisJoinPoint.getSignature().getDeclaringTypeName()+",tgt="+src.getClass().getName()+")");
+ */
+ }
+
+ after(IRTObject tgt): rtConstructorInit(tgt) {
+ Deque<Object> initStack = getInitStack(Thread.currentThread());
+ initStack.pollFirst();
+ lastFinishedInit.put(Thread.currentThread(), tgt);
+ // Testing
+ /*Deque<Object> stack = getCtorStack(Thread.currentThread());
+ Object src = stack.peekFirst();
+ String srcLabel = getObjectLabel(src);
+ String tgtLabel = getObjectLabel(tgt);
+ System.out.println(srcLabel+"<-"+tgtLabel+" (dtn="+thisJoinPoint.getSignature().getDeclaringTypeName()+",tgt="+src.getClass().getName()+")");
+ */
+ }
+
+ after(IRTObject src): rtConstructorCall(src) {
+ // add src object to constructor call stack
+ Deque<Object> stack = getCtorStack(Thread.currentThread());
+ stack.pollFirst();
+ // Testing
+ // System.out.println("ctor returned to "+getObjectLabel(src));
+ }
+
+ /**
+ * Builds an MSC source or target label from the IRTObject's instance path.
+ * @param obj
+ * @return IRTObject instance label
+ */
+ static String getRTObjectLabel(IRTObject obj) {
+ String label;
+ if(obj == null) {
+ label = "unknown";
+ }
+ else {
+ label = obj.getInstancePath();
+ }
+ return label;
+ }
+
+ static String getObjectLabel(Object obj) {
+ String label;
+ if(obj == null) {
+ label = "unknown";
+ }
+ else if(obj instanceof IRTObject) {
+ label = getRTObjectLabel((IRTObject)obj);
+ }
+ else {
+ label = obj.toString();
+ }
+ return label;
+ }
+
+ /**
+ * Builds a MSC message label that includes the current thread's Id.
+ * @param msg
+ * @return message label with thread Id
+ */
+ static String getMessageLabel(String msg) {
+ String label = msg + " (tid=" + Thread.currentThread().getId() + ")";
+ return label;
+ }
+
+ Deque<Object> getCtorStack(Thread t) {
+ Deque<Object> stack = ctorFrames.get(t);
+ if(stack == null) {
+ stack = new LinkedList<Object>();
+ ctorFrames.put(t, stack);
+ }
+ return stack;
+ }
+
+ Deque<Object> getInitStack(Thread t) {
+ Deque<Object> stack = initFrames.get(t);
+ if(stack == null) {
+ stack = new LinkedList<Object>();
+ initFrames.put(t, stack);
+ }
+ return stack;
+ }
+}
diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/debugging/MSCLogger.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/debugging/MSCLogger.java
index 047aeb40d..b16f347de 100644
--- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/debugging/MSCLogger.java
+++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/debugging/MSCLogger.java
@@ -1,117 +1,122 @@
-/*******************************************************************************
- * Copyright (c) 2010 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:
- * Thomas Schuetz and Henrik Rentz-Reichert (initial contribution)
- *
- *******************************************************************************/
-
-
-package org.eclipse.etrice.runtime.java.debugging;
-
-import java.io.BufferedWriter;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Thomas Schuetz
- *
- * MSCLogger implements logging of sync and async MSCs into a file
- * MSC-format is that of Trace2UML (http://trace2uml.tigris.org/)
- *
- */
-public class MSCLogger {
-
- public void setMSC(String msc_name, String path){
- this.msc_name = msc_name;
- this.path = path;
- filter = new MSCFilter();
- }
-
- public synchronized void open(){
- is_open = true;
- }
-
-
- public synchronized void addMessageAsyncOut(String source, String target, String message){
- createLine(source, " >-- ", target, message);
- }
-
- public synchronized void addMessageAsyncIn(String source, String target, String message){
- createLine(source, " --> ", target, message);
- }
-
-
- public synchronized void addMessageSyncCall(String source, String target, String message){
- createLine(source, " ==> ", target, message);
- }
-
- public synchronized void addMessageSyncReturn(String source, String target, String message){
- createLine(source, " <== ", target, message);
- }
-
-
- public synchronized void addActorState(String actor, String state){
- if (filter.applyTo(actor))
- getCommandList().add( new String ("\t"+filter.reduceString(actor)+" >>> "+state) );
- }
-
- private void createLine(String source, String mid, String target, String message) {
- if (filter.applyTo(source) && filter.applyTo(target)) {
- getCommandList().add( new String ("\t"+filter.reduceString(source)+mid+filter.reduceString(target)+ " " +message) );
- }
- }
-
- public synchronized void close(){
- if (is_open){
- try{
- // Create file
- FileWriter fstream = new FileWriter("tmp/log/"+path+msc_name+".seq");
- BufferedWriter out = new BufferedWriter(fstream);
- //saveMSC(out);
- saveMSCforTrace2UML(out);
- out.close();
- }catch (Exception e){//Catch exception if any
- System.err.println("Error: " + e.getMessage());
- }
- }
- is_open = false;
- }
-
- private void saveMSCforTrace2UML(BufferedWriter out){
- try {
- out.write("#generated MSC for Trace2UML");
- out.newLine();
- for (String cmd : getCommandList()){
- out.write(cmd);
- out.newLine();
- }
- } catch (IOException e) {
- System.err.println("Error: " + e.getMessage());
- }
-
- }
-
- public List<String> getCommandList() {
- return commandList;
- }
-
- public MSCFilter getMSCFilter(){
- return filter;
- }
-
- private List<String> commandList = new ArrayList<String>();
-
- private MSCFilter filter = null;
-
- private String path = null;
- private String msc_name = null;
- private boolean is_open = false;
-
-}
+/*******************************************************************************
+ * Copyright (c) 2010 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:
+ * Thomas Schuetz and Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+
+package org.eclipse.etrice.runtime.java.debugging;
+
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Thomas Schuetz
+ *
+ * MSCLogger implements logging of sync and async MSCs into a file
+ * MSC-format is that of Trace2UML (http://trace2uml.tigris.org/)
+ *
+ */
+public class MSCLogger {
+
+ public void setMSC(String msc_name, String path){
+ this.msc_name = msc_name;
+ this.path = path;
+ filter = new MSCFilter();
+ }
+
+ public synchronized void open(){
+ is_open = true;
+ }
+
+
+ public synchronized void addMessageAsyncOut(String source, String target, String message){
+ createLine(source, " >-- ", target, message);
+ }
+
+ public synchronized void addMessageAsyncIn(String source, String target, String message){
+ createLine(source, " --> ", target, message);
+ }
+
+
+ public synchronized void addMessageSyncCall(String source, String target, String message){
+ createLine(source, " ==> ", target, message);
+ }
+
+ public synchronized void addMessageSyncReturn(String source, String target, String message){
+ createLine(source, " <== ", target, message);
+ }
+
+
+ public synchronized void addMessageCreate(String source, String target){
+ createLine(source, " (!) ", target, "");
+ }
+
+
+ public synchronized void addActorState(String actor, String state){
+ if (filter.applyTo(actor))
+ getCommandList().add( new String ("\t"+filter.reduceString(actor)+" >>> "+state) );
+ }
+
+ private void createLine(String source, String mid, String target, String message) {
+ if (filter.applyTo(source) && filter.applyTo(target)) {
+ getCommandList().add( new String ("\t"+filter.reduceString(source)+mid+filter.reduceString(target)+ " " +message) );
+ }
+ }
+
+ public synchronized void close(){
+ if (is_open){
+ try{
+ // Create file
+ FileWriter fstream = new FileWriter("tmp/log/"+path+msc_name+".seq");
+ BufferedWriter out = new BufferedWriter(fstream);
+ //saveMSC(out);
+ saveMSCforTrace2UML(out);
+ out.close();
+ }catch (Exception e){//Catch exception if any
+ System.err.println("Error: " + e.getMessage());
+ }
+ }
+ is_open = false;
+ }
+
+ private void saveMSCforTrace2UML(BufferedWriter out){
+ try {
+ out.write("#generated MSC for Trace2UML");
+ out.newLine();
+ for (String cmd : getCommandList()){
+ out.write(cmd);
+ out.newLine();
+ }
+ } catch (IOException e) {
+ System.err.println("Error: " + e.getMessage());
+ }
+
+ }
+
+ public List<String> getCommandList() {
+ return commandList;
+ }
+
+ public MSCFilter getMSCFilter(){
+ return filter;
+ }
+
+ private List<String> commandList = new ArrayList<String>();
+
+ private MSCFilter filter = null;
+
+ private String path = null;
+ private String msc_name = null;
+ private boolean is_open = false;
+
+}

Back to the top