Просмотр исходного кода

Refactoring of ListenerInterface. Added explicit callbacks for events and variables.
Added explicit ListenerInterface for TimeEvents.

markus.muehlbrandt@itemis.de 14 лет назад
Родитель
Сommit
e3d686fdd2
40 измененных файлов с 227 добавлено и 158 удалено
  1. 3 1
      examples/org.yakindu.sct.generator.java.trafficlight/src-gen/org/yakindu/sct/runtime/java/INotificationListener.java
  2. 2 2
      examples/org.yakindu.sct.generator.java.trafficlight/src-gen/org/yakindu/sct/runtime/java/ITimedStatemachine.java
  3. 17 0
      examples/org.yakindu.sct.generator.java.trafficlight/src-gen/org/yakindu/sct/runtime/java/ITimerNotificationListener.java
  4. 9 2
      examples/org.yakindu.sct.generator.java.trafficlight/src-gen/org/yakindu/sct/runtime/java/NotificationSender.java
  5. 1 2
      examples/org.yakindu.sct.generator.java.trafficlight/src-gen/org/yakindu/sct/runtime/java/RuntimeService.java
  6. 1 1
      examples/org.yakindu.sct.generator.java.trafficlight/src-gen/org/yakindu/sct/runtime/java/TimerService.java
  7. 2 7
      examples/org.yakindu.sct.generator.java.trafficlight/src-gen/org/yakindu/sct/runtime/java/trafficlightwaiting/TrafficLightWaitingCycleBasedStatemachine.java
  8. 3 3
      examples/org.yakindu.sct.generator.java.trafficlight/src-gen/org/yakindu/sct/runtime/java/trafficlightwaiting/TrafficLightWaitingEventBasedStatemachine.java
  9. 2 7
      plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/CustomCycleBasedStatemachine.xpt
  10. 3 3
      plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/CustomEventBasedStatemachine.xpt
  11. 4 4
      plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/CustomInterfaceImpl.xpt
  12. 5 3
      plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/INotificationListener.xpt
  13. 2 2
      plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/ITimedStatemachine.xpt
  14. 27 0
      plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/ITimerNotificationListener.xpt
  15. 2 0
      plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/Main.xpt
  16. 9 2
      plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/NotificationSender.xpt
  17. 1 2
      plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/RuntimeService.xpt
  18. 1 1
      plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/TimerService.xpt
  19. 3 1
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/INotificationListener.java
  20. 2 2
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/ITimedStatemachine.java
  21. 17 0
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/ITimerNotificationListener.java
  22. 9 2
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/NotificationSender.java
  23. 1 2
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/RuntimeService.java
  24. 1 1
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/TimerService.java
  25. 8 8
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/interfacetest/DefaultInterfaceImpl.java
  26. 4 4
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/interfacetest/InterfaceOtherImpl.java
  27. 4 4
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/interfacetest/InterfaceThirdImpl.java
  28. 12 12
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_expression/DefaultInterfaceImpl.java
  29. 7 7
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_expression/InterfaceOtherImpl.java
  30. 2 5
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_expression/Test_ExpressionCycleBasedStatemachine.java
  31. 5 5
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_hierarchy/DefaultInterfaceImpl.java
  32. 7 7
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_localactions/DefaultInterfaceImpl.java
  33. 3 10
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_localactions/Test_LocalActionsCycleBasedStatemachine.java
  34. 3 3
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_localactions/Test_LocalActionsEventBasedStatemachine.java
  35. 5 5
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_parallelregions/DefaultInterfaceImpl.java
  36. 6 6
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_transition/DefaultInterfaceImpl.java
  37. 1 1
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_transition/InterfaceAImpl.java
  38. 2 7
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_transition/Test_TransitionCycleBasedStatemachine.java
  39. 3 3
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_transition/Test_TransitionEventBasedStatemachine.java
  40. 28 21
      test-plugins/org.yakindu.sct.generator.java.runtime.test/src/org/yakindu/sct/generator/java/runtime/test/TestInterfaceTestEventBasedStatemachine.java

+ 3 - 1
examples/org.yakindu.sct.generator.java.trafficlight/src-gen/org/yakindu/sct/runtime/java/INotificationListener.java

@@ -12,6 +12,8 @@ package org.yakindu.sct.runtime.java;
 
 public interface INotificationListener {
 
-	public void notify(Notification notification);
+	public void onEventRaised(EventNotification notification);
+
+	public void onVariableChanged(VariableNotification<?> notification);
 
 }

+ 2 - 2
examples/org.yakindu.sct.generator.java.trafficlight/src-gen/org/yakindu/sct/runtime/java/ITimedStatemachine.java

@@ -10,12 +10,12 @@ Contributors:
  */
 package org.yakindu.sct.runtime.java;
 
-import org.yakindu.sct.runtime.java.INotificationListener;
+import org.yakindu.sct.runtime.java.ITimerNotificationListener;
 
 public interface ITimedStatemachine
 		extends
 			IStatemachine,
