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
MachineAddedEventListener s. |
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
MachineRemovedEventListener s. |
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, wait
forEach, spliterator
public DefaultMachines(InternalAdmin admin)
public Admin getAdmin()
AdminAware
Admin
associated with this element.getAdmin
in interface AdminAware
public Machine[] getMachines()
Machines
getMachines
in interface Machines
public MachineAddedEventManager getMachineAdded()
Machines
MachineAddedEventListener
s.getMachineAdded
in interface Machines
public MachineRemovedEventManager getMachineRemoved()
Machines
MachineRemovedEventListener
s.getMachineRemoved
in interface Machines
public int getSize()
Machines
public boolean isEmpty()
Machines
true
if there are no machines, false
otherwise.public boolean waitFor(int numberOfMachines)
Machines
public boolean waitFor(int numberOfMachines, long timeout, TimeUnit timeUnit)
Machines
true
if the required number of machines were discovered,
false
if the timeout expired.public Machine waitFor(String hostAddress)
Machines
public Machine waitFor(String hostAddress, long timeout, TimeUnit timeUnit)
Machines
null
if the machine was not discovered.public Machine getMachineByUID(String uid)
getMachineByUID
in interface InternalMachines
public Machine getMachineByHostAddress(String ipAddress)
Machines
getMachineByHostAddress
in interface Machines
ipAddress
- The host address to lookup the machine bynull
if there is
no onepublic Machine getMachineByHostName(String hostName)
Machines
getMachineByHostName
in interface Machines
public Map<String,Machine> getUids()
Machines
public Map<String,Machine> getHostsByAddress()
Machines
getHostsByAddress
in interface Machines
public Map<String,Machine> getHostsByName()
Machines
getHostsByName
in interface Machines
public void addLifecycleListener(MachineLifecycleEventListener eventListener)
Machines
MachineLifecycleEventListener
.addLifecycleListener
in interface Machines
public void removeLifeycleListener(MachineLifecycleEventListener eventListener)
Machines
MachineLifecycleEventListener
.removeLifeycleListener
in interface Machines
public void addMachine(InternalMachine machine)
addMachine
in interface InternalMachines
public void removeMachine(Machine machine)
removeMachine
in interface InternalMachines
Copyright © GigaSpaces.