Class HostResourceManagementHandle
java.lang.Object
com._1c.g5.v8.internal.resourcemanagement.HostResourceManagementHandle
- All Implemented Interfaces:
IHostResourceManagementHandle
IHostResourceManagementHandle
implementation that delegates all calls to the internal API IHostResourceManagerOperations
.-
Constructor Summary
ConstructorsConstructorDescriptionConstructs the handle using the providedIHostResourceManagerOperations
API point and the corresponding resource plan. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.int
getPermittedThreads
(String activityName) Gets the number of simultaneous threads that are available for the current activityboolean
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).
-
Constructor Details
-
HostResourceManagementHandle
Constructs the handle using the providedIHostResourceManagerOperations
API point and the corresponding resource plan.- Parameters:
manager
- The management API reference, cannot benull
plan
- The resource plan, cannot benull
-
-
Method Details
-
getPermittedThreads
Description copied from interface:IHostResourceManagementHandle
Gets the number of simultaneous threads that are available for the current activity- Specified by:
getPermittedThreads
in interfaceIHostResourceManagementHandle
- Parameters:
activityName
- The name of the activity. Cannot benull
- Returns:
- The number of threads permitted for the selected activity praocessing. Cannot be less then {@code 1)
-
isActivityRunning
Description copied from interface:IHostResourceManagementHandle
Checks if the given acitvity is being run at the moment.- Specified by:
isActivityRunning
in interfaceIHostResourceManagementHandle
- Parameters:
activityName
- The name of the activity. Cannot benull
.- Returns:
- True in case if the activity is being run. False otherwise.
-
startActivity
Description copied from interface:IHostResourceManagementHandle
Starts an activity registered via the corresponding plan. The activity shouldn't be started at the momemnt of the call.- Specified by:
startActivity
in interfaceIHostResourceManagementHandle
- Parameters:
activityName
- The name of the activity. Cannot benull
.
-
stopActivity
Description copied from interface:IHostResourceManagementHandle
Stops an activity registered via the corresponding plan. The activity should be started at the moment of the call.- Specified by:
stopActivity
in interfaceIHostResourceManagementHandle
- Parameters:
activityName
- The name of the activity. Cannot benull
.
-
updateDemands
Description copied from interface:IHostResourceManagementHandle
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- Specified by:
updateDemands
in interfaceIHostResourceManagementHandle
- Parameters:
activityName
- The name of the activity
-
addListener
Description copied from interface:IHostResourceManagementHandle
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.- Specified by:
addListener
in interfaceIHostResourceManagementHandle
- Parameters:
listener
- The listener instance, cannot benull
-