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 TypeMethodDescriptionboolean
acquire
(ISchedulableProcess process, 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
Getter for the model element of the assembly context.long
Returns the number of remaining instances.long
Returns 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.PassiveResource
Getter for the model element of the passive resource.Returns a queue containing the waiting processes for the passive resource.void
release
(ISchedulableProcess process, long num) Releases num instances of the passive resource from the given process.void
removeObserver
(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.
-