Package org.openspaces.admin.internal.pu
Class DefaultProcessingUnits
java.lang.Object
org.openspaces.admin.internal.pu.DefaultProcessingUnits
- All Implemented Interfaces:
Iterable<ProcessingUnit>,AdminAware,InternalProcessingUnitInstancesAware,InternalProcessingUnits,ProcessingUnits,StatisticsMonitor
- Author:
- kimchy
-
Field Summary
Fields inherited from interface org.openspaces.admin.StatisticsMonitor
DEFAULT_HISTORY_SIZE, DEFAULT_MONITOR_INTERVAL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLifecycleListener(ProcessingUnitInstanceLifecycleEventListener eventListener) Allows to add aProcessingUnitInstanceLifecycleEventListener.voidaddLifecycleListener(ProcessingUnitLifecycleEventListener eventListener) Allows to add aProcessingUnitLifecycleEventListener.voidaddProcessingUnit(ProcessingUnit processingUnit) getAdmin()Returns theAdminassociated with this element.Returns an event manager allowing to globally register for anyBackupGridServiceManagerChangedEvents occurring on any processing unit.Returns an event manager allowing to globally register for anyManagingGridServiceManagerChangedEvents occurring on any processing unit.getNames()Returns a map ofProcessingUnitkeyed by their respective names.getProcessingUnit(String name) Returns theProcessingUnitfor the given processing unit name.Returns an event manager allowing to registerProcessingUnitAddedEventListeners.getProcessingUnitBySpace(String spaceName) Returns an event manager allowing to registerProcessingUnitInstanceAddedEventListeners.Returns an event manager allowing to registerProcessingUnitInstanceMemberAliveIndicatorStatusChangedEventListeners.Returns an event manager allowing to registerProcessingUnitInstanceProvisionStatusChangedEventListeners.Returns an event manager allowing to registerProcessingUnitInstanceRemovedEventListeners.Returns a processing unit instance statistics change event manger allowing to register for events ofProcessingUnitInstanceStatisticsChangedEvent.Returns an event manager allowing to registerProcessingUnitRemovedEventListeners.Returns theProcessingUnits currently deployed.Returns an event manager allowing to globally register for anyProcessingUnitSpaceCorrelatedEvents occurring on any processing unit.intgetSize()Returns the number of currently deployedProcessingUnits.booleanisEmpty()Returnstrueif there are no currently deployed processing units.booleanReturnstrueif statistics are now being monitored.iterator()removeEmbeddedSpace(InternalSpace space) Removes the reference to the specified space from the hosting processing unit.voidAllows to remove aProcessingUnitInstanceLifecycleEventListener.voidremoveLifecycleListener(ProcessingUnitLifecycleEventListener eventListener) Allows to remove aProcessingUnitLifecycleEventListener.voidremoveProcessingUnit(String name) voidsetStatisticsHistorySize(int historySize) Sets the history size of number of statistics stored.voidsetStatisticsInterval(long interval, TimeUnit timeUnit) Sets the statistics interval, automatically updating the monitoring scheduled tasks if monitoring is enabled.voidStarts the statistics monitor, starting a scheduled monitor that polls for statistics.voidStops the statistics monitor.Waits indefinitely till the processing unit is identified as deployed.Waits for the specified timeout (in time interval) till the processing unit is identified as deployed.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
DefaultProcessingUnits
-
-
Method Details
-
getAdmin
Description copied from interface:AdminAwareReturns theAdminassociated with this element.- Specified by:
getAdminin interfaceAdminAware
-
getProcessingUnitAdded
Description copied from interface:ProcessingUnitsReturns an event manager allowing to registerProcessingUnitAddedEventListeners.- Specified by:
getProcessingUnitAddedin interfaceProcessingUnits
-
getProcessingUnitRemoved
Description copied from interface:ProcessingUnitsReturns an event manager allowing to registerProcessingUnitRemovedEventListeners.- Specified by:
getProcessingUnitRemovedin interfaceProcessingUnits
-
getManagingGridServiceManagerChanged
Description copied from interface:ProcessingUnitsReturns an event manager allowing to globally register for anyManagingGridServiceManagerChangedEvents occurring on any processing unit.- Specified by:
getManagingGridServiceManagerChangedin interfaceProcessingUnits
-
getBackupGridServiceManagerChanged
Description copied from interface:ProcessingUnitsReturns an event manager allowing to globally register for anyBackupGridServiceManagerChangedEvents occurring on any processing unit.- Specified by:
getBackupGridServiceManagerChangedin interfaceProcessingUnits
-
getProcessingUnitStatusChanged
Description copied from interface:ProcessingUnitsReturns an event manager allowing to globally register for anyProcessingUnitSpaceCorrelatedEvents occurring on any processing unit.- Specified by:
getProcessingUnitStatusChangedin interfaceProcessingUnits
-
getProcessingUnitInstanceAdded
Description copied from interface:ProcessingUnitsReturns an event manager allowing to registerProcessingUnitInstanceAddedEventListeners.- Specified by:
getProcessingUnitInstanceAddedin interfaceProcessingUnits
-
getProcessingUnitInstanceRemoved
Description copied from interface:ProcessingUnitsReturns an event manager allowing to registerProcessingUnitInstanceRemovedEventListeners.- Specified by:
getProcessingUnitInstanceRemovedin interfaceProcessingUnits
-
iterator
- Specified by:
iteratorin interfaceIterable<ProcessingUnit>
-
getProcessingUnits
Description copied from interface:ProcessingUnitsReturns theProcessingUnits currently deployed.- Specified by:
getProcessingUnitsin interfaceProcessingUnits
-
getProcessingUnitInstances
- Specified by:
getProcessingUnitInstancesin interfaceInternalProcessingUnitInstancesAware
-
getProcessingUnit
Description copied from interface:ProcessingUnitsReturns theProcessingUnitfor the given processing unit name.- Specified by:
getProcessingUnitin interfaceProcessingUnits
-
getNames
Description copied from interface:ProcessingUnitsReturns a map ofProcessingUnitkeyed by their respective names.- Specified by:
getNamesin interfaceProcessingUnits
-
getSize
public int getSize()Description copied from interface:ProcessingUnitsReturns the number of currently deployedProcessingUnits.- Specified by:
getSizein interfaceProcessingUnits
-
isEmpty
public boolean isEmpty()Description copied from interface:ProcessingUnitsReturnstrueif there are no currently deployed processing units.- Specified by:
isEmptyin interfaceProcessingUnits
-
waitFor
Description copied from interface:ProcessingUnitsWaits indefinitely till the processing unit is identified as deployed. Returns theProcessingUnit.- Specified by:
waitForin interfaceProcessingUnits
-
waitFor
Description copied from interface:ProcessingUnitsWaits for the specified timeout (in time interval) till the processing unit is identified as deployed. Returns theProcessingUnit. Returnnullif the processing unit is not deployed within the specified timeout.- Specified by:
waitForin interfaceProcessingUnits
-
addLifecycleListener
Description copied from interface:ProcessingUnitsAllows to add aProcessingUnitLifecycleEventListener.- Specified by:
addLifecycleListenerin interfaceProcessingUnits
-
removeLifecycleListener
Description copied from interface:ProcessingUnitsAllows to remove aProcessingUnitLifecycleEventListener.- Specified by:
removeLifecycleListenerin interfaceProcessingUnits
-
addLifecycleListener
Description copied from interface:ProcessingUnitsAllows to add aProcessingUnitInstanceLifecycleEventListener.- Specified by:
addLifecycleListenerin interfaceProcessingUnits
-
removeLifecycleListener
Description copied from interface:ProcessingUnitsAllows to remove aProcessingUnitInstanceLifecycleEventListener.- Specified by:
removeLifecycleListenerin interfaceProcessingUnits
-
addProcessingUnit
- Specified by:
addProcessingUnitin interfaceInternalProcessingUnits
-
removeProcessingUnit
- Specified by:
removeProcessingUnitin interfaceInternalProcessingUnits
-
getProcessingUnitInstanceStatisticsChanged
public ProcessingUnitInstanceStatisticsChangedEventManager getProcessingUnitInstanceStatisticsChanged()Description copied from interface:ProcessingUnitsReturns a processing unit instance statistics change event manger allowing to register for events ofProcessingUnitInstanceStatisticsChangedEvent.Note, in order to receive events, the virtual machines need to be in a "statistics" monitored state.
- Specified by:
getProcessingUnitInstanceStatisticsChangedin interfaceProcessingUnits
-
getProcessingUnitInstanceProvisionStatusChanged
public ProcessingUnitInstanceProvisionStatusChangedEventManager getProcessingUnitInstanceProvisionStatusChanged()Description copied from interface:ProcessingUnitsReturns an event manager allowing to registerProcessingUnitInstanceProvisionStatusChangedEventListeners.- Specified by:
getProcessingUnitInstanceProvisionStatusChangedin interfaceProcessingUnits
-
getProcessingUnitInstanceMemberAliveIndicatorStatusChanged
public ProcessingUnitInstanceMemberAliveIndicatorStatusChangedEventManager getProcessingUnitInstanceMemberAliveIndicatorStatusChanged()Description copied from interface:ProcessingUnitsReturns an event manager allowing to registerProcessingUnitInstanceMemberAliveIndicatorStatusChangedEventListeners.- Specified by:
getProcessingUnitInstanceMemberAliveIndicatorStatusChangedin interfaceProcessingUnits
-
setStatisticsInterval
Description copied from interface:StatisticsMonitorSets the statistics interval, automatically updating the monitoring scheduled tasks if monitoring is enabled.- Specified by:
setStatisticsIntervalin interfaceStatisticsMonitor
-
setStatisticsHistorySize
public void setStatisticsHistorySize(int historySize) Description copied from interface:StatisticsMonitorSets the history size of number of statistics stored.- Specified by:
setStatisticsHistorySizein interfaceStatisticsMonitor
-
startStatisticsMonitor
public void startStatisticsMonitor()Description copied from interface:StatisticsMonitorStarts the statistics monitor, starting a scheduled monitor that polls for statistics. Monitoring is required only when wanting to receive statistics change events.- Specified by:
startStatisticsMonitorin interfaceStatisticsMonitor
-
stopStatisticsMonitor
public void stopStatisticsMonitor()Description copied from interface:StatisticsMonitorStops the statistics monitor.- Specified by:
stopStatisticsMonitorin interfaceStatisticsMonitor
-
isMonitoring
public boolean isMonitoring()Description copied from interface:StatisticsMonitorReturnstrueif statistics are now being monitored.- Specified by:
isMonitoringin interfaceStatisticsMonitor
-
removeEmbeddedSpace
Description copied from interface:InternalProcessingUnitsRemoves the reference to the specified space from the hosting processing unit.- Specified by:
removeEmbeddedSpacein interfaceInternalProcessingUnits- Returns:
- the hosting processing unit from which the space was removed, or null if such a processing unit was not found
-
getProcessingUnitBySpace
- Specified by:
getProcessingUnitBySpacein interfaceInternalProcessingUnits
-