Browse Source

Refactored Simulation core

Andreas Mülder 12 years ago
parent
commit
e8f04dd8ab
24 changed files with 31 additions and 1473 deletions
  1. 2 1
      plugins/org.yakindu.sct.simulation.core/build.properties
  2. 7 29
      plugins/org.yakindu.sct.simulation.core/plugin.xml
  3. 0 68
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/extensions/ExecutionFactoryExtensions.java
  4. 22 24
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/IExecutionTraceListener.java
  5. 0 74
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/AbstractExecutionFacade.java
  6. 0 25
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/ExecutionException.java
  7. 0 33
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/IEventSlot.java
  8. 0 177
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/IExecutionContext.java
  9. 0 30
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/IExecutionContextListener.java
  10. 0 70
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/IExecutionFacade.java
  11. 0 35
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/IExecutionFacadeController.java
  12. 0 26
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/IExecutionFacadeFactory.java
  13. 0 44
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/ISlot.java
  14. 0 5
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/ISlotChangedEvent.java
  15. 0 6
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/ISlotContext.java
  16. 0 70
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/impl/AbstractExecutionContext.java
  17. 0 86
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/impl/AbstractExecutionFacadeController.java
  18. 0 129
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/impl/AbstractSlot.java
  19. 0 70
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/impl/CycleBasedExecutionFacadeController.java
  20. 0 64
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/impl/EventDrivenExecutionFacadeController.java
  21. 0 279
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/impl/ExecutionContextImpl.java
  22. 0 81
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/impl/ExecutionEvent.java
  23. 0 15
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/impl/ExecutionOperation.java
  24. 0 32
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/impl/ExecutionVariable.java

+ 2 - 1
plugins/org.yakindu.sct.simulation.core/build.properties

@@ -2,4 +2,5 @@ source.. = src/
 output.. = bin/
 bin.includes = META-INF/,\
                .,\
-               plugin.xml
+               plugin.xml,\
+               plugin.properties

+ 7 - 29
plugins/org.yakindu.sct.simulation.core/plugin.xml

@@ -1,33 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?eclipse version="3.4"?>
 <plugin>
-   <extension-point id="org.yakindu.sct.simulation.core.executionfactory" name="ExecutionFactory" schema="schema/executionfactory.exsd"/>
-
-	<!-- Launch configuration -->
-	<extension point="org.eclipse.debug.core.launchConfigurationTypes">
-    	<launchConfigurationType
-          delegate="org.yakindu.sct.simulation.core.launch.StatechartLaunchConfigurationDelegate"
-          id="org.yakindu.sct.simulation.core.launch.statechart"
-          modes="run, debug"
-          name="YAKINDU Statechart">
-    	</launchConfigurationType>
-	</extension>
-	<!-- Breakpoints -->
-	<extension point="org.eclipse.debug.core.breakpoints">
-   		<breakpoint 
-      		markerType="org.yakindu.sct.simulation.core.breakpoints"
-      		class="org.yakindu.sct.simulation.core.breakpoints.SCTBreakpoint"
-      		id="org.yakindu.sct.simulation.core.sct.breakpoints">
-   		</breakpoint>
-	</extension>
- <extension
-       id="breakpoints"
-       point="org.eclipse.core.resources.markers">
-    <super type="org.eclipse.debug.core.breakpointMarker"/>
-    <persistent value="true"/>
-      <attribute name="message"/>
-      <attribute name="elementId"/>
-      <attribute name="conditional"/>
-      <attribute name="expression"/>
- </extension>
+   <extension point="org.eclipse.emf.ecore.generated_package">
+      <!-- @generated sruntime -->
+      <package
+            uri="http://www.yakindu.org/sct/sruntime/2.0.0"
+            class="org.yakindu.sct.simulation.core.sruntime.SRuntimePackage"
+            genModel="model/sruntime.genmodel"/>
+   </extension>
 </plugin>

+ 0 - 68
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/extensions/ExecutionFactoryExtensions.java

@@ -1,68 +0,0 @@
-/**
- * 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.simulation.core.extensions;
-
-import static com.google.common.collect.Iterables.transform;
-import static com.google.common.collect.Lists.newArrayList;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.yakindu.sct.simulation.core.runtime.IExecutionFacadeFactory;
-
-import com.google.common.base.Function;
-
-/**
- * 
- * @author andreas muelder - Initial contribution and API
- * 
- */
-public class ExecutionFactoryExtensions {
-
-	private static final String EXTENSION_POINT_ID = "org.yakindu.sct.simulation.core.executionfactory";
-	private static final String ATTRIBUTE_CLASS = "class";
-
-	public static class ExecutionFactoryDescriptor {
-
-		private final IConfigurationElement configElement;
-
-		ExecutionFactoryDescriptor(IConfigurationElement configElement) {
-			this.configElement = configElement;
-		}
-
-		public IExecutionFacadeFactory createExecutableExtensionFactory() {
-			try {
-				return (IExecutionFacadeFactory) configElement
-						.createExecutableExtension(ATTRIBUTE_CLASS);
-			} catch (CoreException e) {
-				e.printStackTrace();
-			}
-			return null;
-		}
-	}
-
-	public static Iterable<ExecutionFactoryDescriptor> getExecutionFactoryDescriptor() {
-		IConfigurationElement[] configurationElements = Platform
-				.getExtensionRegistry().getConfigurationElementsFor(
-						EXTENSION_POINT_ID);
-		return transform(newArrayList(configurationElements),
-				new CreateLibraryDescriptor());
-	}
-
-	private static final class CreateLibraryDescriptor implements
-			Function<IConfigurationElement, ExecutionFactoryDescriptor> {
-
-		public ExecutionFactoryDescriptor apply(IConfigurationElement from) {
-			return new ExecutionFactoryDescriptor(from);
-		}
-	}
-
-}