-			INotificationListener {
+			ITimerNotificationListener {
 
 	public void setTimerService(ITimerService timerService);
 

+ 17 - 0
examples/org.yakindu.sct.generator.java.trafficlight/src-gen/org/yakindu/sct/runtime/java/ITimerNotificationListener.java

@@ -0,0 +1,17 @@
+/**
+Copyright (c) 2011 committers of YAKINDU and others. 
+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:
+	committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.runtime.java;
+
+public interface ITimerNotificationListener {
+
+	public void onTimeEventRaised(TimeEvent<? extends Enum<?>> timeEvent);
+
+}

+ 9 - 2
examples/org.yakindu.sct.generator.java.trafficlight/src-gen/org/yakindu/sct/runtime/java/NotificationSender.java

@@ -25,9 +25,16 @@ public class NotificationSender implements INotificationSender {
 		return listeners.remove(listener);
 	}
 
-	protected void notifyListeners(Notification notification) {
+	protected void notifyListenersOnEventRaised(EventNotification notification) {
 		for (INotificationListener listener : listeners) {
-			listener.notify(notification);
+			listener.onEventRaised(notification);
+		}
+	}
+
+	protected void notifyListenersOnVariableChanged(
+			VariableNotification<?> notification) {
+		for (INotificationListener listener : listeners) {
+			listener.onVariableChanged(notification);
 		}
 	}
 }

+ 1 - 2
examples/org.yakindu.sct.generator.java.trafficlight/src-gen/org/yakindu/sct/runtime/java/RuntimeService.java

@@ -16,7 +16,7 @@ import java.util.Timer;
 import java.util.TimerTask;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
-public class RuntimeService extends NotificationSender {
+public class RuntimeService {
 
 	private Timer timer = new Timer();
 
@@ -31,7 +31,6 @@ public class RuntimeService extends NotificationSender {
 			lock.readLock().lock();
 			for (IStatemachine statemachine : statemachineSet) {
 				statemachine.runCycle();
-				notifyListeners(new RuntimeCycleNotification(statemachine));
 			}
 			lock.readLock().unlock();
 		}

+ 1 - 1
examples/org.yakindu.sct.generator.java.trafficlight/src-gen/org/yakindu/sct/runtime/java/TimerService.java

@@ -35,7 +35,7 @@ public class TimerService implements ITimerService {
 		timerTaskMap.put(event, new TimerTask() {
 			@Override
 			public void run() {
-				event.getStatemachine().notify(new EventNotification(event));
+				event.getStatemachine().onTimeEventRaised(event);
 			}
 		});
 

+ 2 - 7
examples/org.yakindu.sct.generator.java.trafficlight/src-gen/org/yakindu/sct/runtime/java/trafficlightwaiting/TrafficLightWaitingCycleBasedStatemachine.java

@@ -17,8 +17,6 @@ import org.yakindu.sct.runtime.java.EventVector;
 import org.yakindu.sct.runtime.java.TimeEvent;
 import org.yakindu.sct.runtime.java.ITimedStatemachine;
 import org.yakindu.sct.runtime.java.ITimerService;
-import org.yakindu.sct.runtime.java.EventNotification;
-import org.yakindu.sct.runtime.java.Notification;
 
 public class TrafficLightWaitingCycleBasedStatemachine
 		implements
@@ -129,11 +127,8 @@ public class TrafficLightWaitingCycleBasedStatemachine
 		return timerService;
 	}
 
-	public void notify(Notification notification) {
-		if (notification instanceof EventNotification) {
-			EventNotification eventNotification = (EventNotification) notification;
-			getOccuredEvents().add(eventNotification.getEvent());
-		}
+	public void onTimeEventRaised(TimeEvent<? extends Enum<?>> timeEvent) {
+		getOccuredEvents().add(timeEvent);
 	}
 
 	public InterfaceTrafficLight getInterfaceTrafficLight() {

+ 3 - 3
examples/org.yakindu.sct.generator.java.trafficlight/src-gen/org/yakindu/sct/runtime/java/trafficlightwaiting/TrafficLightWaitingEventBasedStatemachine.java

@@ -14,7 +14,7 @@ import java.util.LinkedList;
 
 import org.yakindu.sct.runtime.java.Event;
 
-import org.yakindu.sct.runtime.java.Notification;
+import org.yakindu.sct.runtime.java.TimeEvent;
 
 public class TrafficLightWaitingEventBasedStatemachine
 		extends
@@ -37,8 +37,8 @@ public class TrafficLightWaitingEventBasedStatemachine
 		return defaultInterface;
 	}
 
-	public void notify(Notification notification) {
-		super.notify(notification);
+	public void onTimeEventRaised(TimeEvent<? extends Enum<?>> timeEvent) {
+		super.onTimeEventRaised(timeEvent);
 		runCycle();
 	}
 

+ 2 - 7
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/CustomCycleBasedStatemachine.xpt

@@ -236,8 +236,6 @@ import 
 	import «entry.getBasePackageName()».TimeEvent;
 	import «entry.getBasePackageName()».ITimedStatemachine;
 	import «entry.getBasePackageName()».ITimerService;
-	import «entry.getBasePackageName()».EventNotification;
-	import «entry.getBasePackageName()».Notification;
 «ELSE-»
 	import «entry.getBasePackageName()».IStatemachine;
 «ENDIF-»
@@ -375,11 +373,8 @@ public class 
 		return timerService;
 	}
 	
-	public void notify(Notification notification) {
-		if (notification instanceof EventNotification) {
-			EventNotification eventNotification = (EventNotification) notification;
-			getOccuredEvents().add(eventNotification.getEvent());
-		}
+	public void onTimeEventRaised(TimeEvent<? extends Enum<?>> timeEvent) {
+		getOccuredEvents().add(timeEvent);
 	}
 	«ENDIF-»
 	

+ 3 - 3
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/CustomEventBasedStatemachine.xpt

@@ -25,7 +25,7 @@ import java.util.LinkedList;
 import «entry.getBasePackageName()».Event;
 
 «IF isTimedStatemachine()-»
-	import «entry.getBasePackageName()».Notification;
+	import org.yakindu.sct.runtime.java.TimeEvent;
 «ENDIF-»
 
 public class «getEventBasedStatemachineName()» extends «getCycleBasedStatemachineName()» {
@@ -73,8 +73,8 @@ public class 
 	«ENDIF-»
 	
 	«IF isTimedStatemachine()-»	
-	public void notify(Notification notification) {
-		super.notify(notification);
+	public void onTimeEventRaised(TimeEvent<? extends Enum<?>> timeEvent) {
+		super.onTimeEventRaised(timeEvent);
 		runCycle();
 	}
 	«ENDIF-»

+ 4 - 4
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/CustomInterfaceImpl.xpt

@@ -103,7 +103,7 @@ public class 
 		«IF event.direction ==  Direction::OUT-»
 		statemachine.getOutEvents().add(«event.getter()»);
 		«IF entry.createInterfaceObserverSupport()-»
-			notifyListeners(new EventNotification(«event.getter()»));
+			notifyListenersOnEventRaised(new EventNotification(«event.getter()»));
 		«ENDIF-»
 		«ENDIF-»
 	}
@@ -113,7 +113,7 @@ public class 
 		«IF event.direction ==  Direction::OUT-»
 			statemachine.getOutEvents().add(«event.getter()»);
 			«IF entry.createInterfaceObserverSupport()-»
-			notifyListeners(new EventNotification(«event.getter()»));
+			notifyListenersOnEventRaised(new EventNotification(«event.getter()»));
 			«ENDIF-»
 		«ENDIF-»
 	}
@@ -171,7 +171,7 @@ public class 
 		«variable.getValueName()» = value;
 		«ENDIF-»
 		«IF entry.createInterfaceObserverSupport()-»
-			notifyListeners(new VariableNotification<«variable.type.getJavaClassType()»>(Variables.«variable.name», «variable.getter()», oldValue));
+			notifyListenersOnVariableChanged(new VariableNotification<«variable.type.getJavaClassType()»>(Variables.«variable.name», «variable.getter()», oldValue));
 		«ENDIF-»
 	}	
 	«ENDFOREACH-»
@@ -210,7 +210,7 @@ public class 
 				&& variableMap.get(name).getClass() == value.getClass()) {
 			Object oldValue = variableMap.get(name);
 			variableMap.put(name, value);
-			notifyListeners(new VariableNotification<Object>(
+			notifyListenersOnVariableChanged(new VariableNotification<Object>(
 					Variables.valueOf(name), variableMap.get(name), oldValue));
 			return true;
 		}

+ 5 - 3
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/INotificationListener.xpt

@@ -18,10 +18,12 @@ Contributors:
 package «entry.getBasePackageName()»;
 
 public interface INotificationListener {
+	
+	public void onEventRaised(EventNotification notification);
+	
+	public void onVariableChanged(VariableNotification<?> notification);
 
-	public void notify(Notification notification);
-
-}
+}	
 «ENDFILE-»
 «ENDIF-»
 «ENDDEFINE»

+ 2 - 2
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/ITimedStatemachine.xpt

@@ -16,10 +16,10 @@ Contributors:
 «getLicenseHeader(entry)»
 package «entry.getBasePackageName()»;
 
-import «entry.getBasePackageName()».INotificationListener;
+import «entry.getBasePackageName()».ITimerNotificationListener;
 
 public interface ITimedStatemachine extends
-		IStatemachine, INotificationListener {
+		IStatemachine, ITimerNotificationListener {
 
 	public void setTimerService(ITimerService timerService);
 

+ 27 - 0
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/ITimerNotificationListener.xpt

@@ -0,0 +1,27 @@
+«REM»
+Copyright (c) 2011 committers of YAKINDU and others.
+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:
+	Markus Muehlbrandt - Initial contribution and API
+«ENDREM»
+«IMPORT sexec»
+
+«EXTENSION org::yakindu::sct::generator::java::templates::GenmodelEntries»
+
+«DEFINE file(sgen::GeneratorEntry entry) FOR ExecutionFlow-»
+«IF name != null-»
+«FILE entry.getBasePackagePath()+'/ITimerNotificationListener.java'-»
+«getLicenseHeader(entry)»
+package «entry.getBasePackageName()»;
+
+public interface ITimerNotificationListener {
+	
+	public void onTimeEventRaised(TimeEvent<? extends Enum<?>> timeEvent);
+
+}	
+«ENDFILE-»
+«ENDIF-»
+«ENDDEFINE»

+ 2 - 0
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/Main.xpt

@@ -24,6 +24,8 @@ Contributors:
 	
 	«EXPAND ITimerService::file(entry) FOR this»
 	
+	«EXPAND ITimerNotificationListener::file(entry) FOR this»
+	
 	«IF entry.createTimerService()»
 		«EXPAND TimerService::file(entry) FOR this»
 	«ENDIF»

+ 9 - 2
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/NotificationSender.xpt

@@ -32,9 +32,16 @@ public class NotificationSender implements INotificationSender {
 		return listeners.remove(listener);
 	}
 
-	protected void notifyListeners(Notification notification) {
+	protected void notifyListenersOnEventRaised(EventNotification notification) {
 		for (INotificationListener listener : listeners) {
-			listener.notify(notification);
+			listener.onEventRaised(notification);
+		}
+	}
+
+	protected void notifyListenersOnVariableChanged(
+			VariableNotification<?> notification) {
+		for (INotificationListener listener : listeners) {
+			listener.onVariableChanged(notification);
 		}
 	}
 }

+ 1 - 2
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/RuntimeService.xpt

@@ -23,7 +23,7 @@ import java.util.Timer;
 import java.util.TimerTask;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
-public class RuntimeService extends NotificationSender {
+public class RuntimeService {
 
 	private Timer timer = new Timer();
 
@@ -38,7 +38,6 @@ public class RuntimeService extends NotificationSender {
 			lock.readLock().lock();
 			for (IStatemachine statemachine : statemachineSet) {
 				statemachine.runCycle();
-				notifyListeners(new RuntimeCycleNotification(statemachine));
 			}
 			lock.readLock().unlock();
 		}

+ 1 - 1
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/TimerService.xpt

@@ -42,7 +42,7 @@ public class TimerService implements ITimerService {
 		timerTaskMap.put(event, new TimerTask() {
 			@Override
 			public void run() {
-				event.getStatemachine().notify(new EventNotification(event));
+				event.getStatemachine().onTimeEventRaised(event);
 			}
 		});
 

+ 3 - 1
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/INotificationListener.java

@@ -12,6 +12,8 @@ package org.yakindu.sct.runtime.java;
 
 public interface INotificationListener {
 
-	public void notify(Notification notification);
+	public void onEventRaised(EventNotification notification);
+
+	public void onVariableChanged(VariableNotification<?> notification);
 
 }

+ 2 - 2
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/ITimedStatemachine.java

@@ -10,12 +10,12 @@ Contributors:
  */
 package org.yakindu.sct.runtime.java;
 
-import org.yakindu.sct.runtime.java.INotificationListener;
+import org.yakindu.sct.runtime.java.ITimerNotificationListener;
 
 public interface ITimedStatemachine
 		extends
 			IStatemachine,
-			INotificationListener {
+			ITimerNotificationListener {
 
 	public void setTimerService(ITimerService timerService);
 

+ 17 - 0
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/ITimerNotificationListener.java

@@ -0,0 +1,17 @@
+/**
+Copyright (c) 2011 committers of YAKINDU and others. 
+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:
+	committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.runtime.java;
+
+public interface ITimerNotificationListener {
+
+	public void onTimeEventRaised(TimeEvent<? extends Enum<?>> timeEvent);
+
+}

+ 9 - 2
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/NotificationSender.java

@@ -25,9 +25,16 @@ public class NotificationSender implements INotificationSender {
 		return listeners.remove(listener);
 	}
 
-	protected void notifyListeners(Notification notification) {
+	protected void notifyListenersOnEventRaised(EventNotification notification) {
 		for (INotificationListener listener : listeners) {
-			listener.notify(notification);
+			listener.onEventRaised(notification);
+		}
+	}
+
+	protected void notifyListenersOnVariableChanged(
+			VariableNotification<?> notification) {
+		for (INotificationListener listener : listeners) {
+			listener.onVariableChanged(notification);
 		}
 	}
 }

+ 1 - 2
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/RuntimeService.java

@@ -16,7 +16,7 @@ import java.util.Timer;
 import java.util.TimerTask;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
-public class RuntimeService extends NotificationSender {
+public class RuntimeService {
 
 	private Timer timer = new Timer();
 
@@ -31,7 +31,6 @@ public class RuntimeService extends NotificationSender {
 			lock.readLock().lock();
 			for (IStatemachine statemachine : statemachineSet) {
 				statemachine.runCycle();
-				notifyListeners(new RuntimeCycleNotification(statemachine));
 			}
 			lock.readLock().unlock();
 		}

+ 1 - 1
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/TimerService.java

@@ -35,7 +35,7 @@ public class TimerService implements ITimerService {
 		timerTaskMap.put(event, new TimerTask() {
 			@Override
 			public void run() {
-				event.getStatemachine().notify(new EventNotification(event));
+				event.getStatemachine().onTimeEventRaised(event);
 			}
 		});
 

+ 8 - 8
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/interfacetest/DefaultInterfaceImpl.java

@@ -56,7 +56,7 @@ public class DefaultInterfaceImpl extends NotificationSender
 		getEventEvent2().setValue(value);
 		statemachine.getOccuredEvents().add(getEventEvent2());
 		statemachine.getOutEvents().add(getEventEvent2());
-		notifyListeners(new EventNotification(getEventEvent2()));
+		notifyListenersOnEventRaised(new EventNotification(getEventEvent2()));
 	}
 
 	@SuppressWarnings("unchecked")
@@ -75,8 +75,8 @@ public class DefaultInterfaceImpl extends NotificationSender
 	public void setVarVar1(boolean value) {
 		boolean oldValue = getVarVar1();
 		variableMap.put("var1", new Boolean(value));
-		notifyListeners(new VariableNotification<Boolean>(Variables.var1,
-				getVarVar1(), oldValue));
+		notifyListenersOnVariableChanged(new VariableNotification<Boolean>(
+				Variables.var1, getVarVar1(), oldValue));
 	}
 	public double getVarVar2() {
 		return (Double) variableMap.get("var2");
@@ -85,8 +85,8 @@ public class DefaultInterfaceImpl extends NotificationSender
 	public void setVarVar2(double value) {
 		double oldValue = getVarVar2();
 		variableMap.put("var2", new Double(value));
-		notifyListeners(new VariableNotification<Double>(Variables.var2,
-				getVarVar2(), oldValue));
+		notifyListenersOnVariableChanged(new VariableNotification<Double>(
+				Variables.var2, getVarVar2(), oldValue));
 	}
 	public int getVarVar3() {
 		return (Integer) variableMap.get("var3");
@@ -95,8 +95,8 @@ public class DefaultInterfaceImpl extends NotificationSender
 	public void setVarVar3(int value) {
 		int oldValue = getVarVar3();
 		variableMap.put("var3", new Integer(value));
-		notifyListeners(new VariableNotification<Integer>(Variables.var3,
-				getVarVar3(), oldValue));
+		notifyListenersOnVariableChanged(new VariableNotification<Integer>(
+				Variables.var3, getVarVar3(), oldValue));
 	}
 
 	public boolean raiseEvent(String name) {
@@ -125,7 +125,7 @@ public class DefaultInterfaceImpl extends NotificationSender
 				&& variableMap.get(name).getClass() == value.getClass()) {
 			Object oldValue = variableMap.get(name);
 			variableMap.put(name, value);
-			notifyListeners(new VariableNotification<Object>(
+			notifyListenersOnVariableChanged(new VariableNotification<Object>(
 					Variables.valueOf(name), variableMap.get(name), oldValue));
 			return true;
 		}

+ 4 - 4
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/interfacetest/InterfaceOtherImpl.java

@@ -52,7 +52,7 @@ public class InterfaceOtherImpl extends NotificationSender
 	public void raiseEvent4() {
 		statemachine.getOccuredEvents().add(getEventEvent4());
 		statemachine.getOutEvents().add(getEventEvent4());
-		notifyListeners(new EventNotification(getEventEvent4()));
+		notifyListenersOnEventRaised(new EventNotification(getEventEvent4()));
 	}
 
 	public Event<Events> getEventEvent4() {
@@ -70,8 +70,8 @@ public class InterfaceOtherImpl extends NotificationSender
 	public void setVarV1(int value) {
 		int oldValue = getVarV1();
 		variableMap.put("v1", new Integer(value));
-		notifyListeners(new VariableNotification<Integer>(Variables.v1,
-				getVarV1(), oldValue));
+		notifyListenersOnVariableChanged(new VariableNotification<Integer>(
+				Variables.v1, getVarV1(), oldValue));
 	}
 
 	public boolean raiseEvent(String name) {
@@ -100,7 +100,7 @@ public class InterfaceOtherImpl extends NotificationSender
 				&& variableMap.get(name).getClass() == value.getClass()) {
 			Object oldValue = variableMap.get(name);
 			variableMap.put(name, value);
-			notifyListeners(new VariableNotification<Object>(
+			notifyListenersOnVariableChanged(new VariableNotification<Object>(
 					Variables.valueOf(name), variableMap.get(name), oldValue));
 			return true;
 		}

+ 4 - 4
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/interfacetest/InterfaceThirdImpl.java

@@ -54,7 +54,7 @@ public class InterfaceThirdImpl extends NotificationSender
 		getEventEvent6().setValue(value);
 		statemachine.getOccuredEvents().add(getEventEvent6());
 		statemachine.getOutEvents().add(getEventEvent6());
-		notifyListeners(new EventNotification(getEventEvent6()));
+		notifyListenersOnEventRaised(new EventNotification(getEventEvent6()));
 	}
 
 	@SuppressWarnings("unchecked")
@@ -73,8 +73,8 @@ public class InterfaceThirdImpl extends NotificationSender
 	public void setVarV1(double value) {
 		double oldValue = getVarV1();
 		variableMap.put("v1", new Double(value));
-		notifyListeners(new VariableNotification<Double>(Variables.v1,
-				getVarV1(), oldValue));
+		notifyListenersOnVariableChanged(new VariableNotification<Double>(
+				Variables.v1, getVarV1(), oldValue));
 	}
 
 	public boolean raiseEvent(String name) {
@@ -103,7 +103,7 @@ public class InterfaceThirdImpl extends NotificationSender
 				&& variableMap.get(name).getClass() == value.getClass()) {
 			Object oldValue = variableMap.get(name);
 			variableMap.put(name, value);
-			notifyListeners(new VariableNotification<Object>(
+			notifyListenersOnVariableChanged(new VariableNotification<Object>(
 					Variables.valueOf(name), variableMap.get(name), oldValue));
 			return true;
 		}

+ 12 - 12
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_expression/DefaultInterfaceImpl.java

@@ -63,7 +63,7 @@ public class DefaultInterfaceImpl extends NotificationSender
 		getEventEvent2().setValue(value);
 		statemachine.getOccuredEvents().add(getEventEvent2());
 		statemachine.getOutEvents().add(getEventEvent2());
-		notifyListeners(new EventNotification(getEventEvent2()));
+		notifyListenersOnEventRaised(new EventNotification(getEventEvent2()));
 	}
 
 	@SuppressWarnings("unchecked")
@@ -90,8 +90,8 @@ public class DefaultInterfaceImpl extends NotificationSender
 	public void setVarVar1(int value) {
 		int oldValue = getVarVar1();
 		variableMap.put("var1", new Integer(value));
-		notifyListeners(new VariableNotification<Integer>(Variables.var1,
-				getVarVar1(), oldValue));
+		notifyListenersOnVariableChanged(new VariableNotification<Integer>(
+				Variables.var1, getVarVar1(), oldValue));
 	}
 	public int getVarVar2() {
 		return (Integer) variableMap.get("var2");
@@ -100,8 +100,8 @@ public class DefaultInterfaceImpl extends NotificationSender
 	public void setVarVar2(int value) {
 		int oldValue = getVarVar2();
 		variableMap.put("var2", new Integer(value));
-		notifyListeners(new VariableNotification<Integer>(Variables.var2,
-				getVarVar2(), oldValue));
+		notifyListenersOnVariableChanged(new VariableNotification<Integer>(
+				Variables.var2, getVarVar2(), oldValue));
 	}
 	public double getVarVar3() {
 		return (Double) variableMap.get("var3");
@@ -110,8 +110,8 @@ public class DefaultInterfaceImpl extends NotificationSender
 	public void setVarVar3(double value) {
 		double oldValue = getVarVar3();
 		variableMap.put("var3", new Double(value));
-		notifyListeners(new VariableNotification<Double>(Variables.var3,
-				getVarVar3(), oldValue));
+		notifyListenersOnVariableChanged(new VariableNotification<Double>(
+				Variables.var3, getVarVar3(), oldValue));
 	}
 	public double getVarVar4() {
 		return (Double) variableMap.get("var4");
@@ -120,8 +120,8 @@ public class DefaultInterfaceImpl extends NotificationSender
 	public void setVarVar4(double value) {
 		double oldValue = getVarVar4();
 		variableMap.put("var4", new Double(value));
-		notifyListeners(new VariableNotification<Double>(Variables.var4,
-				getVarVar4(), oldValue));
+		notifyListenersOnVariableChanged(new VariableNotification<Double>(
+				Variables.var4, getVarVar4(), oldValue));
 	}
 	public boolean getVarVar5() {
 		return (Boolean) variableMap.get("var5");
@@ -130,8 +130,8 @@ public class DefaultInterfaceImpl extends NotificationSender
 	public void setVarVar5(boolean value) {
 		boolean oldValue = getVarVar5();
 		variableMap.put("var5", new Boolean(value));
-		notifyListeners(new VariableNotification<Boolean>(Variables.var5,
-				getVarVar5(), oldValue));
+		notifyListenersOnVariableChanged(new VariableNotification<Boolean>(
+				Variables.var5, getVarVar5(), oldValue));
 	}
 
 	public boolean raiseEvent(String name) {
@@ -160,7 +160,7 @@ public class DefaultInterfaceImpl extends NotificationSender
 				&& variableMap.get(name).getClass() == value.getClass()) {
 			Object oldValue = variableMap.get(name);
 			variableMap.put(name, value);
-			notifyListeners(new VariableNotification<Object>(
+			notifyListenersOnVariableChanged(new VariableNotification<Object>(
 					Variables.valueOf(name), variableMap.get(name), oldValue));
 			return true;
 		}

+ 7 - 7
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_expression/InterfaceOtherImpl.java

@@ -36,8 +36,8 @@ public class InterfaceOtherImpl extends NotificationSender
 	public void setVarVar1(boolean value) {
 		boolean oldValue = getVarVar1();
 		variableMap.put("var1", new Boolean(value));
-		notifyListeners(new VariableNotification<Boolean>(Variables.var1,
-				getVarVar1(), oldValue));
+		notifyListenersOnVariableChanged(new VariableNotification<Boolean>(
+				Variables.var1, getVarVar1(), oldValue));
 	}
 	public double getVarVar2() {
 		return (Double) variableMap.get("var2");
@@ -46,8 +46,8 @@ public class InterfaceOtherImpl extends NotificationSender
 	public void setVarVar2(double value) {
 		double oldValue = getVarVar2();
 		variableMap.put("var2", new Double(value));
-		notifyListeners(new VariableNotification<Double>(Variables.var2,
-				getVarVar2(), oldValue));
+		notifyListenersOnVariableChanged(new VariableNotification<Double>(
+				Variables.var2, getVarVar2(), oldValue));
 	}
 	public int getVarVar3() {
 		return (Integer) variableMap.get("var3");
@@ -56,8 +56,8 @@ public class InterfaceOtherImpl extends NotificationSender
 	public void setVarVar3(int value) {
 		int oldValue = getVarVar3();
 		variableMap.put("var3", new Integer(value));
-		notifyListeners(new VariableNotification<Integer>(Variables.var3,
-				getVarVar3(), oldValue));
+		notifyListenersOnVariableChanged(new VariableNotification<Integer>(
+				Variables.var3, getVarVar3(), oldValue));
 	}
 
 	public boolean raiseEvent(String name) {
@@ -73,7 +73,7 @@ public class InterfaceOtherImpl extends NotificationSender
 				&& variableMap.get(name).getClass() == value.getClass()) {
 			Object oldValue = variableMap.get(name);
 			variableMap.put(name, value);
-			notifyListeners(new VariableNotification<Object>(
+			notifyListenersOnVariableChanged(new VariableNotification<Object>(
 					Variables.valueOf(name), variableMap.get(name), oldValue));
 			return true;
 		}

+ 2 - 5
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_expression/Test_ExpressionCycleBasedStatemachine.java

@@ -179,11 +179,8 @@ public class Test_ExpressionCycleBasedStatemachine
 			stateVector[0] = State.State1;
 
 		} else {
-			if (true) {
-				getDefaultInterfaceImpl().setVarVar1(
-						getDefaultInterfaceImpl().getVarVar1() + (1));
-
-			}
+			getDefaultInterfaceImpl().setVarVar1(
+					getDefaultInterfaceImpl().getVarVar1() + (1));
 
 		}
 	}

+ 5 - 5
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_hierarchy/DefaultInterfaceImpl.java

@@ -188,8 +188,8 @@ public class DefaultInterfaceImpl extends NotificationSender
 	public void setVarS1(int value) {
 		int oldValue = getVarS1();
 		variableMap.put("s1", new Integer(value));
-		notifyListeners(new VariableNotification<Integer>(Variables.s1,
-				getVarS1(), oldValue));
+		notifyListenersOnVariableChanged(new VariableNotification<Integer>(
+				Variables.s1, getVarS1(), oldValue));
 	}
 	public int getVarS2() {
 		return (Integer) variableMap.get("s2");
@@ -198,8 +198,8 @@ public class DefaultInterfaceImpl extends NotificationSender
 	public void setVarS2(int value) {
 		int oldValue = getVarS2();
 		variableMap.put("s2", new Integer(value));
-		notifyListeners(new VariableNotification<Integer>(Variables.s2,
-				getVarS2(), oldValue));
+		notifyListenersOnVariableChanged(new VariableNotification<Integer>(
+				Variables.s2, getVarS2(), oldValue));
 	}
 
 	public boolean raiseEvent(String name) {
@@ -228,7 +228,7 @@ public class DefaultInterfaceImpl extends NotificationSender
 				&& variableMap.get(name).getClass() == value.getClass()) {
 			Object oldValue = variableMap.get(name);
 			variableMap.put(name, value);
-			notifyListeners(new VariableNotification<Object>(
+			notifyListenersOnVariableChanged(new VariableNotification<Object>(
 					Variables.valueOf(name), variableMap.get(name), oldValue));
 			return true;
 		}

+ 7 - 7
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_localactions/DefaultInterfaceImpl.java

@@ -81,8 +81,8 @@ public class DefaultInterfaceImpl extends NotificationSender
 	public void setVarI(int value) {
 		int oldValue = getVarI();
 		variableMap.put("i", new Integer(value));
-		notifyListeners(new VariableNotification<Integer>(Variables.i,
-				getVarI(), oldValue));
+		notifyListenersOnVariableChanged(new VariableNotification<Integer>(
+				Variables.i, getVarI(), oldValue));
 	}
 	public int getVarJ() {
 		return (Integer) variableMap.get("j");
@@ -91,8 +91,8 @@ public class DefaultInterfaceImpl extends NotificationSender
 	public void setVarJ(int value) {
 		int oldValue = getVarJ();
 		variableMap.put("j", new Integer(value));
-		notifyListeners(new VariableNotification<Integer>(Variables.j,
-				getVarJ(), oldValue));
+		notifyListenersOnVariableChanged(new VariableNotification<Integer>(
+				Variables.j, getVarJ(), oldValue));
 	}
 	public int getVarC() {
 		return (Integer) variableMap.get("c");
@@ -101,8 +101,8 @@ public class DefaultInterfaceImpl extends NotificationSender
 	public void setVarC(int value) {
 		int oldValue = getVarC();
 		variableMap.put("c", new Integer(value));
-		notifyListeners(new VariableNotification<Integer>(Variables.c,
-				getVarC(), oldValue));
+		notifyListenersOnVariableChanged(new VariableNotification<Integer>(
+				Variables.c, getVarC(), oldValue));
 	}
 
 	public boolean raiseEvent(String name) {
@@ -131,7 +131,7 @@ public class DefaultInterfaceImpl extends NotificationSender
 				&& variableMap.get(name).getClass() == value.getClass()) {
 			Object oldValue = variableMap.get(name);
 			variableMap.put(name, value);
-			notifyListeners(new VariableNotification<Object>(
+			notifyListenersOnVariableChanged(new VariableNotification<Object>(
 					Variables.valueOf(name), variableMap.get(name), oldValue));
 			return true;
 		}

+ 3 - 10
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_localactions/Test_LocalActionsCycleBasedStatemachine.java

@@ -21,8 +21,6 @@ import org.yakindu.sct.runtime.java.IGenericAccessInterface;
 import org.yakindu.sct.runtime.java.TimeEvent;
 import org.yakindu.sct.runtime.java.ITimedStatemachine;
 import org.yakindu.sct.runtime.java.ITimerService;
-import org.yakindu.sct.runtime.java.EventNotification;
-import org.yakindu.sct.runtime.java.Notification;
 
 public class Test_LocalActionsCycleBasedStatemachine
 		implements
@@ -107,11 +105,8 @@ public class Test_LocalActionsCycleBasedStatemachine
 		return timerService;
 	}
 
-	public void notify(Notification notification) {
-		if (notification instanceof EventNotification) {
-			EventNotification eventNotification = (EventNotification) notification;
-			getOccuredEvents().add(eventNotification.getEvent());
-		}
+	public void onTimeEventRaised(TimeEvent<? extends Enum<?>> timeEvent) {
+		getOccuredEvents().add(timeEvent);
 	}
 
 	public IGenericAccessInterface getInterface(String name) {
@@ -178,10 +173,8 @@ public class Test_LocalActionsCycleBasedStatemachine
 			stateVector[0] = State.State2;
 
 		} else {
-			if (true) {
-				getDefaultInterfaceImpl().setVarI(2);
+			getDefaultInterfaceImpl().setVarI(2);
 
-			}
 			if (occuredEvents.contains(getDefaultInterfaceImpl()
 					.getEventEvent2())) {
 				getDefaultInterfaceImpl().setVarI(3);

+ 3 - 3
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_localactions/Test_LocalActionsEventBasedStatemachine.java

@@ -14,7 +14,7 @@ import java.util.LinkedList;
 
 import org.yakindu.sct.runtime.java.Event;
 
-import org.yakindu.sct.runtime.java.Notification;
+import org.yakindu.sct.runtime.java.TimeEvent;
 
 public class Test_LocalActionsEventBasedStatemachine
 		extends
@@ -29,8 +29,8 @@ public class Test_LocalActionsEventBasedStatemachine
 				new DefaultInterfaceEventBasedImpl(this));
 	}
 
-	public void notify(Notification notification) {
-		super.notify(notification);
+	public void onTimeEventRaised(TimeEvent<? extends Enum<?>> timeEvent) {
+		super.onTimeEventRaised(timeEvent);
 		runCycle();
 	}
 

+ 5 - 5
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_parallelregions/DefaultInterfaceImpl.java

@@ -170,8 +170,8 @@ public class DefaultInterfaceImpl extends NotificationSender
 	public void setVarReg3(int value) {
 		int oldValue = getVarReg3();
 		variableMap.put("reg3", new Integer(value));
-		notifyListeners(new VariableNotification<Integer>(Variables.reg3,
-				getVarReg3(), oldValue));
+		notifyListenersOnVariableChanged(new VariableNotification<Integer>(
+				Variables.reg3, getVarReg3(), oldValue));
 	}
 	public int getVarHierarchy() {
 		return (Integer) variableMap.get("hierarchy");
@@ -180,8 +180,8 @@ public class DefaultInterfaceImpl extends NotificationSender
 	public void setVarHierarchy(int value) {
 		int oldValue = getVarHierarchy();
 		variableMap.put("hierarchy", new Integer(value));
-		notifyListeners(new VariableNotification<Integer>(Variables.hierarchy,
-				getVarHierarchy(), oldValue));
+		notifyListenersOnVariableChanged(new VariableNotification<Integer>(
+				Variables.hierarchy, getVarHierarchy(), oldValue));
 	}
 
 	public boolean raiseEvent(String name) {
@@ -210,7 +210,7 @@ public class DefaultInterfaceImpl extends NotificationSender
 				&& variableMap.get(name).getClass() == value.getClass()) {
 			Object oldValue = variableMap.get(name);
 			variableMap.put(name, value);
-			notifyListeners(new VariableNotification<Object>(
+			notifyListenersOnVariableChanged(new VariableNotification<Object>(
 					Variables.valueOf(name), variableMap.get(name), oldValue));
 			return true;
 		}

+ 6 - 6
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_transition/DefaultInterfaceImpl.java

@@ -66,7 +66,7 @@ public class DefaultInterfaceImpl extends NotificationSender
 	public void raiseEvent7() {
 		statemachine.getOccuredEvents().add(getEventEvent7());
 		statemachine.getOutEvents().add(getEventEvent7());
-		notifyListeners(new EventNotification(getEventEvent7()));
+		notifyListenersOnEventRaised(new EventNotification(getEventEvent7()));
 	}
 
 	public Event<Events> getEventEvent7() {
@@ -84,8 +84,8 @@ public class DefaultInterfaceImpl extends NotificationSender
 	public void setVarI(int value) {
 		int oldValue = getVarI();
 		variableMap.put("i", new Integer(value));
-		notifyListeners(new VariableNotification<Integer>(Variables.i,
-				getVarI(), oldValue));
+		notifyListenersOnVariableChanged(new VariableNotification<Integer>(
+				Variables.i, getVarI(), oldValue));
 	}
 	public double getVarJ() {
 		return (Double) variableMap.get("j");
@@ -94,8 +94,8 @@ public class DefaultInterfaceImpl extends NotificationSender
 	public void setVarJ(double value) {
 		double oldValue = getVarJ();
 		variableMap.put("j", new Double(value));
-		notifyListeners(new VariableNotification<Double>(Variables.j,
-				getVarJ(), oldValue));
+		notifyListenersOnVariableChanged(new VariableNotification<Double>(
+				Variables.j, getVarJ(), oldValue));
 	}
 
 	public boolean raiseEvent(String name) {
@@ -124,7 +124,7 @@ public class DefaultInterfaceImpl extends NotificationSender
 				&& variableMap.get(name).getClass() == value.getClass()) {
 			Object oldValue = variableMap.get(name);
 			variableMap.put(name, value);
-			notifyListeners(new VariableNotification<Object>(
+			notifyListenersOnVariableChanged(new VariableNotification<Object>(
 					Variables.valueOf(name), variableMap.get(name), oldValue));
 			return true;
 		}

+ 1 - 1
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_transition/InterfaceAImpl.java

@@ -78,7 +78,7 @@ public class InterfaceAImpl extends NotificationSender
 	public void raiseEvent5() {
 		statemachine.getOccuredEvents().add(getEventEvent5());
 		statemachine.getOutEvents().add(getEventEvent5());
-		notifyListeners(new EventNotification(getEventEvent5()));
+		notifyListenersOnEventRaised(new EventNotification(getEventEvent5()));
 	}
 
 	public Event<Events> getEventEvent5() {

+ 2 - 7
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_transition/Test_TransitionCycleBasedStatemachine.java

@@ -21,8 +21,6 @@ import org.yakindu.sct.runtime.java.IGenericAccessInterface;
 import org.yakindu.sct.runtime.java.TimeEvent;
 import org.yakindu.sct.runtime.java.ITimedStatemachine;
 import org.yakindu.sct.runtime.java.ITimerService;
-import org.yakindu.sct.runtime.java.EventNotification;
-import org.yakindu.sct.runtime.java.Notification;
 
 public class Test_TransitionCycleBasedStatemachine
 		implements
@@ -108,11 +106,8 @@ public class Test_TransitionCycleBasedStatemachine
 		return timerService;
 	}
 
-	public void notify(Notification notification) {
-		if (notification instanceof EventNotification) {
-			EventNotification eventNotification = (EventNotification) notification;
-			getOccuredEvents().add(eventNotification.getEvent());
-		}
+	public void onTimeEventRaised(TimeEvent<? extends Enum<?>> timeEvent) {
+		getOccuredEvents().add(timeEvent);
 	}
 
 	public IGenericAccessInterface getInterface(String name) {

+ 3 - 3
test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_transition/Test_TransitionEventBasedStatemachine.java

@@ -14,7 +14,7 @@ import java.util.LinkedList;
 
 import org.yakindu.sct.runtime.java.Event;
 
-import org.yakindu.sct.runtime.java.Notification;
+import org.yakindu.sct.runtime.java.TimeEvent;
 
 public class Test_TransitionEventBasedStatemachine
 		extends
@@ -30,8 +30,8 @@ public class Test_TransitionEventBasedStatemachine
 				new DefaultInterfaceEventBasedImpl(this));
 	}
 
-	public void notify(Notification notification) {
-		super.notify(notification);
+	public void onTimeEventRaised(TimeEvent<? extends Enum<?>> timeEvent) {
+		super.onTimeEventRaised(timeEvent);
 		runCycle();
 	}
 

+ 28 - 21
test-plugins/org.yakindu.sct.generator.java.runtime.test/src/org/yakindu/sct/generator/java/runtime/test/TestInterfaceTestEventBasedStatemachine.java

@@ -19,8 +19,7 @@ import org.junit.Before;
 import org.junit.Test;
 import org.yakindu.sct.runtime.java.EventNotification;
 import org.yakindu.sct.runtime.java.INotificationListener;
-import org.yakindu.sct.runtime.java.Notification;
-import org.yakindu.sct.runtime.java.NotificationType;
+import org.yakindu.sct.runtime.java.VariableNotification;
 import org.yakindu.sct.runtime.java.interfacetest.InterfaceTestCycleBasedStatemachine.State;
 import org.yakindu.sct.runtime.java.interfacetest.InterfaceTestEventBasedStatemachine;
 
@@ -45,37 +44,45 @@ public class TestInterfaceTestEventBasedStatemachine {
 		statemachine.getDefaultInterface().addNotificationListener(
 				new INotificationListener() {
 
-					public void notify(Notification notification) {
-						if (notification.getNotificationType() == NotificationType.EventNotification) {
-							EventNotification ev = (EventNotification) notification;
-							if (ev.getEvent() == statemachine.getDefaultInterface().getEventEvent2()) {
-								events[0] = true;
-							}
+					public void onEventRaised(EventNotification notification) {
+						if (notification.getEvent() == statemachine.getDefaultInterface().getEventEvent2()) {
+							events[0] = true;
 						}
+						
+					}
+
+					public void onVariableChanged(
+							VariableNotification<?> notification) {
 					}
 				});
+		
 		statemachine.getInterfaceOther().addNotificationListener(
 				new INotificationListener() {
-
-					public void notify(Notification notification) {
-						if (notification.getNotificationType() == NotificationType.EventNotification) {
-							EventNotification ev = (EventNotification) notification;
-							if (ev.getEvent() == statemachine.getInterfaceOther().getEventEvent4()) {
-								events[1] = true;
-							}
+					
+					public void onEventRaised(EventNotification notification) {
+						if (notification.getEvent() == statemachine.getInterfaceOther().getEventEvent4()) {
+							events[1] = true;
 						}
 					}
+
+					public void onVariableChanged(
+							VariableNotification<?> notification) {
+						
+					}
 				});
+		
 		statemachine.getInterfaceThird().addNotificationListener(
 				new INotificationListener() {
-					public void notify(Notification notification) {
-						if (notification.getNotificationType() == NotificationType.EventNotification) {
-							EventNotification ev = (EventNotification) notification;
-							if (ev.getEvent() == statemachine.getInterfaceThird().getEventEvent6()) {
-								events[2] = true;
-							}
+
+					public void onEventRaised(EventNotification notification) {
+						if (notification.getEvent() == statemachine.getInterfaceThird().getEventEvent6()) {
+							events[2] = true;
 						}
 					}
+
+					public void onVariableChanged(
+							VariableNotification<?> notification) {
+					}
 				});
 		statemachine.init();
 		statemachine.enter();