Class SimulatedProcess
- java.lang.Object
-
- de.uka.ipd.sdq.simulation.abstractsimengine.SimulationElement
-
- de.uka.ipd.sdq.simulation.abstractsimengine.AbstractSimEntityDelegator
-
- edu.kit.ipd.sdq.eventsim.entities.EventSimEntity
-
- edu.kit.ipd.sdq.eventsim.resources.entities.SimulatedProcess
-
- All Implemented Interfaces:
de.uka.ipd.sdq.scheduler.ISchedulableProcess,de.uka.ipd.sdq.simulation.abstractsimengine.IEntity
public class SimulatedProcess extends EventSimEntity implements de.uka.ipd.sdq.scheduler.ISchedulableProcess
A simulated process is a process that can be scheduled on an active or passive resource. Whenever the scheduler activates or passivates the process, theIProcessListener, which has been passed to the constructor, gets notified.- See Also:
ISchedulableProcess
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class edu.kit.ipd.sdq.eventsim.entities.EventSimEntity
EventSimEntity.EntityLifecyclePhase
-
-
Constructor Summary
Constructors Constructor Description SimulatedProcess(de.uka.ipd.sdq.simulation.abstractsimengine.ISimulationModel model, SimulatedProcess parent, IRequest request)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate()voidaddTerminatedObserver(de.uka.ipd.sdq.scheduler.IActiveResource o)Adds an observer which gets notifies when the process has ended its execution.voidfireTerminated()Notifies the observers which have been registered viaaddTerminatedObserver(IActiveResource)that the process has ended it execution.org.palladiosimulator.pcm.seff.AbstractActiongetCurrentPosition()StringgetId()StringgetName()Returns the name of this entity.SimulatedProcessgetParent()intgetPriority()IRequestgetRequest()Returns the request that created this simulated process.de.uka.ipd.sdq.scheduler.ISchedulableProcessgetRootProcess()booleanisFinished()voidpassivate()voidremoveTerminatedObserver(de.uka.ipd.sdq.scheduler.IActiveResource o)Removes the specified resource from the observer list.voidsetOnActivationCallback(Procedure callback)voidsetPriority(int priority)voidterminate()Terminates this simulated process.voidtimeout(String timeoutFailureName)-
Methods inherited from class edu.kit.ipd.sdq.eventsim.entities.EventSimEntity
addEntityListener, equals, getEntityId, getLifecyclePhase, hashCode, notifyEnteredSystem, notifyLeftSystem, removeEntityListener, resetIdGenerator, toString
-
Methods inherited from class de.uka.ipd.sdq.simulation.abstractsimengine.AbstractSimEntityDelegator
getEncapsulatedEntity, isScheduled, reschedule
-
-
-
-
Constructor Detail
-
SimulatedProcess
public SimulatedProcess(de.uka.ipd.sdq.simulation.abstractsimengine.ISimulationModel model, SimulatedProcess parent, IRequest request)
-
-
Method Detail
-
setOnActivationCallback
public void setOnActivationCallback(Procedure callback)
-
activate
public void activate()
- Specified by:
activatein interfacede.uka.ipd.sdq.scheduler.ISchedulableProcess
-
passivate
public void passivate()
- Specified by:
passivatein interfacede.uka.ipd.sdq.scheduler.ISchedulableProcess
-
getId
public String getId()
- Specified by:
getIdin interfacede.uka.ipd.sdq.scheduler.ISchedulableProcess
-
getRootProcess
public de.uka.ipd.sdq.scheduler.ISchedulableProcess getRootProcess()
- Specified by:
getRootProcessin interfacede.uka.ipd.sdq.scheduler.ISchedulableProcess
-
getRequest
public IRequest getRequest()
Returns the request that created this simulated process.
-
getParent
public SimulatedProcess getParent()
-
isFinished
public boolean isFinished()
- Specified by:
isFinishedin interfacede.uka.ipd.sdq.scheduler.ISchedulableProcess
-
terminate
public void terminate()
Terminates this simulated process. Notifies all observers that has been registered by theaddTerminatedObservermethod.If this simulated process terminated already, calling this method has no effect.
-
getPriority
public int getPriority()
- Specified by:
getPriorityin interfacede.uka.ipd.sdq.scheduler.ISchedulableProcess
-
setPriority
public void setPriority(int priority)
- Specified by:
setPriorityin interfacede.uka.ipd.sdq.scheduler.ISchedulableProcess
-
addTerminatedObserver
public void addTerminatedObserver(de.uka.ipd.sdq.scheduler.IActiveResource o)
Adds an observer which gets notifies when the process has ended its execution.- Specified by:
addTerminatedObserverin interfacede.uka.ipd.sdq.scheduler.ISchedulableProcess
-
fireTerminated
public void fireTerminated()
Notifies the observers which have been registered viaaddTerminatedObserver(IActiveResource)that the process has ended it execution. This is automatically done, whenterminate()method is being invoked.- Specified by:
fireTerminatedin interfacede.uka.ipd.sdq.scheduler.ISchedulableProcess
-
removeTerminatedObserver
public void removeTerminatedObserver(de.uka.ipd.sdq.scheduler.IActiveResource o)
Removes the specified resource from the observer list.- Specified by:
removeTerminatedObserverin interfacede.uka.ipd.sdq.scheduler.ISchedulableProcess
-
timeout
public void timeout(String timeoutFailureName)
- Specified by:
timeoutin interfacede.uka.ipd.sdq.scheduler.ISchedulableProcess
-
getName
public String getName()
Description copied from class:EventSimEntityReturns the name of this entity. The name is thenamePrefixpassed to the constructor concatenated with the entity's ID.- Overrides:
getNamein classEventSimEntity- Returns:
- a string representation of this entity
-
getCurrentPosition
public org.palladiosimulator.pcm.seff.AbstractAction getCurrentPosition()
-
-