Interface Admin
- All Superinterfaces:
DumpProvider,StatisticsMonitor
- All Known Subinterfaces:
InternalAdmin
- All Known Implementing Classes:
DefaultAdmin
AdminFactory class.
Provides access to the main elements in the Admin API and in GigaSpaces such as the GridServiceAgents, LookupServices,
GridServiceManagers, GridServiceContainers,
ProcessingUnits, and Spaces.
Also allows to change monitoring (not statistics) interval (works in a polling fashion) of state changing elements such as the processing unit, the Grid Service Agent, and the Space.
Implements the StatisticsMonitor interface, allowing in one
single call (StatisticsMonitor.startStatisticsMonitor()) to start statistics monitors on all the elements
it manages (such as the Spaces, and VirtualMachines.
Provides one stop shop for registering all event listeners that extend AdminEventListener using the addEventListener(AdminEventListener)
and their removal removeEventListener(AdminEventListener). The actual event listener
interfaces will be automatically detected and added to the correct component.
- Author:
- kimchy
-
Field Summary
Fields inherited from interface org.openspaces.admin.StatisticsMonitor
DEFAULT_HISTORY_SIZE, DEFAULT_MONITOR_INTERVAL -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEventListener(AdminEventListener eventListener) Smart addition of event listeners.voidaddEventListener(AdminEventListener eventListener, boolean withStatisticsHistory) Smart addition of event listeners.voidclose()Closes the Admin, releasing any resource and stops listening for events from the lookup service.generateDump(Set<DumpProvider> dumpProviders, DumpGeneratedListener listener, String cause, Map<String, Object> context, String... processor) Generates dump for an explicit set of dump providers.Returns the alert manager through which alert strategies are managed, alerts are fired and alert events are registered for.intReturns number of registered event listeners.Returns the Gateway Processing Units discovered.Returns the gateways discovered.Returns the Grid Component represented by this UID; e.g.Returns the grid service agents discovered.Returns the grid service containers discovered.Returns the grid service managers discovered.String[]Returns the lookup groups this admin uses.Returns the lookup locators this admin uses.Returns the lookup services discovered.Returns the machines discovered.Returns the cluster manager information (if not initialized yet - return null)Returns the Operating Systems discovered.Returns the Processing Units discovered.Returns the spaces discovered.Returns the transports discovered.Returns the Virtual Machines discovered.getZones()Returns the zones discovered.voidremoveEventListener(AdminEventListener eventListener) Smart removal of event listeners.voidsetAgentProcessessMonitorInterval(long interval, TimeUnit timeUnit) Sets the Grid Service Agent processes monitor (not statistics) interval.voidsetDefaultTimeout(long timeout, TimeUnit timeUnit) The default timeout to be used for operations that have a wait for mechanism, i.e.voidsetProcessingUnitMonitorInterval(long interval, TimeUnit timeUnit) Sets the processing unit monitor (not statistics) interval.voidsetSchedulerCorePoolSize(int coreThreads) The Admin API uses a shared scheduler thread pool to perform *all* scheduled operations (monitoring, statistics monitoring).voidsetSpaceMonitorInterval(long interval, TimeUnit timeUnit) Sets the Space monitor (not statistics) interval.Waits indefinitely for the cluster manager information to be initialized, then return itwaitForManagerClusterInfo(long timeout, TimeUnit timeUnit) Waits for the specified timeout for the cluster manager information to be initialized, then return it.Methods inherited from interface org.openspaces.admin.dump.DumpProvider
generateDump, generateDumpMethods inherited from interface org.openspaces.admin.StatisticsMonitor
isMonitoring, setStatisticsHistorySize, setStatisticsInterval, startStatisticsMonitor, stopStatisticsMonitor
-
Method Details
-
getGroups
String[] getGroups()Returns the lookup groups this admin uses.- See Also:
-
getLocators
LookupLocator[] getLocators()Returns the lookup locators this admin uses.- See Also:
-
getManagerClusterInfo
ManagerClusterInfo getManagerClusterInfo()Returns the cluster manager information (if not initialized yet - return null)- Since:
- 15.5
- See Also:
-
waitForManagerClusterInfo
ManagerClusterInfo waitForManagerClusterInfo()Waits indefinitely for the cluster manager information to be initialized, then return it- Since:
- 15.5
-
waitForManagerClusterInfo
Waits for the specified timeout for the cluster manager information to be initialized, then return it. If the timeout elapses before initialization - return null.- Since:
- 15.5
-
setProcessingUnitMonitorInterval
Sets the processing unit monitor (not statistics) interval. The monitor basically checks the status of each processing unit (ProcessingUnit.getStatus()among other things.Defaults to 1 second.
- Parameters:
interval- The interval to use.timeUnit- The time unit the interval is at.
-
setAgentProcessessMonitorInterval
Sets the Grid Service Agent processes monitor (not statistics) interval. The monitor basically updates the list of processes the agent manages (GridServiceAgent.getProcessesDetails().Defaults to 5 seconds.
- Parameters:
interval- The interval to use.timeUnit- The time unit the interval is at.
-
setSpaceMonitorInterval
Sets the Space monitor (not statistics) interval. The monitor checks each space instance and updates its different status (such as the replication status).Defaults to 1 second.
- Parameters:
interval- The interval to use.timeUnit- The time unit the interval is at.
-
setSchedulerCorePoolSize
void setSchedulerCorePoolSize(int coreThreads) The Admin API uses a shared scheduler thread pool to perform *all* scheduled operations (monitoring, statistics monitoring). The number of threads used can be set here.Defaults to 10 threads.
- Parameters:
coreThreads- The number of threads the shared scheduler thread pool will use,
-
setDefaultTimeout
The default timeout to be used for operations that have a wait for mechanism, i.e. operations with overloaded methods containing (..., long timeout, TimeUnit timeUnit). If not set, the default is Long.MAX_VALUE, TimeUnit.MILLISECONDS- Parameters:
timeout- The timeout value to be used as the default operation timeout if non was provided.timeUnit- The time-unit corresponding to the timeout.
-
close
void close()Closes the Admin, releasing any resource and stops listening for events from the lookup service. -
getGridServiceAgents
GridServiceAgents getGridServiceAgents()Returns the grid service agents discovered. -
getLookupServices
LookupServices getLookupServices()Returns the lookup services discovered. -
getGridServiceManagers
GridServiceManagers getGridServiceManagers()Returns the grid service managers discovered. -
getGridServiceContainers
GridServiceContainers getGridServiceContainers()Returns the grid service containers discovered. -
getGateways
Gateways getGateways()Returns the gateways discovered.- Since:
- 8.0.4
-
getGatewayProcessingUnits
GatewayProcessingUnits getGatewayProcessingUnits()Returns the Gateway Processing Units discovered.- Since:
- 9.5
-
getGridComponentByUID
Returns the Grid Component represented by this UID; e.g. ESM, GSA, LUS, GSM, GSC- Parameters:
uid- The UID of the service returned byGridComponent.getUid();nullif no representation.- Returns:
- The Grid Component represented by this UID.
- See Also:
-
getMachines
Machines getMachines()Returns the machines discovered. -
getZones
Zones getZones()Returns the zones discovered. -
getApplications
Applications getApplications()- Returns:
- the discovered applications
- Since:
- 8.0.3
-
getTransports
Transports getTransports()Returns the transports discovered. -
getVirtualMachines
VirtualMachines getVirtualMachines()Returns the Virtual Machines discovered. -
getOperatingSystems
OperatingSystems getOperatingSystems()Returns the Operating Systems discovered. -
getProcessingUnits
ProcessingUnits getProcessingUnits()Returns the Processing Units discovered. -
getSpaces
Spaces getSpaces()Returns the spaces discovered. -
getAlertManager
AlertManager getAlertManager()Returns the alert manager through which alert strategies are managed, alerts are fired and alert events are registered for. -
addEventListener
Smart addition of event listeners. Will automatically add to the correct place any interface that extends theAdminEventListenerinterface.- See Also:
-
addEventListener
Smart addition of event listeners. Will automatically add to the correct place any interface that extends theAdminEventListenerinterface.- Parameters:
withStatisticsHistory- if all statistics histories will be fired on registration statistics listener- See Also:
-
removeEventListener
Smart removal of event listeners. Will automatically remove to the correct place any interface that extends theAdminEventListenerinterface.- See Also:
-
getEventListenersCount
int getEventListenersCount()Returns number of registered event listeners. SeeAdminEventListener. Only for calls issued by either addEventListener or removeEventListener- Since:
- 8.0.5
- See Also:
-
generateDump
DumpResult generateDump(Set<DumpProvider> dumpProviders, DumpGeneratedListener listener, String cause, Map<String, Object> context, String... processor) throws AdminExceptionGenerates dump for an explicit set of dump providers.- Throws:
AdminException
-