M - the type of the simulation model.public class SimSimpleFairPassiveResource extends AbstractSimResource implements IPassiveResource
SimAbstractPassiveResource, because that
abstract class is intended for passive resources that are accessed by EXACT schedulers (e.g.,
specific Windows, Linux Scheduler).
TODO: comment
TODO Initialize based on given model elements [Lehrig]| Constructor and Description |
|---|
SimSimpleFairPassiveResource(org.palladiosimulator.pcm.repository.PassiveResource resource,
org.palladiosimulator.pcm.core.composition.AssemblyContext assemblyContext,
SchedulerModel model,
Long capacity) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acquire(ISchedulableProcess schedulableProcess,
long num,
boolean timeout,
double timeoutValue)
Acquires num instances of the passive resource for the given process.
|
void |
addObserver(IPassiveResourceSensor observer)
Adds the given observer.
|
org.palladiosimulator.pcm.core.composition.AssemblyContext |
getAssemblyContext()
Getter for the model element of the assembly context.
|
long |
getAvailable()
Returns the number of remaining instances.
|
org.palladiosimulator.pcm.repository.PassiveResource |
getResource()
Getter for the model element of the passive resource.
|
Queue<IWaitingProcess> |
getWaitingProcesses()
Returns a queue containing the waiting processes for the passive resource.
|
boolean |
isWaiting(SimpleWaitingProcess process)
Determines if a given process is currently waiting to acquire this resource.
|
void |
release(ISchedulableProcess schedulableProcess,
long num)
Releases num instances of the passive resource from the given process.
|
void |
remove(SimpleWaitingProcess process)
Removes a waiting process from the queue.
|
void |
removeObserver(IPassiveResourceSensor observer)
Removes the given observer
|
equals, getCapacity, getId, getName, hashCode, toStringgetModelgetEncapsulatedEntity, isScheduled, reschedulegetCapacity, getId, getNamepublic SimSimpleFairPassiveResource(org.palladiosimulator.pcm.repository.PassiveResource resource,
org.palladiosimulator.pcm.core.composition.AssemblyContext assemblyContext,
SchedulerModel model,
Long capacity)
public org.palladiosimulator.pcm.repository.PassiveResource getResource()
IPassiveResourcegetResource in interface IPassiveResourcepublic org.palladiosimulator.pcm.core.composition.AssemblyContext getAssemblyContext()
IPassiveResourcegetAssemblyContext in interface IPassiveResourcepublic Queue<IWaitingProcess> getWaitingProcesses()
IPassiveResourcegetWaitingProcesses in interface IPassiveResourcepublic boolean acquire(ISchedulableProcess schedulableProcess, long num, boolean timeout, double timeoutValue)
IPassiveResourceacquire in interface IPassiveResourcepublic void release(ISchedulableProcess schedulableProcess, long num)
IPassiveResourcerelease in interface IPassiveResourcepublic void addObserver(IPassiveResourceSensor observer)
IPassiveResourceaddObserver in interface IPassiveResourcepublic void removeObserver(IPassiveResourceSensor observer)
IPassiveResourceremoveObserver in interface IPassiveResourcepublic long getAvailable()
IPassiveResourcegetAvailable in interface IPassiveResourcepublic boolean isWaiting(SimpleWaitingProcess process)
process - the processpublic void remove(SimpleWaitingProcess process)
process - the process to remove