Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Schuetz2011-03-23 19:40:49 -0400
committerThomas Schuetz2011-03-23 19:40:49 -0400
commita33255d770b7324c5e9edae2e9faa1978543413c (patch)
tree3be4edfa24f790e76da146483848caec1f69686b
parent0354e32be795c472c06850b82d715280c5247096 (diff)
downloadorg.eclipse.etrice-a33255d770b7324c5e9edae2e9faa1978543413c.tar.gz
org.eclipse.etrice-a33255d770b7324c5e9edae2e9faa1978543413c.tar.xz
org.eclipse.etrice-a33255d770b7324c5e9edae2e9faa1978543413c.zip
added optional User functions for all lifecycle functions (initUser, startUser, stopUser, destroyUser)
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/templates/ActorClass.xpt5
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/ActorClassBase.java8
2 files changed, 12 insertions, 1 deletions
diff --git a/plugins/org.eclipse.etrice.generator.java/src/templates/ActorClass.xpt b/plugins/org.eclipse.etrice.generator.java/src/templates/ActorClass.xpt
index d27a44886..6a54aa737 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/templates/ActorClass.xpt
+++ b/plugins/org.eclipse.etrice.generator.java/src/templates/ActorClass.xpt
@@ -96,10 +96,11 @@ public «IF ac.abstract»abstract «ENDIF»class «ac.name» extends «IF ac.base!=null
//--------------------- lifecycle functions
public void init(){
- //System.out.println(toString()+"::init()");
+ initUser();
}
public void start(){
+ startUser();
«IF xpac.hasStateMachine()-»
executeInitTransition();
«ENDIF-»
@@ -107,10 +108,12 @@ public «IF ac.abstract»abstract «ENDIF»class «ac.name» extends «IF ac.base!=null
«IF !ac.overridesStop()»
public void stop(){
+ stopUser();
}
«ENDIF»
public void destroy(){
+ destroyUser();
}
«IF ac.stateMachine != null»
diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/ActorClassBase.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/ActorClassBase.java
index 57a8eb84a..f441da604 100644
--- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/ActorClassBase.java
+++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/ActorClassBase.java
@@ -65,11 +65,19 @@ public abstract class ActorClassBase extends EventReceiver implements IMessageRe
}
//--------------------- lifecycle functions
+ // automatically generated lifecycle functions
public abstract void init();
public abstract void start();
public abstract void stop();
public abstract void destroy();
+ // not automatically generated lifecycle functions
+ // are called, but with empty implementation -> can be overridden by user
+ public void initUser(){}
+ public void startUser(){}
+ public void stopUser(){}
+ public void destroyUser(){}
+
@Override
public void receive(Message msg) {
}

Back to the top