+ 22 - 24
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/IExecutionTraceListener.java

@@ -1,24 +1,22 @@
-/**
- * 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.simulation.core.runtime;
-
-import org.yakindu.sct.model.sexec.Trace;
-
-/**
- * 
- * @author andreas muelder - Initial contribution and API
- * 
- */
-public interface IExecutionTraceListener {
-
-	public void traceStepExecuted(Trace trace);
-
-}
+/**
+ * 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.simulation.core.launch;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public interface ISCTLaunchConfigurationType {
+
+	String CONFIG_TYPE = "org.yakindu.sct.simulation.core.launch.statechart";
+
+}

+ 0 - 74
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/AbstractExecutionFacade.java

@@ -1,74 +0,0 @@
-/**
- * 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.simulation.core.runtime;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.yakindu.sct.model.sexec.Trace;
-
-/**
- * Adds convenience for {@link IExecutionTraceListener} handling.
- * 
- * @author andreas muelder - Initial contribution and API
- * 
- */
-public abstract class AbstractExecutionFacade implements IExecutionFacade {
-
-	private List<IExecutionTraceListener> _listeners;
-
-	private List<Object> _callbacks;
-
-	public AbstractExecutionFacade() {
-		_listeners = new ArrayList<IExecutionTraceListener>();
-		_callbacks = new ArrayList<Object>();
-	}
-
-	public void addTraceListener(IExecutionTraceListener listener) {
-		synchronized (_listeners) {
-			if (!_listeners.contains(listener)) {
-				_listeners.add(listener);
-			}
-		}
-	}
-
-	public void removeTraceListener(IExecutionTraceListener listener) {
-		synchronized (_listeners) {
-			_listeners.remove(listener);
-		}
-	}
-
-	protected void notifyTraceStepEntered(Trace trace) {
-		synchronized (_listeners) {
-			for (IExecutionTraceListener listener : _listeners) {
-				listener.traceStepExecuted(trace);
-			}
-		}
-	}
-
-	public void addCallbackObject(Object object) {
-		synchronized (_callbacks) {
-			_callbacks.add(object);
-		}
-	}
-
-	public void removeCallbackObject(Object object) {
-		synchronized (_callbacks) {
-			_callbacks.remove(object);
-		}
-	}
-
-	public List<Object> getCallbacks() {
-		return _callbacks;
-	}
-	
-	
-}

+ 0 - 25
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/ExecutionException.java

@@ -1,25 +0,0 @@
-/**
- * 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.simulation.core.runtime;
-
-/**
- * 
- * @author andreas muelder - Initial contribution and API
- * 
- */
-public class ExecutionException extends RuntimeException {
-
-	private static final long serialVersionUID = 1L;
-
-	public ExecutionException(String cause) {
-		super(cause);
-	}
-}

+ 0 - 33
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/IEventSlot.java

@@ -1,33 +0,0 @@
-/**
- * Copyright (c) 2012 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.simulation.core.runtime;
-
-/**
- * Defines the interface of an event slot.
- * EventSlot are extensions of Slot that adds notion of raising and unraising (resetting) events.
- *  
- * @author axel terfloth
- */
-public interface IEventSlot extends ISlot {
-	
-	
-	public static class SlotEventRaised implements ISlotChangedEvent {}
-	public static class SlotEventUnraised implements ISlotChangedEvent {}
-
-	public static final SlotEventRaised SLOT_EVENT_RAISED = new SlotEventRaised();
-	public static final SlotEventUnraised SLOT_EVENT_UNRAISED = new SlotEventUnraised();
-
-	
-	void raise(Object value);
-	void unraise();
-	boolean isRaised();
-
-}

+ 0 - 177
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/IExecutionContext.java

