Class DefaultGridServiceManagers
- All Implemented Interfaces:
Iterable<GridServiceManager>,AdminAware,DumpProvider,GridServiceManagers,InternalGridServiceManagers
- Author:
- kimchy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddGridServiceManager(InternalGridServiceManager gridServiceManager) voidaddLifecycleListener(GridServiceManagerLifecycleEventListener eventListener) Allows to add aGridServiceManagerLifecycleEventListener.deploy(ApplicationDeployment deployment) Deploys an application consisting of one or more processing unit deployments.deploy(ApplicationDeployment deployment, long timeout, TimeUnit timeUnit) Deploys an application consisting of one or more processing unit deployments.deploy(Application application, ProcessingUnitDeploymentTopology puDeploymentTopology, long timeout, TimeUnit timeUnit) deploy(ApplicationConfig applicationConfig) Deploys an application consisting of one or more processing unit deployments.deploy(ApplicationConfig applicationConfig, long timeout, TimeUnit timeUnit) Deploys an application consisting of one or more processing unit deployments.deploy(ProcessingUnitDeployment deployment) Deploys a processing unit based on the processing unit deployment information on a random grid service manager (it will act as the primary GSM for the deployed processing unit).deploy(ProcessingUnitDeployment deployment, long timeout, TimeUnit timeUnit) Deploys a processing unit based on the processing unit deployment information on a random grid service manager (it will act as the primary GSM for the deployed processing unit).deploy(SpaceDeployment deployment) Deploys a space based on the space deployment information on a random grid service manager (it will act as the primary GSM for the deployed processing unit).deploy(SpaceDeployment deployment, long timeout, TimeUnit timeUnit) Deploys a space based on the space deployment information on a random grid service manager (it will act as the primary GSM for the deployed processing unit).generateDump(String cause, Map<String, Object> context) Generates dump for all the provided dump processors.Generates dump for the provided processors.getAdmin()Returns theAdminassociated with this element.Returns the grid service manager added event manager allowing to add and removeGridServiceManagerAddedEventListeners.Returns the grid service container added event manager allowing to add and removeGridServiceManagerRemovedEventListeners.getManagerByUID(String uid) Returns a manager based on its uid.Returns all the currently discovered managers.intgetSize()Returns the number of managers current discovered.getUids()Returns a map of grid service manager with the key as the uid.booleanisEmpty()Returnstrueif there are no managers,falseotherwise.iterator()voidremoveLifecycleListener(GridServiceManagerLifecycleEventListener eventListener) Allows to remove aGridServiceManagerLifecycleEventListener.replaceGridServiceManager(InternalGridServiceManager gridServiceManager) Replaces the grid service manager, returning the old onebooleanwaitFor(int numberOfGridServiceManagers) Waits indefinitely till the provided number of managers are up.booleanWaits for the given timeout (in time unit) till the provided number of managers are up.waitForActiveManager(long timeout, TimeUnit timeUnit) Waits indefinitely till at least one GSM is discovered and returns it.waitForAtLeastOne(long timeout, TimeUnit timeUnit) Waits for the given timeout (in time unit) till at least one GSM is discovered and returns it.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
DefaultGridServiceManagers
-
-
Method Details
-
getAdmin
Description copied from interface:AdminAwareReturns theAdminassociated with this element.- Specified by:
getAdminin interfaceAdminAware
-
getGridServiceManagerAdded
Description copied from interface:GridServiceManagersReturns the grid service manager added event manager allowing to add and removeGridServiceManagerAddedEventListeners.- Specified by:
getGridServiceManagerAddedin interfaceGridServiceManagers
-
getGridServiceManagerRemoved
Description copied from interface:GridServiceManagersReturns the grid service container added event manager allowing to add and removeGridServiceManagerRemovedEventListeners.- Specified by:
getGridServiceManagerRemovedin interfaceGridServiceManagers
-
getManagers
Description copied from interface:GridServiceManagersReturns all the currently discovered managers.- Specified by:
getManagersin interfaceGridServiceManagers
-
getManagersNonFiltered
- Specified by:
getManagersNonFilteredin interfaceInternalGridServiceManagers
-
getManagerByUID
Description copied from interface:GridServiceManagersReturns a manager based on its uid.- Specified by:
getManagerByUIDin interfaceGridServiceManagers- See Also:
-
getUids
Description copied from interface:GridServiceManagersReturns a map of grid service manager with the key as the uid.- Specified by:
getUidsin interfaceGridServiceManagers
-
getSize
public int getSize()Description copied from interface:GridServiceManagersReturns the number of managers current discovered.- Specified by:
getSizein interfaceGridServiceManagers
-
isEmpty
public boolean isEmpty()Description copied from interface:GridServiceManagersReturnstrueif there are no managers,falseotherwise.- Specified by:
isEmptyin interfaceGridServiceManagers
-
waitForAtLeastOne
Description copied from interface:GridServiceManagersWaits indefinitely till at least one GSM is discovered and returns it.- Specified by:
waitForAtLeastOnein interfaceGridServiceManagers
-
waitForActiveManager
- Specified by:
waitForActiveManagerin interfaceGridServiceManagers- Returns:
- the managing instance or
nullif non available in the default time-out.
-
waitForActiveManager
- Specified by:
waitForActiveManagerin interfaceGridServiceManagers- Returns:
- the managing instance or
nullif non available in the specified time-out
-
waitForAtLeastOne
Description copied from interface:GridServiceManagersWaits for the given timeout (in time unit) till at least one GSM is discovered and returns it.- Specified by:
waitForAtLeastOnein interfaceGridServiceManagers
-
waitFor
public boolean waitFor(int numberOfGridServiceManagers) Description copied from interface:GridServiceManagersWaits indefinitely till the provided number of managers are up. When passing 0, will wait till there are no more managers.- Specified by:
waitForin interfaceGridServiceManagers- Parameters:
numberOfGridServiceManagers- The number of managers to wait for
-
waitFor
Description copied from interface:GridServiceManagersWaits for the given timeout (in time unit) till the provided number of managers are up. Returnstrueif the required number of managers were discovered,falseif the timeout expired.When passing 0, will wait till there are no more managers.
- Specified by:
waitForin interfaceGridServiceManagers- Parameters:
numberOfGridServiceManagers- The number of managers to wait for
-
deploy
Description copied from interface:GridServiceManagersDeploys a processing unit based on the processing unit deployment information on a random grid service manager (it will act as the primary GSM for the deployed processing unit).The deployment process will wait indefinitely and return the actual processing unit that can be used.
- Specified by:
deployin interfaceGridServiceManagers
-
deploy
Description copied from interface:GridServiceManagersDeploys a processing unit based on the processing unit deployment information on a random grid service manager (it will act as the primary GSM for the deployed processing unit).The deployment process will wait for the given timeout and return the actual processing unit that can be used.
- Specified by:
deployin interfaceGridServiceManagers
-
deploy
Description copied from interface:GridServiceManagersDeploys a space based on the space deployment information on a random grid service manager (it will act as the primary GSM for the deployed processing unit).The deployment process will wait indefinitely and return the actual processing unit that can be used.
Note, deploying just a space is simply deploying a built in processing unit that starts just an embedded space.
- Specified by:
deployin interfaceGridServiceManagers
-
deploy
Description copied from interface:GridServiceManagersDeploys a space based on the space deployment information on a random grid service manager (it will act as the primary GSM for the deployed processing unit).The deployment process will wait for the provided timeout and return the actual processing unit that can be used.
Note, deploying just a space is simply deploying a built in processing unit that starts just an embedded space.
- Specified by:
deployin interfaceGridServiceManagers
-
deploy
public Application deploy(ApplicationDeployment deployment) throws ApplicationAlreadyDeployedException, ProcessingUnitAlreadyDeployedException Description copied from interface:GridServiceManagersDeploys an application consisting of one or more processing unit deployments.The deployment process will wait indefinitely
- Specified by:
deployin interfaceGridServiceManagers- Returns:
- An application containing the actual processing units that can be used.
- Throws:
ApplicationAlreadyDeployedException- - Application with the same name has already been deployed.ProcessingUnitAlreadyDeployedException- - Processing unit with the same name has already been deployed. Processing Unit names are globally unique (regardless of the application name)
-
deploy
public Application deploy(ApplicationDeployment deployment, long timeout, TimeUnit timeUnit) throws ApplicationAlreadyDeployedException, ProcessingUnitAlreadyDeployedException Description copied from interface:GridServiceManagersDeploys an application consisting of one or more processing unit deployments.The deployment process will wait for the given timeout
- Specified by:
deployin interfaceGridServiceManagers- Returns:
- An application containing the actual processing units that can be used or null if timeout expired.
- Throws:
ApplicationAlreadyDeployedException- - Application with the same name has already been deployed.ProcessingUnitAlreadyDeployedException- - Processing unit with the same name has already been deployed. Processing Unit names are globally unique (regardless of the application name)
-
addLifecycleListener
Description copied from interface:GridServiceManagersAllows to add aGridServiceManagerLifecycleEventListener.- Specified by:
addLifecycleListenerin interfaceGridServiceManagers
-
removeLifecycleListener
Description copied from interface:GridServiceManagersAllows to remove aGridServiceManagerLifecycleEventListener.- Specified by:
removeLifecycleListenerin interfaceGridServiceManagers
-
iterator
- Specified by:
iteratorin interfaceIterable<GridServiceManager>
-
addGridServiceManager
- Specified by:
addGridServiceManagerin interfaceInternalGridServiceManagers
-
removeGridServiceManager
- Specified by:
removeGridServiceManagerin interfaceInternalGridServiceManagers
-
replaceGridServiceManager
public InternalGridServiceManager replaceGridServiceManager(InternalGridServiceManager gridServiceManager) Description copied from interface:InternalGridServiceManagersReplaces the grid service manager, returning the old one- Specified by:
replaceGridServiceManagerin interfaceInternalGridServiceManagers
-
generateDump
Description copied from interface:DumpProviderGenerates dump for all the provided dump processors. Note, this will include a heap dump which can consume time and potentially be of very large size- Specified by:
generateDumpin interfaceDumpProvider- Parameters:
cause- The cause that this dump was generatedcontext- Allows to provide specific parameters to specific processors- Throws:
AdminException
-
generateDump
public DumpResult generateDump(String cause, Map<String, Object> context, String... processor) throws AdminExceptionDescription copied from interface:DumpProviderGenerates dump for the provided processors. The current list of processors include:- summary: General summary information of the process.
- network: Information on the network layer of the process and the OS network stats.
- thread: Thread dump of the process.
- heap: Heap dump of the process. Note, this is a heavy operation and can produce very large dump files
- log: Adds all the log files of the process to the dump file.
- processingUnits: Dump of all the processing units (applicable only for GSCs) information.
- Specified by:
generateDumpin interfaceDumpProvider- Parameters:
cause- The cause this dump was generated.context- Allows to provide specific parameters to specific processors.processor- The list of processors to be used.- Throws:
AdminException
-
deploy
public ProcessingUnit deploy(Application application, ProcessingUnitDeploymentTopology puDeploymentTopology, long timeout, TimeUnit timeUnit) - Specified by:
deployin interfaceInternalGridServiceManagers
-
deploy
Description copied from interface:GridServiceManagersDeploys an application consisting of one or more processing unit deployments.The deployment process will wait indefinitely
- Specified by:
deployin interfaceGridServiceManagers- Returns:
- An application containing the actual processing units that can be used.
-
deploy
public Application deploy(ApplicationConfig applicationConfig, long timeout, TimeUnit timeUnit) throws ApplicationAlreadyDeployedException, ProcessingUnitAlreadyDeployedException Description copied from interface:GridServiceManagersDeploys an application consisting of one or more processing unit deployments.The deployment process will wait for the given timeout
- Specified by:
deployin interfaceGridServiceManagers- Returns:
- An application configuration containing the actual processing units that can be used or null if timeout expired.
- Throws:
ApplicationAlreadyDeployedException- - Application with the same name has already been deployed.ProcessingUnitAlreadyDeployedException- - Processing unit with the same name has already been deployed. Processing Unit names are globally unique (regardless of the application name)
-