public interface Machines extends AdminAware, Iterable<Machine>
Machines that are currently discovered. Provides simple means to get all the current machines, as well as as registering for machine lifecycle (added and removed) events.
| Modifier and Type | Method and Description |
|---|---|
void |
addLifecycleListener(MachineLifecycleEventListener eventListener)
Allows to add a
MachineLifecycleEventListener. |
ElasticMachineProvisioningFailureEventManager |
getElasticMachineProvisioningFailure()
Returns the elastic machine provisioning failure event manager allowing to add and remove
ElasticMachineProvisioningFailureEventListeners. |
ElasticMachineProvisioningProgressChangedEventManager |
getElasticMachineProvisioningProgressChanged()
Returns the elastic machine provisioning failure event manager allowing to add and remove
ElasticMachineProvisioningProgressChangedEventListeners. |
Map<String,Machine> |
getHostsByAddress()
Returns a map of machines by host address.
|
Map<String,Machine> |
getHostsByName()
Returns a map of machines by host names.
|
MachineAddedEventManager |
getMachineAdded()
Returns the machines added event manager allowing to add and remove
MachineAddedEventListeners. |
Machine |
getMachineByHostAddress(String hostAddress)
Returns the machine by the host address.
|
Machine |
getMachineByHostName(String hostName)
Returns the machine by the host name.
|
MachineRemovedEventManager |
getMachineRemoved()
Returns the grid service container added event manager allowing to add and remove
MachineRemovedEventListeners. |
Machine[] |
getMachines()
Returns all currently discovered machines.
|
int |
getSize()
Returns the number of machines current discovered.
|
Map<String,Machine> |
getUids()
Returns a map of machines with the key as the uid.
|
boolean |
isEmpty()
Returns
true if there are no machines, false otherwise. |
void |
removeLifeycleListener(MachineLifecycleEventListener eventListener)
Allows to remove a
MachineLifecycleEventListener. |
boolean |
waitFor(int numberOfMachines)
Waits indefinitely till the provided number of machines are up.
|
boolean |
waitFor(int numberOfMachines,
long timeout,
TimeUnit timeUnit)
Waits for the given timeout (in time unit) till the provided number of machines are up.
|
Machine |
waitFor(String host)
Waits indefinitely till the machine with the given host (name/address) is discovered.
|
Machine |
waitFor(String host,
long timeout,
TimeUnit timeUnit)
Waits for the given timeout (in time unit) till the machien with the given host
(name/address) is discovered.
|
getAdminforEach, iterator, spliteratorMachine[] getMachines()
Machine getMachineByHostAddress(String hostAddress)
hostAddress - The host address to lookup the machine bynull if there is
no oneMachine getMachineByHostName(String hostName)
Map<String,Machine> getHostsByAddress()
int getSize()
boolean isEmpty()
true if there are no machines, false otherwise.boolean waitFor(int numberOfMachines)
numberOfMachines - The number of containers to wait forboolean waitFor(int numberOfMachines,
long timeout,
TimeUnit timeUnit)
true if the required number of machines were discovered,
false if the timeout expired.numberOfMachines - The number of containers to wait forMachine waitFor(String host)
host - The machine host name or addressMachine waitFor(String host, long timeout, TimeUnit timeUnit)
null if the machine was not discovered.host - The machine host name or addresstimeout - The timeout value to waittimeUnit - The time unit of the timeout valuenull if it was not discovered within the
provided timeoutMachineAddedEventManager getMachineAdded()
MachineAddedEventListeners.MachineRemovedEventManager getMachineRemoved()
MachineRemovedEventListeners.void addLifecycleListener(MachineLifecycleEventListener eventListener)
MachineLifecycleEventListener.void removeLifeycleListener(MachineLifecycleEventListener eventListener)
MachineLifecycleEventListener.ElasticMachineProvisioningFailureEventManager getElasticMachineProvisioningFailure()
ElasticMachineProvisioningFailureEventListeners.ElasticMachineProvisioningProgressChangedEventManager getElasticMachineProvisioningProgressChanged()
ElasticMachineProvisioningProgressChangedEventListeners.Copyright © GigaSpaces.