Class SimulatedProcess
- java.lang.Object
-
- de.uka.ipd.sdq.simulation.abstractsimengine.processes.SimulatedProcess
-
- All Implemented Interfaces:
IEntity,ISimProcess
- Direct Known Subclasses:
DesmoJSimProcess,SSJSimProcess
public abstract class SimulatedProcess extends Object implements ISimProcess
-
-
Field Summary
Fields Modifier and Type Field Description protected List<ISimProcessListener>listenersA list of process listeners getting notifications on resume and suspendstatic org.apache.log4j.LoggerLOGGERProcessStatemyProcessStateCurrent state of this processISimProcessStrategyprocessStrategyStrategy used to suspend threads if requested
-
Constructor Summary
Constructors Constructor Description SimulatedProcess(ISimProcessStrategy processStrategy)Default constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidactions()voidaddProcessListener(ISimProcessListener l)protected abstract AbstractSimProcessDelegatorgetAbstractProcess()booleanisTerminated()Returns whether this process has finished its execution.protected voidnotifyListeners(ISimProcess process, ProcessState oldState, ProcessState newState)Notifies registered listeners that the given process is about to be suspended or resumed again.voidpassivate()Passivates this process.voidpreempt()voidremoveProcessListener(ISimProcessListener l)protected voidresume()voidstartProcess(ISimProcessStrategy processStrategy)voidsuspend()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.uka.ipd.sdq.simulation.abstractsimengine.IEntity
isScheduled, reschedule
-
Methods inherited from interface de.uka.ipd.sdq.simulation.abstractsimengine.ISimProcess
passivate, scheduleAt
-
-
-
-
Field Detail
-
LOGGER
public static final org.apache.log4j.Logger LOGGER
-
myProcessState
public ProcessState myProcessState
Current state of this process
-
listeners
protected final List<ISimProcessListener> listeners
A list of process listeners getting notifications on resume and suspend
-
processStrategy
public final ISimProcessStrategy processStrategy
Strategy used to suspend threads if requested
-
-
Constructor Detail
-
SimulatedProcess
public SimulatedProcess(ISimProcessStrategy processStrategy)
Default constructor.- Parameters:
processStrategy-
-
-
Method Detail
-
startProcess
public void startProcess(ISimProcessStrategy processStrategy)
-
actions
public void actions()
-
isTerminated
public boolean isTerminated()
Description copied from interface:ISimProcessReturns whether this process has finished its execution.- Specified by:
isTerminatedin interfaceISimProcess
-
passivate
public void passivate()
Description copied from interface:ISimProcessPassivates this process. This will suspend the simulation of the process until it is resumed again using thescheduleAtmethod.- Specified by:
passivatein interfaceISimProcess
-
getAbstractProcess
protected abstract AbstractSimProcessDelegator getAbstractProcess()
-
suspend
public void suspend()
-
resume
protected void resume()
-
addProcessListener
public void addProcessListener(ISimProcessListener l)
- Specified by:
addProcessListenerin interfaceISimProcess
-
removeProcessListener
public void removeProcessListener(ISimProcessListener l)
- Specified by:
removeProcessListenerin interfaceISimProcess
-
notifyListeners
protected void notifyListeners(ISimProcess process, ProcessState oldState, ProcessState newState)
Notifies registered listeners that the given process is about to be suspended or resumed again.- Parameters:
process- the process which is being resumed or suspendedisSuspending- true, if the process is about to be suspended; false, if the process is about to be resumed
-
preempt
public void preempt()
- Specified by:
preemptin interfaceISimProcess
-
-