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 TypeMethodDescriptionvoidaddListener(IResourcePlan plan, IHostResourceManagerListener listener) Adds a listener to the handle's plan activities.intgetPermittedThreads(IResourcePlan plan, String activityName) Gets the number of simultaneous threads that are available for the current activitybooleanisActivityRunning(IResourcePlan plan, String activityName) Checks if the given acitvity is being run at the moment.Registers the client resource plan.voidstart()Starts the resource manager activityvoidstartActivity(IResourcePlan plan, String activityName) Starts an activity registered via the corresponding plan.voidstop()Stops the resource manager activityvoidstopActivity(IResourcePlan plan, String activityName) Stops an activity registered via the corresponding plan.voidupdateDemands(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:IHostResourceManagerOperationsAdds a listener to the handle's plan activities. SeeIHostResourceManagementHandle.addListener(IHostResourceManagerListener)for details- Specified by:
addListenerin interfaceIHostResourceManagerOperations- Parameters:
plan- The resource plan, cannot benulllistener- The listener instance. Cannot benull
-
getPermittedThreads
Description copied from interface:IHostResourceManagerOperationsGets the number of simultaneous threads that are available for the current activity- Specified by:
getPermittedThreadsin interfaceIHostResourceManagerOperations- Parameters:
plan- The resource plan, cannot benullactivityName- 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:IHostResourceManagerOperationsChecks if the given acitvity is being run at the moment.- Specified by:
isActivityRunningin interfaceIHostResourceManagerOperations- Parameters:
plan- The resource plan, cannot benullactivityName- The name of the activity. Cannot benull.- Returns:
- True in case if the activity is being run. False otherwise.
-
registerResourcePlan
Description copied from interface:IHostResourceManagerRegisters 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:
registerResourcePlanin interfaceIHostResourceManager- Parameters:
plan- The resource plan to register. Cannot benull- Returns:
- The
IHostResourceManagementHandlefor the client to communicate with the facility. Nevernull
-
start
public void start()Description copied from interface:IHostResourceManagerStarts the resource manager activity- Specified by:
startin interfaceIHostResourceManager
-
startActivity
Description copied from interface:IHostResourceManagerOperationsStarts an activity registered via the corresponding plan. The activity shouldn't be started at the momemnt of the call.- Specified by:
startActivityin interfaceIHostResourceManagerOperations- Parameters:
plan- The resource plan, cannot benullactivityName- The name of the activity. Cannot benull.
-
stop
public void stop()Description copied from interface:IHostResourceManagerStops the resource manager activity- Specified by:
stopin interfaceIHostResourceManager
-
stopActivity
Description copied from interface:IHostResourceManagerOperationsStops an activity registered via the corresponding plan. The activity should be started at the moment of the call.- Specified by:
stopActivityin interfaceIHostResourceManagerOperations- Parameters:
plan- The resource plan, cannot benullactivityName- The name of the activity. Cannot benull.
-
updateDemands
Description copied from interface:IHostResourceManagerOperationsUpdates 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:
updateDemandsin interfaceIHostResourceManagerOperations- Parameters:
plan- The resource plan, cannot benullactivityName- The name of the activity. Cannot benull.
-