@@ -1,177 +0,0 @@
-/**
- * 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.simulation.core.runtime;
-
-import java.util.List;
-import java.util.Set;
-
-import org.yakindu.sct.model.sexec.ExecutionRegion;
-import org.yakindu.sct.model.sexec.ExecutionState;
-import org.yakindu.sct.model.sgraph.RegularState;
-import org.yakindu.sct.simulation.core.runtime.impl.ExecutionEvent;
-import org.yakindu.sct.simulation.core.runtime.impl.ExecutionVariable;
-
-/**
- * 
- * @author andreas muelder - Initial contribution and API
- * @author axel terfloth - extensions and refactorings
- * 
- */
-public interface IExecutionContext {
-
-	/**
-	 * returns a readonly (!) List with all declared events
-	 */
-	public List<ExecutionEvent> getDeclaredEvents();
-
-	/**
-	 * Declares a new Event that can be raised
-	 */
-	public void declareEvent(ExecutionEvent event);
-
-	/**
-	 * Returns a readonly (!) List with all currently raised events
-	 */
-	public List<ExecutionEvent> getRaisedEvents();
-
-	/**
-	 * @deprecated Event scheduling is not responsibility of the execution context. It should be done by the execution container.
-	 * @return
-	 */
-	public List<ExecutionEvent> getScheduledEvents();
-
-	/**
-	 * Clears the collection of raised events
-	 * 
-	 * @deprecated this method is not appropriate for event life cycle handling. 
-	 */
-	public void resetRaisedEvents();
-
-
-	/** 
-	 * @deprecated Unsetting events should be performed on the ExectionEvent instances.
-	 * @param eventName
-	 */
-	public void unraiseEvent(String eventName);
-
-
-	/**
-	 * @deprecated Event scheduling is not responsibility of the execution context. It should be done by the execution container.
-	 */
-	public void flush();
-
-	/**
-	 * Schedules an event with an value that can be null
-	 * 
-	 * @deprecated Event scheduling is not responsibility of the execution context. It should be done by the execution container.
-	 * @throws ExecutionException
-	 *             if the value is incompatible with the declared event type or
-	 *             the Event can not be found
-	 */
-	public void scheduleEvent(String name, Object value) throws ExecutionException;
-
-	
-	/**
-	 * Immediately raises an event with an optional value.
-	 * 
-	 * @deprecated Should be done on the ExecutionEvent instances
-	 * 
-	 * @param name
-	 * @param value
-	 * @throws ExecutionException
-	 */
-	public void raiseEvent(String name, Object value) throws ExecutionException;
-
-	/**
-	 * Returns true if the given event is currently raised, false otherwise
-	 * 
-	 *  @deprecated Should be done on the ExecutionEvent instances
-	 */
-	public boolean isEventRaised(String eventName);
-
-	/**
-	 * @deprecated Event scheduling is not responsibility of the execution context. It should be done by the execution container.
-	 * @param name
-	 * @return
-	 */
-	public boolean isEventScheduled(String name);
-
-	
-	/**
-	 * Returns a readonly (!) List of all variables
-	 */
-	public List<ExecutionVariable> getVariables();
-
-	/**
-	 * Declares a new Variable
-	 */
-	public void declareVariable(ExecutionVariable variable);
-
-	/**
-	 * Returns a {@link ExecutionVariable} by name, might be null
-	 */
-	public ExecutionVariable getVariable(String varName);
-
-	/**
-	 * Changes the value of a variable / event
-	 * 
-	 * @deprecated will be removed ...
-	 */
-	public void setSlotValue(String name, Object value)
-			throws ExecutionException;
-
-	/**
-	 * Returns a Set with all currently active states
-	 */
-	public Set<RegularState> getActiveLeafStates();
-
-	/**
-	 * Returns a set with all active leaf states including parents
-	 */
-	public Set<RegularState> getAllActiveStates();
-
-	/**
-	 * Returns the active state configuration
-	 */
-	public ExecutionState[] getStateConfiguration();
-
-	public void initStateConfigurationVector(int size);
-
-	/**
-	 * Registeres a new {@link IExecutionContextListener}
-	 */
-	public void addExecutionContextListener(IExecutionContextListener listener);
-
-	/**
-	 * removes a given {@link IExecutionContextListener}
-	 */
-	public void removeExecutionContextListener(
-			IExecutionContextListener listener);
-
-	/**
-	 * 
-	 * @param region
-	 * @return
-	 */
-	public ExecutionState getHistoryStateConfiguration(ExecutionRegion region);
-
-	public void saveHistoryStateConfiguration(ExecutionRegion region);
-
-	public abstract IEventSlot getDeclaredEvent(String eventName);
-
-	/**
-	 * @deprecated
-	 * 
-	 * @param eventName
-	 */
-	public void unscheduleEvent(String eventName);
-
-}

+ 0 - 30
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/IExecutionContextListener.java

@@ -1,30 +0,0 @@
-/**
- * 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.simulation.core.runtime;
-
-
-/**
- * 
- * @author andreas muelder - Initial contribution and API
- * 
- */
-public interface IExecutionContextListener {
-
-	/**
-	 * called when an event is raised
-	 */
-	public void eventRaised(IEventSlot event);
-
-	/**
-	 * called when a variable value changed
-	 */
-	public void slotValueChanged(ISlot variable);
-}

+ 0 - 70
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/IExecutionFacade.java

@@ -1,70 +0,0 @@
-/**
- * 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.simulation.core.runtime;
-
-/**
- * Facade for executable statechart implementation.
- * 
- * @author andreas muelder - Initial contribution and API
- * 
- */
-public interface IExecutionFacade {
-
-	/**
-	 * Unique name
-	 */
-	public String getName();
-
-	/**
-	 * Called before execution, used for initialization
-	 */
-	public void enter();
-
-	/**
-	 * Called after execution, used for clean up
-	 */
-	public void exit();
-	/**
-	 * Called after execution, used for clean up
-	 */
-	public void tearDown();
-
-	/**
-	 * Call on every cycle
-	 */
-	public void runCycle();
-
-	/**
-	 * Adds an implementation of {@link IExecutionTraceListener}
-	 */
-	public void addTraceListener(IExecutionTraceListener listener);
-
-	/**
-	 * Removes an implementation of {@link IExecutionTraceListener}
-	 */
-	public void removeTraceListener(IExecutionTraceListener listener);
-
-	/**
-	 * Returns the {@link IExecutionContext}
-	 */
-	public IExecutionContext getExecutionContext();
-
-	/**
-	 * Adds a callback object that is used for the simulation of operations
-	 */
-	public void addCallbackObject(Object object);
-
-	/**
-	 * Removes a callback object that is used for the simulation of operations
-	 */
-	public void removeCallbackObject(Object object);
-
-}

