Package org.openspaces.admin.gsa
Interface GridServiceAgents
- All Superinterfaces:
AdminAware,DumpProvider,Iterable<GridServiceAgent>
- All Known Subinterfaces:
InternalGridServiceAgents
- All Known Implementing Classes:
DefaultGridServiceAgents
Grid Service Agents hold all the different
GridServiceAgent that are currently
discovered.
Provides simple means to get all the current agents, as well as as registering for agent lifecycle (added and removed) events.
- Author:
- kimchy
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddLifecycleListener(GridServiceAgentLifecycleEventListener eventListener) Allows to add aGridServiceAgentLifecycleEventListener.getAgentByUID(String uid) Returns an agent based on its uid.Returns all the currently discovered agents.Returns the grid service agent added event manager allowing to add and removeGridServiceAgentAddedEventListeners.Returns the grid service agent added event manager allowing to add and removeGridServiceAgentRemovedEventListeners.Returns a map of grid service agent with the key as the host address it is running on.Returns a map of grid service agent with the key as the host name it is running on.intgetSize()Returns the number of agents current discovered.getUids()Returns a map of grid service agent with the key as the uid.booleanisEmpty()Returnstrueif there are no agents,falseotherwise.voidremoveLifecycleListener(GridServiceAgentLifecycleEventListener eventListener) Allows to remove aGridServiceAgentLifecycleEventListener.booleanwaitFor(int numberOfAgents) Waits indefinitely till the provided number of agents are up.booleanWaits for the given timeout (in time unit) till the provided number of agents are up.Waits indefinitely till at least one agent is discovered.waitForAtLeastOne(long timeout, TimeUnit timeUnit) Waits for the given timeout (in time unit) till at least one agent is discovered.Methods inherited from interface org.openspaces.admin.AdminAware
getAdminMethods inherited from interface org.openspaces.admin.dump.DumpProvider
generateDump, generateDumpMethods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
getAgents
GridServiceAgent[] getAgents()Returns all the currently discovered agents. -
getAgentByUID
Returns an agent based on its uid.- See Also:
-
getUids
Map<String,GridServiceAgent> getUids()Returns a map of grid service agent with the key as the uid. -
getHostAddress
Map<String,GridServiceAgent> getHostAddress()Returns a map of grid service agent with the key as the host address it is running on. -
getHostNames
Map<String,GridServiceAgent> getHostNames()Returns a map of grid service agent with the key as the host name it is running on. -
getSize
int getSize()Returns the number of agents current discovered. -
isEmpty
boolean isEmpty()Returnstrueif there are no agents,falseotherwise. -
waitForAtLeastOne
GridServiceAgent waitForAtLeastOne()Waits indefinitely till at least one agent is discovered. -
waitForAtLeastOne
Waits for the given timeout (in time unit) till at least one agent is discovered. -
waitFor
boolean waitFor(int numberOfAgents) Waits indefinitely till the provided number of agents are up.- Parameters:
numberOfAgents- The number of agents to wait for
-
waitFor
Waits for the given timeout (in time unit) till the provided number of agents are up.- Parameters:
numberOfAgents- The number of agents to wait for
-
getGridServiceAgentAdded
GridServiceAgentAddedEventManager getGridServiceAgentAdded()Returns the grid service agent added event manager allowing to add and removeGridServiceAgentAddedEventListeners. -
getGridServiceAgentRemoved
GridServiceAgentRemovedEventManager getGridServiceAgentRemoved()Returns the grid service agent added event manager allowing to add and removeGridServiceAgentRemovedEventListeners. -
addLifecycleListener
Allows to add aGridServiceAgentLifecycleEventListener. -
removeLifecycleListener
Allows to remove aGridServiceAgentLifecycleEventListener.
-