Package de.uka.ipd.sdq.scheduler
Interface IPassiveResource
public interface IPassiveResource
A passive can be hold by a process for some time. As the number of available instances is limited
the process might has to wait until it gets the requested number of instances.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanacquire(ISchedulableProcess process, long num, boolean timeout, double timeoutValue) Acquires num instances of the passive resource for the given process.voidaddObserver(IPassiveResourceSensor observer) Adds the given observer.org.palladiosimulator.pcm.core.composition.AssemblyContextGetter for the model element of the assembly context.longReturns the number of remaining instances.longReturns the maximal number of instances that can be acquired at the same time.getId()Unique identifier of the resource.getName()Name of the resource.org.palladiosimulator.pcm.repository.PassiveResourceGetter for the model element of the passive resource.Returns a queue containing the waiting processes for the passive resource.voidrelease(ISchedulableProcess process, long num) Releases num instances of the passive resource from the given process.voidremoveObserver(IPassiveResourceSensor observer) Removes the given observer
-
Method Details
-
acquire
Acquires num instances of the passive resource for the given process. The process is blocked until it successfully receives the requested number of resource instances.- Returns:
- True, if the acquisition was successful, otherwise false.
-
release
Releases num instances of the passive resource from the given process. -
getResource
org.palladiosimulator.pcm.repository.PassiveResource getResource()Getter for the model element of the passive resource.- Returns:
- The passive resource model element.
-
getAssemblyContext
org.palladiosimulator.pcm.core.composition.AssemblyContext getAssemblyContext()Getter for the model element of the assembly context.- Returns:
- The assembly context of the passive resource.
-
getName
String getName()Name of the resource.- Returns:
-
getId
String getId()Unique identifier of the resource.- Returns:
-
getCapacity
long getCapacity()Returns the maximal number of instances that can be acquired at the same time. -
getAvailable
long getAvailable()Returns the number of remaining instances. -
addObserver
Adds the given observer. Observers get notified when a process acquired or released this resource. -
removeObserver
Removes the given observer -
getWaitingProcesses
Queue<IWaitingProcess> getWaitingProcesses()Returns a queue containing the waiting processes for the passive resource.
-