+ 0 - 35
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/IExecutionFacadeController.java

@@ -1,35 +0,0 @@
-/**
- * Copyright (c) 2012 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.simulation.core.runtime;
-
-/**
- * An {@link IExecutionFacadeController} controls the {@link IExecutionFacade}
- * runCycle method invocation.
- * 
- * Possible implementations can be cycle based or event driven controllers.
- * 
- * @author andreas muelder - Initial contribution and API
- * 
- */
-public interface IExecutionFacadeController {
-
-	public void start();
-
-	public void suspend();
-	
-	public void step();
-
-	public void resume();
-
-	public void terminate();
-
-}

+ 0 - 26
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/IExecutionFacadeFactory.java

@@ -1,26 +0,0 @@
-/**
- * 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.simulation.core.runtime;
-
-import org.yakindu.sct.model.sgraph.Statechart;
-
-/**
- * 
- * @author andreas muelder - Initial contribution and API
- * 
- */
-public interface IExecutionFacadeFactory {
-
-	public IExecutionFacade createExecutionFacade(Statechart statechart);
-	
-	public boolean isApplicable(Statechart statechart);
-	
-}

+ 0 - 44
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/ISlot.java

@@ -1,44 +0,0 @@
-/**
- * Copyright (c) 2012 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.simulation.core.runtime;
-
-import org.yakindu.base.types.ITypeSystem.InferredType;
-
-/**
- * Defines the interface of a slot that holds a value within an execution
- * context.
- * 
- * The name and type of a slot can be accessed read only. The value can be read
- * and set.
- * 
- * @author axel terfloth
- * 
- */
-public interface ISlot {
-
-	public static class SlotValueChanged implements ISlotChangedEvent {
-	}
-
-	public static final SlotValueChanged SLOT_VALUE_CHANGED = new SlotValueChanged();
-
-	void setContext(ISlotContext ctx);
-
-	ISlotContext getContext();
-
-	public String getName();
-
-	public InferredType getType();
-
-	public void setValue(Object value);
-
-	public Object getValue();
-
-}

+ 0 - 5
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/ISlotChangedEvent.java

@@ -1,5 +0,0 @@
-package org.yakindu.sct.simulation.core.runtime;
-
-public interface ISlotChangedEvent {
-
-}

+ 0 - 6
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/ISlotContext.java

@@ -1,6 +0,0 @@
-package org.yakindu.sct.simulation.core.runtime;
-
-public interface ISlotContext {
-
-	void slotChanged(ISlot slot, ISlotChangedEvent changeEvent);
-}

+ 0 - 70
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/impl/AbstractExecutionContext.java

@@ -1,70 +0,0 @@
-/**
- * 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.simulation.core.runtime.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.yakindu.sct.simulation.core.runtime.IEventSlot;
-import org.yakindu.sct.simulation.core.runtime.IExecutionContext;
-import org.yakindu.sct.simulation.core.runtime.IExecutionContextListener;
-import org.yakindu.sct.simulation.core.runtime.ISlot;
-
-/**
- * Abstract implementation of {@link IExecutionContext}. Adds some convenience
- * for handling the {@link IExecutionContextListener}s
- * 
- * @author andreas muelder - Initial contribution and API
- * 
- */
-public abstract class AbstractExecutionContext implements IExecutionContext {
-
-	private List<IExecutionContextListener> _listeners;
-
-	public AbstractExecutionContext() {
-		_listeners = new ArrayList<IExecutionContextListener>();
-	}
-	
-	public void addExecutionContextListener(IExecutionContextListener listener) {
-		synchronized (_listeners) {
-			_listeners.add(listener);
-		}
-	}
-
-	public void removeExecutionContextListener(
-			IExecutionContextListener listener) {
-		synchronized (_listeners) {
-			_listeners.remove(listener);
-		}
-	}
-
-	public void notifyEventRaised(IEventSlot event) {
-		synchronized (_listeners) {
-			for (IExecutionContextListener listener : _listeners) {
-				listener.eventRaised(event);
-			}
-		}
-	}
-
-	public void notifyValueChanged(ISlot slot) {
-		synchronized (_listeners) {
-			for (IExecutionContextListener listener : _listeners) {
-				listener.slotValueChanged(slot);
-			}
-		}
-	}
-	
-
-	public IEventSlot getDeclaredEvent(String eventName) {
-		return null;
-	}
-
-}

+ 0 - 86
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/impl/AbstractExecutionFacadeController.java

