Interface IHostResourceManagementHandle

All Known Implementing Classes:
HostResourceManagementHandle

public interface IHostResourceManagementHandle
The handle provides the single point of the push/pull communication with the host resource management facility. The handle is being received on registration of the IResourcePlan in the IHostResourceManager and should be stored till the end of the client service lifecycle.
The handle protects the resource management facility (being the critical part of the system) from unattended calls of client services and doesn't allow them to break the system resource balance as a result.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds a listener to the handle's plan activities.
    The usual strategy is to register a single listener for all activities of the plan.
    There is no need in managing the listener lifecycle - it will be disposed at the end of the resource subsystem lifecycle.
    int
    Gets the number of simultaneous threads that are available for the current activity
    boolean
    isActivityRunning(String activityName)
    Checks if the given acitvity is being run at the moment.
    void
    startActivity(String activityName)
    Starts an activity registered via the corresponding plan.
    void
    stopActivity(String activityName)
    Stops an activity registered via the corresponding plan.
    void
    updateDemands(String activityName)
    Updates demands of the selected activity (should be started at the moment of the update).
  • Method Details

    • getPermittedThreads

      int getPermittedThreads(String activityName)
      Gets the number of simultaneous threads that are available for the current activity
      Parameters:
      activityName - The name of the activity. Cannot be null
      Returns:
      The number of threads permitted for the selected activity praocessing. Cannot be less then {@code 1)
    • updateDemands

      void updateDemands(String activityName)
      Updates demands of the selected activity (should be started at the moment of the update). The resource management facility should re-balance the resource permissions and notify all affected clients as a result
      Parameters:
      activityName - The name of the activity
    • startActivity

      void startActivity(String activityName)
      Starts an activity registered via the corresponding plan. The activity shouldn't be started at the momemnt of the call.
      Parameters:
      activityName - The name of the activity. Cannot be null.
    • stopActivity

      void stopActivity(String activityName)
      Stops an activity registered via the corresponding plan. The activity should be started at the moment of the call.
      Parameters:
      activityName - The name of the activity. Cannot be null.
    • isActivityRunning

      boolean isActivityRunning(String activityName)
      Checks if the given acitvity is being run at the moment.
      Parameters:
      activityName - The name of the activity. Cannot be null.
      Returns:
      True in case if the activity is being run. False otherwise.
    • addListener

      void addListener(IHostResourceManagerListener listener)
      Adds a listener to the handle's plan activities.
      The usual strategy is to register a single listener for all activities of the plan.
      There is no need in managing the listener lifecycle - it will be disposed at the end of the resource subsystem lifecycle.
      Parameters:
      listener - The listener instance, cannot be null