Class ASimplePassiveResource

java.lang.Object
org.palladiosimulator.probeframework.probes.example.ASimplePassiveResource
Direct Known Subclasses:
SimpleMutEx

public abstract class ASimplePassiveResource extends Object
Represents an abstract passive resource for demonstration purposes.

The state of a concrete example passive resource can be manually controlled.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Aquires a resource from the passive resource.
    boolean
    States whether free resources are left within the passive resource.
    int
    Returns the number of currently free resources within this passive resource.
    int
    Returns the maximum size of this passive resource.
    void
    Releases a resource from the passive resource.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ASimplePassiveResource

      public ASimplePassiveResource(int size)
      Default constructor. Creates a passive resource with the given resource size.
      Parameters:
      size - Size of the passive resource for resources.
  • Method Details

    • acquire

      public void acquire()
      Aquires a resource from the passive resource.
    • release

      public void release()
      Releases a resource from the passive resource.
    • canAcquire

      public boolean canAcquire()
      States whether free resources are left within the passive resource.
      Returns:
      true if free resources are left, false otherwise.
    • getSize

      public int getSize()
      Returns the maximum size of this passive resource.
      Returns:
      The size.
    • getFree

      public int getFree()
      Returns the number of currently free resources within this passive resource.
      Returns:
      The number of free resources.