public class DefaultMachines extends Object implements InternalMachines
| Constructor and Description |
|---|
DefaultMachines(InternalAdmin admin) |
| Modifier and Type | Method and Description |
|---|---|
void |
addLifecycleListener(MachineLifecycleEventListener eventListener)
Allows to add a
MachineLifecycleEventListener. |
void |
addMachine(InternalMachine machine) |
Admin |
getAdmin()
Returns the
Admin associated with this element. |
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 ipAddress)
Returns the machine by the host address.
|
Machine |
getMachineByHostName(String hostName)
Returns the machine by the host name.
|
Machine |
getMachineByUID(String uid) |
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. |
Iterator<Machine> |
iterator() |
void |
removeLifeycleListener(MachineLifecycleEventListener eventListener)
Allows to remove a
MachineLifecycleEventListener. |
void |
removeMachine(Machine machine) |
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 hostAddress)
Waits indefinitely till the machine with the given host (name/address) is discovered.
|
Machine |
waitFor(String hostAddress,
long timeout,
TimeUnit timeUnit)
Waits for the given timeout (in time unit) till the machien with the given host
(name/address) is discovered.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic DefaultMachines(InternalAdmin admin)
public Admin getAdmin()
AdminAwareAdmin associated with this element.getAdmin in interface AdminAwarepublic Machine[] getMachines()
MachinesgetMachines in interface Machinespublic MachineAddedEventManager getMachineAdded()
MachinesMachineAddedEventListeners.getMachineAdded in interface Machinespublic MachineRemovedEventManager getMachineRemoved()
MachinesMachineRemovedEventListeners.getMachineRemoved in interface Machinespublic int getSize()
Machinespublic boolean isEmpty()
Machinestrue if there are no machines, false otherwise.public boolean waitFor(int numberOfMachines)
Machinespublic boolean waitFor(int numberOfMachines,
long timeout,
TimeUnit timeUnit)
Machinestrue if the required number of machines were discovered,
false if the timeout expired.public Machine waitFor(String hostAddress)
Machinespublic Machine waitFor(String hostAddress, long timeout, TimeUnit timeUnit)
Machinesnull if the machine was not discovered.public Machine getMachineByUID(String uid)
getMachineByUID in interface InternalMachinespublic Machine getMachineByHostAddress(String ipAddress)
MachinesgetMachineByHostAddress in interface MachinesipAddress - The host address to lookup the machine bynull if there is
no onepublic Machine getMachineByHostName(String hostName)
MachinesgetMachineByHostName in interface Machinespublic Map<String,Machine> getUids()
Machinespublic Map<String,Machine> getHostsByAddress()
MachinesgetHostsByAddress in interface Machinespublic Map<String,Machine> getHostsByName()
MachinesgetHostsByName in interface Machinespublic void addLifecycleListener(MachineLifecycleEventListener eventListener)
MachinesMachineLifecycleEventListener.addLifecycleListener in interface Machinespublic void removeLifeycleListener(MachineLifecycleEventListener eventListener)
MachinesMachineLifecycleEventListener.removeLifeycleListener in interface Machinespublic void addMachine(InternalMachine machine)
addMachine in interface InternalMachinespublic void removeMachine(Machine machine)
removeMachine in interface InternalMachinesCopyright © GigaSpaces.