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 Details

    • acquire

      boolean acquire(ISchedulableProcess process, long num, boolean timeout, double timeoutValue)
      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

      void release(ISchedulableProcess process, long num)
      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

      void addObserver(IPassiveResourceSensor observer)
      Adds the given observer. Observers get notified when a process acquired or released this resource.
    • removeObserver

      void removeObserver(IPassiveResourceSensor observer)
      Removes the given observer
    • getWaitingProcesses

      Queue<IWaitingProcess> getWaitingProcesses()
      Returns a queue containing the waiting processes for the passive resource.