Interface IQueueingStrategy

  • All Known Implementing Classes:
    MultipleQueuesStrategy, SingleQueueStrategy

    public interface IQueueingStrategy
    The queuing strategy of a process encapsulates the actual queue(s) of a set of resource instances. Possible parameters are, for example, a single queue for all instance versus a queue for each instance.
    • Method Detail

      • addProcess

        void addProcess​(IActiveProcess process,
                        IResourceInstance current,
                        boolean inFront)
        Adds a process to the queue(s).
        Parameters:
        inFront - If true, the process is added at the beginning of its queue, otherwise at its end.
      • activelyBalance

        void activelyBalance​(IResourceInstance instance)
        Depending on the underlying implementation the load is balanced between the resource instances.
        Parameters:
        instance - Instance initiating the load balance.
      • removePendingProcess

        boolean removePendingProcess​(IActiveProcess process)
        Removes at the pending queues of the queuing strategy and tries to remove the process there.
        Parameters:
        process - Process that should be removed.
        Returns:
        True, if the process was successfully removed. False, if the process was not found in the pending queues.
      • containsPending

        boolean containsPending​(IActiveProcess process)
        Parameters:
        process - Process looked for.
        Returns:
        True, if the process is in a pending queue of the strategy.
      • setRunningOn

        void setRunningOn​(IActiveProcess process,
                          IResourceInstance instance)
        Sets the process as executing on the given instance. In order for this operation to be successful, the process must be in ready state and in the a pending queue of the strategy.
        Parameters:
        process - Process that shall be executed.
        instance - Target instance for the process.
      • runningOn

        IResourceInstance runningOn​(IActiveProcess process)
        Parameters:
        process - Process of interest.
        Returns:
        Returns the resource instance the process is currently running on. NULL if the process is not assigned to a resource.
      • removeRunning

        void removeRunning​(IActiveProcess process)
        Removes a process from the running list of the instance.
        Parameters:
        process - Process of interest.
      • isIdle

        boolean isIdle​(IResourceInstance instance)
        True, if the given resource has no running or pending jobs, otherwise false.
        Parameters:
        instance -
      • fromRunningToWaiting

        void fromRunningToWaiting​(IActiveProcess process)
      • resetStarvationInfo

        void resetStarvationInfo()