@@ -1,86 +0,0 @@
-/**
- * Copyright (c) 2012 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.simulation.core.runtime.impl;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IStatusHandler;
-import org.eclipse.emf.common.util.WrappedException;
-import org.yakindu.sct.simulation.core.Activator;
-import org.yakindu.sct.simulation.core.debugmodel.SCTDebugTarget;
-import org.yakindu.sct.simulation.core.runtime.IExecutionFacade;
-import org.yakindu.sct.simulation.core.runtime.IExecutionFacadeController;
-
-/**
- * Abstract base implementation for {@link IExecutionFacadeController}s
- * 
- * @author andreas muelder - Initial contribution and API
- * 
- */
-public abstract class AbstractExecutionFacadeController implements
-		IExecutionFacadeController {
-
-	public static final int ERROR_DURING_SIMULATION = 765;
-
-	protected final IExecutionFacade facade;
-
-	protected boolean terminated = false;
-	protected boolean suspended = false;
-
-	private SCTDebugTarget target;
-
-	public AbstractExecutionFacadeController(SCTDebugTarget target) {
-		this.target = target;
-		this.facade = (IExecutionFacade) target
-				.getAdapter(IExecutionFacade.class);
-	}
-
-	protected void runCycle() {
-		try {
-			facade.runCycle();
-		} catch (WrappedException ex) {
-			Status errorStatus = new Status(Status.ERROR, Activator.PLUGIN_ID,
-					ERROR_DURING_SIMULATION, ex.getCause().getMessage(),
-					ex.getCause());
-			IStatusHandler statusHandler = DebugPlugin.getDefault()
-					.getStatusHandler(errorStatus);
-			try {
-				statusHandler.handleStatus(errorStatus, target);
-			} catch (CoreException e) {
-				e.printStackTrace();
-			}
-		}
-	}
-
-	public void start() {
-		facade.enter();
-	}
-
-	public void suspend() {
-		suspended = true;
-	}
-
-	public void resume() {
-		suspended = false;
-	}
-
-	public void terminate() {
-		terminated = true;
-		facade.tearDown();
-	}
-
-	public void step() {
-		facade.runCycle();
-	}
-
-}

+ 0 - 129
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/impl/AbstractSlot.java

