GigaSpaces XAP 7.0 API

org.openspaces.admin.space
Interface Spaces

All Superinterfaces:
AdminAware, Iterable<Space>, StatisticsMonitor

public interface Spaces
extends Iterable<Space>, AdminAware, StatisticsMonitor

Spaces holds all the currently discovered Spaces.

Provides simple means to get all the current Space, as well as as registering for Space lifecycle (added and removed) events.

Provides the ability to start a statistics monitor on all current Space using StatisticsMonitor.startStatisticsMonitor(). Newly discovered Space will automatically use the statistics monitor as well.

Author:
kimchy

Field Summary
 
Fields inherited from interface org.openspaces.admin.StatisticsMonitor
DEFAULT_HISTORY_SIZE, DEFAULT_MONITOR_INTERVAL
 
Method Summary
 void addLifecycleListener(SpaceInstanceLifecycleEventListener eventListener)
          Allows to add a SpaceInstanceLifecycleEventListener hthat will be called for any space instance discovered.
 void addLifecycleListener(SpaceLifecycleEventListener eventListener)
          Adds a SpaceLifecycleEventListener to be notified when a Space is added and removed.
 Map<String,Space> getNames()
          Returns a map of Spaces keyed by their names.
 ReplicationStatusChangedEventManager getReplicationStatusChanged()
          Returns an event manager allowing to globally register for ReplicationStatusChangedEvents that happen on any Space instance currently discovered.
 SpaceAddedEventManager getSpaceAdded()
          Returns an event manager allowing to add SpaceAddedEventListeners.
 Space getSpaceByName(String name)
          Returns a space based on its name.
 Space getSpaceByUID(String uid)
          Returns a space based on its uid.
 SpaceInstanceAddedEventManager getSpaceInstanceAdded()
          Returns an event manager allowing to globally add SpaceInstanceAddedEventListener that will be called for any space instance discovered.
 SpaceInstanceRemovedEventManager getSpaceInstanceRemoved()
          Returns an event manager allowing to globally remove SpaceInstanceAddedEventListener that will be called for any space instance discovered.
 SpaceInstanceStatisticsChangedEventManager getSpaceInstanceStatisticsChanged()
          Returns an event manager allowing to register for SpaceInstanceStatisticsChangedEvents that occur on all the currently discovered SpaceInstances.
 SpaceModeChangedEventManager getSpaceModeChanged()
          Returns an event manager allowing to globally register for SpaceModeChangedEvents that happen on any Space instance currently discovered.
 SpaceRemovedEventManager getSpaceRemoved()
          Returns an event manager allowing to remove SpaceAddedEventListeners.
 Space[] getSpaces()
          Returns all the currently discovered Spaces.
 SpaceStatisticsChangedEventManager getSpaceStatisticsChanged()
          Returns an event manager allowing to register for SpaceStatisticsChangedEvents that occur on all the currently discovered Spaces.
 void removeLifecycleListener(SpaceInstanceLifecycleEventListener eventListener)
          Allows to remove a SpaceInstanceLifecycleEventListener hthat will be called for any space instance discovered.
 void removeLifecycleListener(SpaceLifecycleEventListener eventListener)
          Removes a SpaceLifecycleEventListener to be notified when a Space is added and removed.
 Space waitFor(String spaceName)
          Waits indefinitely till the provided Space name is discovered.
 Space waitFor(String spaceName, long timeout, TimeUnit timeUnit)
          Waits for the given timeout (in time unit) till the space name is discovered.
 
Methods inherited from interface java.lang.Iterable
iterator
 
Methods inherited from interface org.openspaces.admin.AdminAware
getAdmin
 
Methods inherited from interface org.openspaces.admin.StatisticsMonitor
isMonitoring, setStatisticsHistorySize, setStatisticsInterval, startStatisticsMonitor, stopStatisticsMontior
 

Method Detail

getSpaces

Space[] getSpaces()
Returns all the currently discovered Spaces.


getSpaceByUID

Space getSpaceByUID(String uid)
Returns a space based on its uid.


getSpaceByName

Space getSpaceByName(String name)
Returns a space based on its name.


getNames

Map<String,Space> getNames()
Returns a map of Spaces keyed by their names.


waitFor

Space waitFor(String spaceName)
Waits indefinitely till the provided Space name is discovered.

Parameters:
spaceName - The space name to wait for

waitFor

Space waitFor(String spaceName,
              long timeout,
              TimeUnit timeUnit)
Waits for the given timeout (in time unit) till the space name is discovered. Returns true if the space is discovered, false if the timeout expired.


getSpaceAdded

SpaceAddedEventManager getSpaceAdded()
Returns an event manager allowing to add SpaceAddedEventListeners.


getSpaceRemoved

SpaceRemovedEventManager getSpaceRemoved()
Returns an event manager allowing to remove SpaceAddedEventListeners.


addLifecycleListener

void addLifecycleListener(SpaceLifecycleEventListener eventListener)
Adds a SpaceLifecycleEventListener to be notified when a Space is added and removed.


removeLifecycleListener

void removeLifecycleListener(SpaceLifecycleEventListener eventListener)
Removes a SpaceLifecycleEventListener to be notified when a Space is added and removed.


getSpaceInstanceAdded

SpaceInstanceAddedEventManager getSpaceInstanceAdded()
Returns an event manager allowing to globally add SpaceInstanceAddedEventListener that will be called for any space instance discovered.


getSpaceInstanceRemoved

SpaceInstanceRemovedEventManager getSpaceInstanceRemoved()
Returns an event manager allowing to globally remove SpaceInstanceAddedEventListener that will be called for any space instance discovered.


addLifecycleListener

void addLifecycleListener(SpaceInstanceLifecycleEventListener eventListener)
Allows to add a SpaceInstanceLifecycleEventListener hthat will be called for any space instance discovered.


removeLifecycleListener

void removeLifecycleListener(SpaceInstanceLifecycleEventListener eventListener)
Allows to remove a SpaceInstanceLifecycleEventListener hthat will be called for any space instance discovered.


getSpaceModeChanged

SpaceModeChangedEventManager getSpaceModeChanged()
Returns an event manager allowing to globally register for SpaceModeChangedEvents that happen on any Space instance currently discovered.


getReplicationStatusChanged

ReplicationStatusChangedEventManager getReplicationStatusChanged()
Returns an event manager allowing to globally register for ReplicationStatusChangedEvents that happen on any Space instance currently discovered.


getSpaceStatisticsChanged

SpaceStatisticsChangedEventManager getSpaceStatisticsChanged()
Returns an event manager allowing to register for SpaceStatisticsChangedEvents that occur on all the currently discovered Spaces.

Note, StatisticsMonitor.startStatisticsMonitor() must be called in order to start monitor statistics.


getSpaceInstanceStatisticsChanged

SpaceInstanceStatisticsChangedEventManager getSpaceInstanceStatisticsChanged()
Returns an event manager allowing to register for SpaceInstanceStatisticsChangedEvents that occur on all the currently discovered SpaceInstances.

Note, StatisticsMonitor.startStatisticsMonitor() must be called in order to start monitoring statistics.


GigaSpaces XAP 7.0 API

Copyright © GigaSpaces.