Class HostResourceManager
java.lang.Object
com._1c.g5.v8.internal.resourcemanagement.HostResourceManager
- All Implemented Interfaces:
IHostResourceManager
,IHostResourceManagerOperations
public class HostResourceManager
extends Object
implements IHostResourceManager, IHostResourceManagerOperations
Host resource manager implementation based on the information being provided by clients via registration
of
IResourcePlan
's.-
Constructor Summary
ConstructorsConstructorDescriptionHostResourceManager
(IHostResourceInformationProvider resourceInformationProvider) Constructs an instance of the manager -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(IResourcePlan plan, IHostResourceManagerListener listener) Adds a listener to the handle's plan activities.int
getPermittedThreads
(IResourcePlan plan, String activityName) Gets the number of simultaneous threads that are available for the current activityboolean
isActivityRunning
(IResourcePlan plan, String activityName) Checks if the given acitvity is being run at the moment.Registers the client resource plan.void
start()
Starts the resource manager activityvoid
startActivity
(IResourcePlan plan, String activityName) Starts an activity registered via the corresponding plan.void
stop()
Stops the resource manager activityvoid
stopActivity
(IResourcePlan plan, String activityName) Stops an activity registered via the corresponding plan.void
updateDemands
(IResourcePlan plan, String activityName) Updates demands of the selected activity (should be started at the moment of the update).
-
Constructor Details
-
HostResourceManager
Constructs an instance of the manager
-
-
Method Details
-
addListener
Description copied from interface:IHostResourceManagerOperations
Adds a listener to the handle's plan activities. SeeIHostResourceManagementHandle.addListener(IHostResourceManagerListener)
for details- Specified by:
addListener
in interfaceIHostResourceManagerOperations
- Parameters:
plan
- The resource plan, cannot benull
listener
- The listener instance. Cannot benull
-
getPermittedThreads
Description copied from interface:IHostResourceManagerOperations
Gets the number of simultaneous threads that are available for the current activity- Specified by:
getPermittedThreads
in interfaceIHostResourceManagerOperations
- Parameters:
plan
- The resource plan, cannot benull
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:IHostResourceManagerOperations
Checks if the given acitvity is being run at the moment.- Specified by:
isActivityRunning
in interfaceIHostResourceManagerOperations
- Parameters:
plan
- The resource plan, cannot benull
activityName
- The name of the activity. Cannot benull
.- Returns:
- True in case if the activity is being run. False otherwise.
-
registerResourcePlan
Description copied from interface:IHostResourceManager
Registers the client resource plan. The plan should be registered on early stages of the client service initilization for the system to be able to balance resources before static services creation/initialization.- Specified by:
registerResourcePlan
in interfaceIHostResourceManager
- Parameters:
plan
- The resource plan to register. Cannot benull
- Returns:
- The
IHostResourceManagementHandle
for the client to communicate with the facility. Nevernull
-
start
public void start()Description copied from interface:IHostResourceManager
Starts the resource manager activity- Specified by:
start
in interfaceIHostResourceManager
-
startActivity
Description copied from interface:IHostResourceManagerOperations
Starts an activity registered via the corresponding plan. The activity shouldn't be started at the momemnt of the call.- Specified by:
startActivity
in interfaceIHostResourceManagerOperations
- Parameters:
plan
- The resource plan, cannot benull
activityName
- The name of the activity. Cannot benull
.
-
stop
public void stop()Description copied from interface:IHostResourceManager
Stops the resource manager activity- Specified by:
stop
in interfaceIHostResourceManager
-
stopActivity
Description copied from interface:IHostResourceManagerOperations
Stops an activity registered via the corresponding plan. The activity should be started at the moment of the call.- Specified by:
stopActivity
in interfaceIHostResourceManagerOperations
- Parameters:
plan
- The resource plan, cannot benull
activityName
- The name of the activity. Cannot benull
.
-
updateDemands
Description copied from interface:IHostResourceManagerOperations
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 interfaceIHostResourceManagerOperations
- Parameters:
plan
- The resource plan, cannot benull
activityName
- The name of the activity. Cannot benull
.
-