@@ -1,129 +0,0 @@
-/**
- * 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.simulation.core.runtime.impl;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.yakindu.base.types.EnumerationType;
-import org.yakindu.base.types.Enumerator;
-import org.yakindu.base.types.ITypeSystem.InferredType;
-import org.yakindu.sct.simulation.core.runtime.ExecutionException;
-import org.yakindu.sct.simulation.core.runtime.ISlot;
-import org.yakindu.sct.simulation.core.runtime.ISlotContext;
-
-/**
- * @author andreas muelder - Initial contribution and API
- * @author axel terfloth - refactoring
- * 
- */
-public abstract class AbstractSlot implements ISlot {
-
-	protected ISlotContext context;
-	protected String name;
-	protected String scopeSegment;
-	protected String simpleName;
-	protected InferredType type;
-	protected Object value;
-
-	public AbstractSlot(String name, InferredType type, Object value) {
-		super();
-		Assert.isNotNull(name);
-		this.name = name;
-		String[] split = name.split("\\.");
-		if (split.length == 2) {
-			scopeSegment = split[0];
-			simpleName = split[1];
-		} else {
-			simpleName = name;
-		}
-		this.type = type;
-		if (value != null)
-			setValue(value);
-	}
-
-	public String getScopeSegment() {
-		return scopeSegment;
-	}
-
-	public String getSimpleName() {
-		return simpleName;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	public InferredType getType() {
-		return type;
-	}
-
-	public Object getValue() {
-		return value;
-	}
-
-	public void setValue(Object value) {
-		assertValue(value);
-		this.value = value;
-
-		notifyValueChanged();
-	}
-
-	protected void assertValue(Object value) {
-		Assert.isNotNull(value, "Value must not be null ");
-		if(getType().getType() instanceof EnumerationType){
-			Assert.isTrue(value instanceof Enumerator);
-			boolean validLiteral = false;
-			for(Enumerator e : ((EnumerationType)getType().getType()).getEnumerator()){
-				if(EcoreUtil.equals(e, (Enumerator)value)){
-					validLiteral = true;
-					break;
-				}
-			}
-			if(!validLiteral){
-				throw new ExecutionException("Enumerator " + ((Enumerator)value).getName() + " is not assignable to enumeration type "+  getType().getType().getName());
-			}
-		}
-		// TODO check primitive value types -> need type system to decide
-		
-		// TODO refactor (use type system)
-		// Class<? extends Object> clazz = value instanceof EObject ?
-		// ((EObject)value).eClass().getInstanceClass() : value.getClass();
-		// if (type == Float.class && value != null &&
-		// !clazz.isAssignableFrom(type)) {
-		// try {
-		// value = Float.parseFloat(value.toString());
-		// } catch (NumberFormatException e) {
-		// e.printStackTrace();
-		// }
-		// }
-		//
-		// if (!clazz.isAssignableFrom(type)) {
-		// throw new ExecutionException("Error assigning value to \' " + name
-		// + "\' Can not assign value " + value + " of type"
-		// + clazz + " to type " + type);
-		// }
-	}
-
-	public void setContext(ISlotContext ctx) {
-		context = ctx;
-	}
-
-	public ISlotContext getContext() {
-		return context;
-	}
-
-	protected void notifyValueChanged() {
-		if (context != null) {
-			context.slotChanged(this, SLOT_VALUE_CHANGED);
-		}
-	}
-
-}

+ 0 - 70
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/impl/CycleBasedExecutionFacadeController.java

@@ -1,70 +0,0 @@
-/**
- * Copyright (c) 2012 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.simulation.core.runtime.impl;
-
-import java.util.Timer;
-import java.util.TimerTask;
-
-import org.yakindu.sct.simulation.core.debugmodel.SCTDebugTarget;
-import org.yakindu.sct.simulation.core.runtime.IExecutionFacade;
-import org.yakindu.sct.simulation.core.runtime.IExecutionFacadeController;
-
-/**
- * Cycle based implementation of {@link IExecutionFacadeController}.
- * 
- * runCycle is called on {@link IExecutionFacade} periodically, depending on the
- * cyclePeriod value.
- * 
- * @author andreas muelder - Initial contribution and API
- * 
- */
-public class CycleBasedExecutionFacadeController extends
-		AbstractExecutionFacadeController {
-
-	private Timer timer;
-
-	private long cyclePeriod;
-
-	public CycleBasedExecutionFacadeController(SCTDebugTarget target,
-			long cyclePeriod) {
-		super(target);
-		this.cyclePeriod = cyclePeriod;
-		timer = new Timer();
-	}
-
-	protected void scheduleCycle() {
-		if (!terminated && !suspended) {
-			TimerTask virtualTimerTask = new TimerTask() {
-				public void run() {
-						runCycle();
-						scheduleCycle();
-				}
-			};
-			timer.schedule(virtualTimerTask, cyclePeriod);
-		}
-	}
-
-	public void start() {
-		super.start();
-		scheduleCycle();
-	}
-
-	public void resume() {
-		super.resume();
-		scheduleCycle();
-	}
-
-	public void terminate() {
-		super.terminate();
-		timer.cancel();
-	}
-
-}

+ 0 - 64
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/impl/EventDrivenExecutionFacadeController.java

@@ -1,64 +0,0 @@
-/**
- * Copyright (c) 2012 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.simulation.core.runtime.impl;
-
-import org.yakindu.sct.simulation.core.debugmodel.SCTDebugTarget;
-import org.yakindu.sct.simulation.core.runtime.IExecutionContext;
-import org.yakindu.sct.simulation.core.runtime.IExecutionFacadeController;
-
-/**
- * Event Driven implementation of the {@link IExecutionFacadeController}.
- * 
- * @author andreas muelder - Initial contribution and API
- * 
- */
-public class EventDrivenExecutionFacadeController extends
-		AbstractExecutionFacadeController {
-
-	private Thread cycleRunner;
-
-	public EventDrivenExecutionFacadeController(SCTDebugTarget target) {
-		super(target);
-	}
-
-	public void start() {
-		super.start();
-		cycleRunner = new Thread(new CycleRunner());
-		cycleRunner.start();
-	}
-
-	public void suspend() {
-		super.suspend();
-	}
-
-	public void resume() {
-		super.resume();
-		cycleRunner = new Thread(new CycleRunner());
-		cycleRunner.start();
-	}
-
-	public void terminate() {
-		super.terminate();
-	}
-
-	private final class CycleRunner implements Runnable {
-		public void run() {
-			while (!terminated && !suspended) {
-				IExecutionContext context = facade.getExecutionContext();
-				if (context.getRaisedEvents().size() > 0
-						|| context.getScheduledEvents().size() > 0) {
-					runCycle();
-				}
-			}
-		}
-	}
-}

+ 0 - 279
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/impl/ExecutionContextImpl.java

@@ -1,279 +0,0 @@
-/**
- * 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.simulation.core.runtime.impl;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.emf.ecore.EObject;
-import org.yakindu.sct.model.sexec.ExecutionRegion;
-import org.yakindu.sct.model.sexec.ExecutionState;
-import org.yakindu.sct.model.sgraph.RegularState;
-import org.yakindu.sct.model.sgraph.State;
-import org.yakindu.sct.simulation.core.runtime.ExecutionException;
-import org.yakindu.sct.simulation.core.runtime.IEventSlot;
-import org.yakindu.sct.simulation.core.runtime.IExecutionContext;
-import org.yakindu.sct.simulation.core.runtime.ISlot;
-import org.yakindu.sct.simulation.core.runtime.ISlotChangedEvent;
-import org.yakindu.sct.simulation.core.runtime.ISlotContext;
-
-import com.google.common.collect.Maps;
-
-/**
- * 
- * @author andreas muelder - Initial contribution and API
- * @author axel terfloth - extensions and refactorings
- * 
- */
-public class ExecutionContextImpl extends AbstractExecutionContext implements
-		IExecutionContext, ISlotContext {
-
-	private List<ExecutionVariable> variables;
-	private List<ExecutionEvent> declaredEvents;
-	protected List<ExecutionEvent> scheduledToRaiseEvents;
-	protected List<ExecutionEvent> raisedEvents;
-	private ExecutionState[] activeStateConfig;
-	private Map<Integer, ExecutionState> historyStateConfig;
-
-	public ExecutionContextImpl() {
-		variables = new ArrayList<ExecutionVariable>();
-		declaredEvents = new ArrayList<ExecutionEvent>();
-		raisedEvents = new ArrayList<ExecutionEvent>();
-		scheduledToRaiseEvents = new ArrayList<ExecutionEvent>();
-		activeStateConfig = null;
-		historyStateConfig = null;
-	}
-
-	public List<ExecutionEvent> getDeclaredEvents() {
-		synchronized (declaredEvents) {
-			return Collections.unmodifiableList(declaredEvents);
-		}
-	}
-
-	public List<ExecutionEvent> getScheduledToRaiseEvents() {
-		synchronized (scheduledToRaiseEvents) {
-			return Collections.unmodifiableList(scheduledToRaiseEvents);
-		}
-	}
-
-	public void declareEvent(ExecutionEvent event) {
-		synchronized (declaredEvents) {
-			event.setContext(this);
-			declaredEvents.add(event);
-		}
-	}
-
-	public List<ExecutionEvent> getRaisedEvents() {
-		return Collections.unmodifiableList(raisedEvents);
-	}
-
-	public List<ExecutionEvent> getScheduledEvents() {
-		return Collections.unmodifiableList(scheduledToRaiseEvents);
-	}
-
-	public void resetRaisedEvents() {
-		synchronized (raisedEvents) {
-			raisedEvents.clear();
-		}
-	}
-	
-	public void scheduleEvent(String eventName, Object value) {
-		ExecutionEvent event = getDeclaredEvent(eventName);
-		if (event == null)
-			throw new ExecutionException("Event with name " + eventName
-					+ " is undefined!");
-		ExecutionEvent eventCopy = event.getCopy();
-		if (value != null) {
-			eventCopy.setValue(value);
-		}
-		synchronized (scheduledToRaiseEvents) {
-			scheduledToRaiseEvents.add(eventCopy);
-		}
-	}
-
-	public  void raiseEvent(String eventName, Object value) {
-		synchronized (raisedEvents) {
-			ExecutionEvent event = getDeclaredEvent(eventName);
-			if (event == null)
-				throw new ExecutionException("Event with name " + eventName
-						+ " is undefined!");
-			event.raise(value);
-		}
-	}
-
-	public void flush() {
-		synchronized (scheduledToRaiseEvents) {
-			for (IEventSlot event : scheduledToRaiseEvents) {
-				raiseEvent(event.getName(), event.getValue());
-			}
-			scheduledToRaiseEvents.clear();
-		}
-	}
-
-	@Override
-	public ExecutionEvent getDeclaredEvent(String eventName) {
-		synchronized (declaredEvents) {
-			for (ExecutionEvent event : declaredEvents) {
-				if (event.getName().equals(eventName))
-					return event;
-			}
-		}
-		return null;
-	}
-
-	public boolean isEventRaised(String eventName) {
-		synchronized (raisedEvents) {
-			return getDeclaredEvent(eventName).isRaised();
-		}
-	}
-
-	public List<ExecutionVariable> getVariables() {
-		return Collections.unmodifiableList(variables);
-	}
-
-	public ExecutionVariable getVariable(String varName) {
-		synchronized (variables) {
-			for (ExecutionVariable variable : variables) {
-				if (varName.equals(variable.getName())) {
-					return variable;
-				}
-			}
-		}
-		return null;
-	}
-
-	public void declareVariable(ExecutionVariable variable) {
-		synchronized (variables) {
-			variable.setContext(this);
-			variables.add(variable);
-		}
-	}
-
-	public void setSlotValue(String name, Object value)
-			throws ExecutionException {
-		ISlot slot = getVariable(name);
-		if(slot == null)
-			slot = getDeclaredEvent(name);
-		if (slot == null)
-			throw new ExecutionException("Unknown slot " + name);
-		slot.setValue(value);
-	}
-
-	public ExecutionState[] getStateConfiguration() {
-		return activeStateConfig;
-	}
-
-	public ExecutionState getHistoryStateConfiguration(ExecutionRegion region) {
-		return historyStateConfig.get(region.getHistoryVector().getOffset());
-	}
-
-	public void saveHistoryStateConfiguration(ExecutionRegion region) {
-		historyStateConfig.put(region.getHistoryVector().getOffset(),
-				getStateConfiguration()[region.getStateVector().getOffset()]);
-	}
-
-	public void initStateConfigurationVector(int size) {
-		activeStateConfig = new ExecutionState[size];
-		for (int i = 0; i < size; i++) {
-			activeStateConfig[i] = null;
-		}
-		historyStateConfig = Maps.newHashMap();
-	}
-
-	public Set<RegularState> getActiveLeafStates() {
-		Set<RegularState> vertices = new HashSet<RegularState>();
-		for (ExecutionState state : activeStateConfig) {
-			if (state != null)
-				vertices.add((RegularState) state.getSourceElement());
-		}
-		return vertices;
-	}
-
-	public Set<RegularState> getAllActiveStates() {
-		Set<RegularState> vertices = new HashSet<RegularState>();
-		for (ExecutionState state : activeStateConfig) {
-			if (state != null)
-				vertices.addAll(getActiveHierachy((RegularState) state
-						.getSourceElement()));
-		}
-		return vertices;
-	}
-
-	private Collection<? extends RegularState> getActiveHierachy(
-			RegularState vertex) {
-		List<RegularState> result = new ArrayList<RegularState>();
-		result.add(vertex);
-		EObject container = vertex.eContainer();
-		while (container != null) {
-			if (container instanceof State) {
-				result.add((State) container);
-			}
-			container = container.eContainer();
-		}
-		return result;
-	}
-
-
-	public void unraiseEvent(String eventName) {
-		synchronized (raisedEvents) {
-			getDeclaredEvent(eventName).unraise();
-//			Iterator<ExecutionEvent> iterator = raisedEvents.iterator();
-//			while (iterator.hasNext()) {
-//				if (iterator.next().getName().equals(eventName)) {
-//					iterator.remove();
-//				}
-//			}
-		}
-	}
-
-	public void unscheduleEvent(String eventName) {
-		synchronized (scheduledToRaiseEvents) {
-			Iterator<ExecutionEvent> iterator = scheduledToRaiseEvents
-					.iterator();
-			while (iterator.hasNext()) {
-				if (iterator.next().getName().equals(eventName)) {
-					iterator.remove();
-				}
-			}
-		}
-	}
-
-	public boolean isEventScheduled(String name) {
-		synchronized (scheduledToRaiseEvents) {
-			for (IEventSlot event : scheduledToRaiseEvents) {
-				if (name.equals(event.getName())) {
-					return true;
-				}
-			}
-		}
-		return false;
-	}
-
-	
-	public void slotChanged(ISlot slot, ISlotChangedEvent changeEvent) {
-		if (changeEvent instanceof IEventSlot.SlotEventRaised) {
-			raisedEvents.add((ExecutionEvent)slot);
-			notifyEventRaised((ExecutionEvent)slot);			
-		} else if ( changeEvent instanceof IEventSlot.SlotEventUnraised ) {
-			raisedEvents.remove((ExecutionEvent)slot);
-		} else if (changeEvent instanceof ISlot.SlotValueChanged) {
-			notifyValueChanged(slot);
-		}
-	}
-	
-	
-}

+ 0 - 81
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/impl/ExecutionEvent.java

@@ -1,81 +0,0 @@
-/**
- * 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.simulation.core.runtime.impl;
-
-import org.yakindu.base.types.ITypeSystem.InferredType;
-import org.yakindu.sct.simulation.core.runtime.IEventSlot;
-import org.yakindu.sct.simulation.core.runtime.IExecutionContext;
-
-/**
- * Read only access to ScopeEvents. Value can only be changed via
- * {@link IExecutionContext}#setVariableValue
- * 
- * @author andreas muelder - Initial contribution and API
- * @author axel terfloth - refactoring
- * 
- * 
- */
-public class ExecutionEvent extends AbstractSlot implements IEventSlot {
-
-	protected boolean raised = false;
-
-	public ExecutionEvent(String name) {
-		this(name, null, null);
-	}
-
-	public ExecutionEvent(String name, InferredType type) {
-		super(name, type, null);
-	}
-
-	public ExecutionEvent(String name, InferredType type, Object value) {
-		super(name, type, value);
-	}
-
-	public ExecutionEvent getCopy() {
-		return new ExecutionEvent(getName(), getType(), getValue());
-	}
-
-	public void raise(Object value) {
-		if (!raised) {
-			raised = true;
-			if (value != null) {
-				assertValue(value);
-				this.value = value;
-			}
-
-			notifyRaised();
-		}
-	}
-
-	public void unraise() {
-		if (raised) {
-			raised = false;
-			notifyUnraised();
-		}
-	}
-
-	public boolean isRaised() {
-		return raised;
-	}
-
-	protected void notifyRaised() {
-		if (context != null) {
-			context.slotChanged(this, SLOT_EVENT_RAISED);
-		}
-	}
-
-	protected void notifyUnraised() {
-		if (context != null) {
-			context.slotChanged(this, SLOT_EVENT_UNRAISED);
-		}
-	}
-
-}

+ 0 - 15
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/impl/ExecutionOperation.java

@@ -1,15 +0,0 @@
-package org.yakindu.sct.simulation.core.runtime.impl;
-
-import org.yakindu.base.types.ITypeSystem.InferredType;
-
-public class ExecutionOperation extends AbstractSlot {
-
-	protected InferredType[] paramTypes;
-	
-	public ExecutionOperation(String name, Object value, InferredType type, InferredType... paramTypes) {
-		super(name, type, value);
-		this.paramTypes = paramTypes;
-	}
-
-
-}

+ 0 - 32
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/runtime/impl/ExecutionVariable.java

@@ -1,32 +0,0 @@
-/**
- * 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.simulation.core.runtime.impl;
-
-import org.yakindu.base.types.ITypeSystem.InferredType;
-import org.yakindu.sct.simulation.core.runtime.IExecutionContext;
-
-
-/**
- * Read only access to ScopeVariables. Value can only be changed via
- * {@link IExecutionContext}#setVariableValue
- * 
- * 
- * @author andreas muelder - Initial contribution and API
- * 
- * 
- */
-public class ExecutionVariable extends AbstractSlot {
-
-	public ExecutionVariable(String name, InferredType type, Object value) {
-		super(name, type, value);
-	}
-
-}