public interface Spaces extends Iterable<Space>, AdminAware, StatisticsMonitor
Space
s.
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.
DEFAULT_HISTORY_SIZE, DEFAULT_MONITOR_INTERVAL
Modifier and Type | Method and Description |
---|---|
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
Space s keyed by their names. |
ReplicationStatusChangedEventManager |
getReplicationStatusChanged()
Returns an event manager allowing to globally register for
ReplicationStatusChangedEvent s
that happen on any Space instance currently discovered. |
SpaceAddedEventManager |
getSpaceAdded()
Returns an event manager allowing to add
SpaceAddedEventListener s. |
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
SpaceInstanceStatisticsChangedEvent s
that occur on all the currently discovered SpaceInstance s. |
SpaceModeChangedEventManager |
getSpaceModeChanged()
Returns an event manager allowing to globally register for
SpaceModeChangedEvent s
that happen on any Space instance currently discovered. |
SpaceRemovedEventManager |
getSpaceRemoved()
Returns an event manager allowing to remove
SpaceAddedEventListener s. |
Space[] |
getSpaces()
Returns all the currently discovered
Space s. |
SpaceStatisticsChangedEventManager |
getSpaceStatisticsChanged()
Returns an event manager allowing to register for
SpaceStatisticsChangedEvent s
that occur on all the currently discovered Space s. |
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.
|
forEach, iterator, spliterator
getAdmin
isMonitoring, setStatisticsHistorySize, setStatisticsInterval, startStatisticsMonitor, stopStatisticsMonitor
Space waitFor(String spaceName)
spaceName
- The space name to wait forSpace waitFor(String spaceName, long timeout, TimeUnit timeUnit)
true
if the space is discovered, false
if the timeout expired.SpaceAddedEventManager getSpaceAdded()
SpaceAddedEventListener
s.SpaceRemovedEventManager getSpaceRemoved()
SpaceAddedEventListener
s.void addLifecycleListener(SpaceLifecycleEventListener eventListener)
SpaceLifecycleEventListener
to be notified
when a Space
is added and removed.void removeLifecycleListener(SpaceLifecycleEventListener eventListener)
SpaceLifecycleEventListener
to be notified
when a Space
is added and removed.SpaceInstanceAddedEventManager getSpaceInstanceAdded()
SpaceInstanceAddedEventListener
that will be called for any space instance discovered.SpaceInstanceRemovedEventManager getSpaceInstanceRemoved()
SpaceInstanceAddedEventListener
that will be called for any space instance discovered.void addLifecycleListener(SpaceInstanceLifecycleEventListener eventListener)
SpaceInstanceLifecycleEventListener
hthat will be called
for any space instance discovered.void removeLifecycleListener(SpaceInstanceLifecycleEventListener eventListener)
SpaceInstanceLifecycleEventListener
hthat will be called
for any space instance discovered.SpaceModeChangedEventManager getSpaceModeChanged()
SpaceModeChangedEvent
s
that happen on any Space instance currently discovered.ReplicationStatusChangedEventManager getReplicationStatusChanged()
ReplicationStatusChangedEvent
s
that happen on any Space instance currently discovered.SpaceStatisticsChangedEventManager getSpaceStatisticsChanged()
SpaceStatisticsChangedEvent
s
that occur on all the currently discovered Space
s.
Note, StatisticsMonitor.startStatisticsMonitor()
must be called in order to start monitor statistics.
SpaceInstanceStatisticsChangedEventManager getSpaceInstanceStatisticsChanged()
SpaceInstanceStatisticsChangedEvent
s
that occur on all the currently discovered SpaceInstance
s.
Note, StatisticsMonitor.startStatisticsMonitor()
must be called in order to start monitoring statistics.
Copyright © GigaSpaces.