GigaSpaces XAP 7.0 API

org.openspaces.admin.gsa
Interface GridServiceAgents

All Superinterfaces:
AdminAware, Iterable<GridServiceAgent>

public interface GridServiceAgents
extends AdminAware, Iterable<GridServiceAgent>

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
 void addLifecycleListener(GridServiceAgentLifecycleEventListener eventListener)
          Allows to add a GridServiceAgentLifecycleEventListener.
 GridServiceAgent getAgentByUID(String uid)
          Returns an agent based on its uid.
 GridServiceAgent[] getAgents()
          Returns all the currently discovered agents.
 GridServiceAgentAddedEventManager getGridServiceAgentAdded()
          Returns the grid service agent added event manager allowing to add and remove GridServiceAgentAddedEventListeners.
 GridServiceAgentRemovedEventManager getGridServiceAgentRemoved()
          Returns the grid service agent added event manager allowing to add and remove GridServiceAgentRemovedEventListeners.
 Map<String,GridServiceAgent> getHostAddress()
          Returns a map of grid service agent with the key as the host address it is running on.
 Map<String,GridServiceAgent> getHostNames()
          Returns a map of grid service agent with the key as the host name it is running on.
 int getSize()
          Returns the number of agents current discovered.
 Map<String,GridServiceAgent> getUids()
          Returns a map of grid service agent with the key as the uid.
 boolean isEmpty()
          Returns true if there are no agents, false otherwise.
 void removeLifecycleListener(GridServiceAgentLifecycleEventListener eventListener)
          Allows to remove a GridServiceAgentLifecycleEventListener.
 boolean waitFor(int numberOfAgents)
          Waits indefinitely till the provided number of agents are up.
 boolean waitFor(int numberOfAgents, long timeout, TimeUnit timeUnit)
          Waits for the given timeout (in time unit) till the provided number of agents are up.
 GridServiceAgent waitForAtLeastOne()
          Waits indefinitely till at least one agent is discovered.
 GridServiceAgent 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
getAdmin
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

getAgents

GridServiceAgent[] getAgents()
Returns all the currently discovered agents.


getAgentByUID

GridServiceAgent getAgentByUID(String uid)
Returns an agent based on its uid.

See Also:
GridComponent.getUid()

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()
Returns true if there are no agents, false otherwise.


waitForAtLeastOne

GridServiceAgent waitForAtLeastOne()
Waits indefinitely till at least one agent is discovered.


waitForAtLeastOne

GridServiceAgent waitForAtLeastOne(long timeout,
                                   TimeUnit timeUnit)
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

boolean waitFor(int numberOfAgents,
                long timeout,
                TimeUnit timeUnit)
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 remove GridServiceAgentAddedEventListeners.


getGridServiceAgentRemoved

GridServiceAgentRemovedEventManager getGridServiceAgentRemoved()
Returns the grid service agent added event manager allowing to add and remove GridServiceAgentRemovedEventListeners.


addLifecycleListener

void addLifecycleListener(GridServiceAgentLifecycleEventListener eventListener)
Allows to add a GridServiceAgentLifecycleEventListener.


removeLifecycleListener

void removeLifecycleListener(GridServiceAgentLifecycleEventListener eventListener)
Allows to remove a GridServiceAgentLifecycleEventListener.


GigaSpaces XAP 7.0 API

Copyright © GigaSpaces.