public class DefaultVirtualMachines extends Object implements InternalVirtualMachines
DEFAULT_HISTORY_SIZE, DEFAULT_MONITOR_INTERVAL
Constructor and Description |
---|
DefaultVirtualMachines(InternalAdmin admin) |
Modifier and Type | Method and Description |
---|---|
void |
addLifecycleListener(VirtualMachineLifecycleEventListener eventListener)
Allows to add a
VirtualMachineLifecycleEventListener . |
void |
addVirtualMachine(VirtualMachine virtualMachine) |
Admin |
getAdmin()
Returns the
Admin associated with this element. |
VirtualMachinesDetails |
getDetails()
Returns the aggregated details of all virtual machines.
|
int |
getSize()
Returns the number of virtual machines current discovered.
|
VirtualMachinesStatistics |
getStatistics()
Returns the aggregated statistics of all virtual machines.
|
VirtualMachinesStatisticsChangedEventManager |
getStatisticsChanged()
Returns a virtual machines statistics change event manager allowing to register for events of
VirtualMachinesStatisticsChangedEvent . |
Map<String,VirtualMachine> |
getUids()
Returns a map of virtual machines with the key as the uid.
|
VirtualMachineAddedEventManager |
getVirtualMachineAdded()
Returns the virtual machine added event manager allowing to add and remove
VirtualMachineAddedEventListener s. |
VirtualMachine |
getVirtualMachineByUID(String uid)
Return a virtual machine by its uid.
|
VirtualMachineRemovedEventManager |
getVirtualMachineRemoved()
Returns the virtual machine removed event manager allowing to add and remove
VirtualMachineRemovedEventListener s. |
VirtualMachine[] |
getVirtualMachines()
Returns the currently discovered virtual machines.
|
VirtualMachineStatisticsChangedEventManager |
getVirtualMachineStatisticsChanged()
Returns a virtual machine statistics change event manger allowing to register for events of
VirtualMachineStatisticsChangedEvent . |
boolean |
isEmpty()
Returns
true if there are no virtual machines, false otherwise. |
boolean |
isMonitoring()
Returns
true if statistics are now being monitored. |
Iterator<VirtualMachine> |
iterator() |
void |
removeLifecycleListener(VirtualMachineLifecycleEventListener eventListener)
Allows to remove a
VirtualMachineLifecycleEventListener . |
InternalVirtualMachine |
removeVirtualMachine(String uid) |
void |
setStatisticsHistorySize(int historySize)
Sets the history size of number of statistics stored.
|
void |
setStatisticsInterval(long interval,
TimeUnit timeUnit)
Sets the statistics interval, automatically updating the monitoring scheduled tasks if
monitoring is enabled.
|
void |
startStatisticsMonitor()
Starts the statistics monitor, starting a scheduled monitor that polls for statistics.
|
void |
stopStatisticsMonitor()
Stops the statistics monitor.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public DefaultVirtualMachines(InternalAdmin admin)
public Admin getAdmin()
AdminAware
Admin
associated with this element.getAdmin
in interface AdminAware
public VirtualMachineAddedEventManager getVirtualMachineAdded()
VirtualMachines
VirtualMachineAddedEventListener
s.getVirtualMachineAdded
in interface VirtualMachines
public VirtualMachineRemovedEventManager getVirtualMachineRemoved()
VirtualMachines
VirtualMachineRemovedEventListener
s.getVirtualMachineRemoved
in interface VirtualMachines
public VirtualMachineStatisticsChangedEventManager getVirtualMachineStatisticsChanged()
VirtualMachines
VirtualMachineStatisticsChangedEvent
.
Note, in order to receive events, the virtual machines need to be in a "statistics" monitored state.
getVirtualMachineStatisticsChanged
in interface VirtualMachines
public VirtualMachinesStatisticsChangedEventManager getStatisticsChanged()
VirtualMachines
VirtualMachinesStatisticsChangedEvent
.
Note, in order to receive events, the virtual machines need to be in a "statistics" monitored state.
getStatisticsChanged
in interface VirtualMachines
public VirtualMachine[] getVirtualMachines()
VirtualMachines
getVirtualMachines
in interface VirtualMachines
public Iterator<VirtualMachine> iterator()
iterator
in interface Iterable<VirtualMachine>
public int getSize()
VirtualMachines
getSize
in interface VirtualMachines
public boolean isEmpty()
VirtualMachines
true
if there are no virtual machines, false
otherwise.isEmpty
in interface VirtualMachines
public VirtualMachinesStatistics getStatistics()
VirtualMachines
getStatistics
in interface VirtualMachines
public VirtualMachinesDetails getDetails()
VirtualMachines
getDetails
in interface VirtualMachines
public void setStatisticsInterval(long interval, TimeUnit timeUnit)
StatisticsMonitor
setStatisticsInterval
in interface StatisticsMonitor
public void setStatisticsHistorySize(int historySize)
StatisticsMonitor
setStatisticsHistorySize
in interface StatisticsMonitor
public void startStatisticsMonitor()
StatisticsMonitor
startStatisticsMonitor
in interface StatisticsMonitor
public void stopStatisticsMonitor()
StatisticsMonitor
stopStatisticsMonitor
in interface StatisticsMonitor
public boolean isMonitoring()
StatisticsMonitor
true
if statistics are now being monitored.isMonitoring
in interface StatisticsMonitor
public void addLifecycleListener(VirtualMachineLifecycleEventListener eventListener)
VirtualMachines
VirtualMachineLifecycleEventListener
.addLifecycleListener
in interface VirtualMachines
public void removeLifecycleListener(VirtualMachineLifecycleEventListener eventListener)
VirtualMachines
VirtualMachineLifecycleEventListener
.removeLifecycleListener
in interface VirtualMachines
public VirtualMachine getVirtualMachineByUID(String uid)
VirtualMachines
getVirtualMachineByUID
in interface VirtualMachines
public Map<String,VirtualMachine> getUids()
VirtualMachines
getUids
in interface VirtualMachines
public void addVirtualMachine(VirtualMachine virtualMachine)
addVirtualMachine
in interface InternalVirtualMachines
public InternalVirtualMachine removeVirtualMachine(String uid)
removeVirtualMachine
in interface InternalVirtualMachines
Copyright © GigaSpaces.