public class DefaultElasticServiceManagers extends Object implements InternalElasticServiceManagers
Constructor and Description |
---|
DefaultElasticServiceManagers(InternalAdmin admin) |
Modifier and Type | Method and Description |
---|---|
void |
addElasticServiceManager(InternalElasticServiceManager elasticServiceManager) |
void |
addLifecycleListener(ElasticServiceManagerLifecycleEventListener eventListener)
Allows to add a
ElasticServiceManagerLifecycleEventListener . |
protected void |
assertStateChangesPermitted() |
DumpResult |
generateDump(String cause,
Map<String,Object> context)
Generates dump for all the provided dump processors.
|
DumpResult |
generateDump(String cause,
Map<String,Object> context,
String... processor)
Generates dump for the provided processors.
|
Admin |
getAdmin()
Returns the
Admin associated with this element. |
ElasticServiceManagerAddedEventManager |
getElasticServiceManagerAdded()
Returns the grid service manager added event manager allowing to add and remove
GridServiceManagerAddedEventListener s. |
ElasticServiceManagerRemovedEventManager |
getElasticServiceManagerRemoved()
Returns the grid service container added event manager allowing to add and remove
GridServiceManagerRemovedEventListener s. |
ElasticServiceManager |
getManagerByUID(String uid)
Returns a manager based on its uid.
|
ElasticServiceManager[] |
getManagers()
Returns all the currently discovered managers.
|
ElasticServiceManager[] |
getManagersNonFiltered() |
int |
getSize()
Returns the number of managers currently discovered.
|
Map<String,ElasticServiceManager> |
getUids()
Returns a map of elastic service manager with the key as the uid.
|
boolean |
isEmpty()
Returns
true if there are no managers, false otherwise. |
Iterator<ElasticServiceManager> |
iterator() |
InternalElasticServiceManager |
removeElasticServiceManager(String uid) |
void |
removeLifecycleListener(ElasticServiceManagerLifecycleEventListener eventListener)
Allows to remove a
ElasticServiceManagerLifecycleEventListener . |
boolean |
waitFor(int numberOfElasticServiceManagers)
Waits indefinitely till the provided number of managers are up.
|
boolean |
waitFor(int numberOfElasticServiceManagers,
long timeout,
TimeUnit timeUnit)
Waits for the given timeout (in time unit) till the provided number of managers are up.
|
ElasticServiceManager |
waitForAtLeastOne()
Waits indefinitely till at least one ESM is discovered and returns it.
|
ElasticServiceManager |
waitForAtLeastOne(long timeout,
TimeUnit timeUnit)
Waits for the given timeout (in time unit) till at least one ESM is discovered and returns
it.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
hasElasticManager
forEach, spliterator
public DefaultElasticServiceManagers(InternalAdmin admin)
public Admin getAdmin()
AdminAware
Admin
associated with this element.getAdmin
in interface AdminAware
public ElasticServiceManager getManagerByUID(String uid)
ElasticServiceManagers
getManagerByUID
in interface ElasticServiceManagers
GridComponent.getUid()
public ElasticServiceManager[] getManagers()
ElasticServiceManagers
getManagers
in interface ElasticServiceManagers
public int getSize()
ElasticServiceManagers
getSize
in interface ElasticServiceManagers
public Map<String,ElasticServiceManager> getUids()
ElasticServiceManagers
getUids
in interface ElasticServiceManagers
public boolean isEmpty()
ElasticServiceManagers
true
if there are no managers, false
otherwise.isEmpty
in interface ElasticServiceManagers
public Iterator<ElasticServiceManager> iterator()
iterator
in interface Iterable<ElasticServiceManager>
public ElasticServiceManagerAddedEventManager getElasticServiceManagerAdded()
ElasticServiceManagers
GridServiceManagerAddedEventListener
s.getElasticServiceManagerAdded
in interface ElasticServiceManagers
public ElasticServiceManagerRemovedEventManager getElasticServiceManagerRemoved()
ElasticServiceManagers
GridServiceManagerRemovedEventListener
s.getElasticServiceManagerRemoved
in interface ElasticServiceManagers
public void addElasticServiceManager(InternalElasticServiceManager elasticServiceManager)
addElasticServiceManager
in interface InternalElasticServiceManagers
public InternalElasticServiceManager removeElasticServiceManager(String uid)
removeElasticServiceManager
in interface InternalElasticServiceManagers
public void addLifecycleListener(ElasticServiceManagerLifecycleEventListener eventListener)
ElasticServiceManagers
ElasticServiceManagerLifecycleEventListener
.addLifecycleListener
in interface ElasticServiceManagers
public void removeLifecycleListener(ElasticServiceManagerLifecycleEventListener eventListener)
ElasticServiceManagers
ElasticServiceManagerLifecycleEventListener
.removeLifecycleListener
in interface ElasticServiceManagers
public boolean waitFor(int numberOfElasticServiceManagers)
ElasticServiceManagers
waitFor
in interface ElasticServiceManagers
numberOfElasticServiceManagers
- The number of managers to wait forpublic boolean waitFor(int numberOfElasticServiceManagers, long timeout, TimeUnit timeUnit)
ElasticServiceManagers
true
if the required number of managers were discovered,
false
if the timeout expired.
When passing 0, will wait till there are no more managers.
waitFor
in interface ElasticServiceManagers
numberOfElasticServiceManagers
- The number of managers to wait forpublic ElasticServiceManager waitForAtLeastOne()
ElasticServiceManagers
waitForAtLeastOne
in interface ElasticServiceManagers
public ElasticServiceManager waitForAtLeastOne(long timeout, TimeUnit timeUnit)
ElasticServiceManagers
waitForAtLeastOne
in interface ElasticServiceManagers
public DumpResult generateDump(String cause, Map<String,Object> context) throws AdminException
DumpProvider
generateDump
in interface DumpProvider
cause
- The cause that this dump was generatedcontext
- Allows to provide specific parameters to specific processorsAdminException
public DumpResult generateDump(String cause, Map<String,Object> context, String... processor) throws AdminException
DumpProvider
generateDump
in interface DumpProvider
cause
- The cause this dump was generated.context
- Allows to provide specific parameters to specific processors.processor
- The list of processors to be used.AdminException
protected void assertStateChangesPermitted()
public ElasticServiceManager[] getManagersNonFiltered()
getManagersNonFiltered
in interface InternalElasticServiceManagers
Copyright © GigaSpaces.