Class DefaultGridServiceContainer
java.lang.Object
org.openspaces.admin.internal.support.AbstractGridComponent
org.openspaces.admin.internal.support.AbstractAgentGridComponent
org.openspaces.admin.internal.gsc.DefaultGridServiceContainer
- All Implemented Interfaces:
Iterable<ProcessingUnitInstance>,AdminAware,AgentGridComponent,DiscoverableComponent,DumpProvider,GridComponent,GridServiceContainer,InternalGridServiceContainer,InternalMachineAware,InternalOperatingSystemAware,InternalOperatingSystemInfoProvider,InternalAgentGridComponent,InternalDiscoverableComponent,InternalGridComponent,InternalTransportAware,InternalTransportInfoProvider,InternalVirtualMachineAware,InternalVirtualMachineInfoProvider,InternalZoneAware,LogProviderGridComponent,MachineAware,MetricProvider,OperatingSystemAware,TransportAware,VirtualMachineAware,ZoneAware
public class DefaultGridServiceContainer
extends AbstractAgentGridComponent
implements InternalGridServiceContainer
- Author:
- kimchy
-
Field Summary
Fields inherited from class org.openspaces.admin.internal.support.AbstractGridComponent
admin -
Constructor Summary
ConstructorsConstructorDescriptionDefaultGridServiceContainer(ServiceID serviceID, com.gigaspaces.grid.gsc.GSC gsc, InternalAdmin admin, int agentId, String agentUid, JVMDetails jvmDetails) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProcessingUnitInstance(ProcessingUnitInstance processingUnitInstance) voidaddProcessingUnitInstanceLifecycleEventListener(ProcessingUnitInstanceLifecycleEventListener eventListener) Adds a processing unit lifecycle listener to the container.booleancontains(ProcessingUnitInstance processingUnitInstance) Returnstrueif the GSC contains the provided processing unit instance.voidvoidbooleangenerateDump(String cause, Map<String, Object> context) Generates dump for all the provided dump processors.Generates dump for the provided processors.longcom.gigaspaces.grid.gsc.GSCgetGSC()getId()Returns the Grid Service Container IdentifierReturns an event manager allowing to register for processing unit instance additions to the container.getProcessingUnitInstanceByUID(String processingUnitInstanceUid) Returns the processing unit instance that are currently deployed within the grid service container according to its uid.Returns an event manager allowing to register for processing unit instance removals from the container.Returns the processing unit instances that are currently deployed within the grid service container.getProcessingUnitInstances(String processingUnitName) Returns the processing unit instances of the specified name that are currently deployed within the grid service container.getUid()Returns the unique id of the grid component.String[]inthashCode()booleaniterator()logEntries(LogEntryMatcher matcher) Returns the log entries matching the given matcher for the specific grid component.logEntriesDirect(LogEntryMatcher matcher) Same asLogProviderGridComponent.logEntries(com.gigaspaces.log.LogEntryMatcher), but does not try and get the logs from the agent.voidvoidvoidremoveProcessingUnitInstanceLifecycleEventListener(ProcessingUnitInstanceLifecycleEventListener eventListener) Removes a processing unit lifecycle listener to the container.voidrunGc()booleanwaitFor(int numberOfProcessingUnitInstances) Waits indefinitely for the given number of processing unit instances to run within the container.booleanWaits for timeout value (in time unit) for the given number of processing unit instances to run within the container.booleanWaits indefinitely for the given number of processing unit instances of the specified name to run within the container.booleanwaitFor(String processingUnitName, int numberOfProcessingUnitInstances, long timeout, TimeUnit timeUnit) Waits for timeout value (in time unit) for the given number of processing unit instances of the specified name to run within the container.Methods inherited from class org.openspaces.admin.internal.support.AbstractAgentGridComponent
getAgentId, getAgentUid, getGridServiceAgent, kill, restart, setGridServiceAgentMethods inherited from class org.openspaces.admin.internal.support.AbstractGridComponent
addZone, assertStateChangesPermitted, getAdmin, getJVMDetails, getMachine, getOperatingSystem, getTransport, getVirtualMachine, getZones, isDiscovered, setDiscovered, setMachine, setOperatingSystem, setTransport, setVirtualMachineMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openspaces.admin.AdminAware
getAdminMethods inherited from interface org.openspaces.admin.AgentGridComponent
getAgentId, getGridServiceAgent, kill, restartMethods inherited from interface org.openspaces.admin.DiscoverableComponent
isDiscoveredMethods inherited from interface org.openspaces.admin.internal.support.InternalAgentGridComponent
getAgentUid, setGridServiceAgentMethods inherited from interface org.openspaces.admin.internal.support.InternalDiscoverableComponent
setDiscoveredMethods inherited from interface org.openspaces.admin.internal.machine.InternalMachineAware
setMachineMethods inherited from interface org.openspaces.admin.internal.os.InternalOperatingSystemAware
setOperatingSystemMethods inherited from interface org.openspaces.admin.internal.transport.InternalTransportAware
setTransportMethods inherited from interface org.openspaces.admin.internal.vm.InternalVirtualMachineAware
setVirtualMachineMethods inherited from interface org.openspaces.admin.internal.vm.InternalVirtualMachineInfoProvider
getJVMDetailsMethods inherited from interface org.openspaces.admin.internal.zone.InternalZoneAware
addZoneMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.openspaces.admin.machine.MachineAware
getMachineMethods inherited from interface org.openspaces.admin.os.OperatingSystemAware
getOperatingSystemMethods inherited from interface org.openspaces.admin.transport.TransportAware
getTransportMethods inherited from interface org.openspaces.admin.vm.VirtualMachineAware
getVirtualMachine
-
Constructor Details
-
DefaultGridServiceContainer
public DefaultGridServiceContainer(ServiceID serviceID, com.gigaspaces.grid.gsc.GSC gsc, InternalAdmin admin, int agentId, String agentUid, JVMDetails jvmDetails)
-
-
Method Details
-
getId
Description copied from interface:GridServiceContainerReturns the Grid Service Container Identifier- Specified by:
getIdin interfaceGridServiceContainer
-
getUid
Description copied from interface:GridComponentReturns the unique id of the grid component.- Specified by:
getUidin interfaceGridComponent- Specified by:
getUidin interfaceInternalVirtualMachineInfoProvider
-
getServiceID
- Specified by:
getServiceIDin interfaceInternalGridServiceContainer
-
getGSC
public com.gigaspaces.grid.gsc.GSC getGSC()- Specified by:
getGSCin interfaceInternalGridServiceContainer
-
iterator
- Specified by:
iteratorin interfaceIterable<ProcessingUnitInstance>
-
getProcessingUnitInstances
Description copied from interface:GridServiceContainerReturns the processing unit instances that are currently deployed within the grid service container.- Specified by:
getProcessingUnitInstancesin interfaceGridServiceContainer
-
getProcessingUnitInstances
Description copied from interface:GridServiceContainerReturns the processing unit instances of the specified name that are currently deployed within the grid service container.- Specified by:
getProcessingUnitInstancesin interfaceGridServiceContainer
-
getProcessingUnitInstanceByUID
Description copied from interface:GridServiceContainerReturns the processing unit instance that are currently deployed within the grid service container according to its uid.- Specified by:
getProcessingUnitInstanceByUIDin interfaceGridServiceContainer
-
contains
Description copied from interface:GridServiceContainerReturnstrueif the GSC contains the provided processing unit instance.- Specified by:
containsin interfaceGridServiceContainer
-
waitFor
public boolean waitFor(int numberOfProcessingUnitInstances) Description copied from interface:GridServiceContainerWaits indefinitely for the given number of processing unit instances to run within the container.- Specified by:
waitForin interfaceGridServiceContainer
-
waitFor
Description copied from interface:GridServiceContainerWaits for timeout value (in time unit) for the given number of processing unit instances to run within the container. Returnstrueif the number was reached,falseif the timeout expired.- Specified by:
waitForin interfaceGridServiceContainer
-
waitFor
Description copied from interface:GridServiceContainerWaits indefinitely for the given number of processing unit instances of the specified name to run within the container.- Specified by:
waitForin interfaceGridServiceContainer
-
waitFor
public boolean waitFor(String processingUnitName, int numberOfProcessingUnitInstances, long timeout, TimeUnit timeUnit) Description copied from interface:GridServiceContainerWaits for timeout value (in time unit) for the given number of processing unit instances of the specified name to run within the container. Returnstrueif the number was reached,falseif the timeout expired.- Specified by:
waitForin interfaceGridServiceContainer
-
addProcessingUnitInstance
- Specified by:
addProcessingUnitInstancein interfaceInternalGridServiceContainer
-
removeProcessingUnitInstance
- Specified by:
removeProcessingUnitInstancein interfaceInternalGridServiceContainer
-
getProcessingUnitInstanceAdded
Description copied from interface:GridServiceContainerReturns an event manager allowing to register for processing unit instance additions to the container.- Specified by:
getProcessingUnitInstanceAddedin interfaceGridServiceContainer
-
getProcessingUnitInstanceRemoved
Description copied from interface:GridServiceContainerReturns an event manager allowing to register for processing unit instance removals from the container.- Specified by:
getProcessingUnitInstanceRemovedin interfaceGridServiceContainer
-
addProcessingUnitInstanceLifecycleEventListener
public void addProcessingUnitInstanceLifecycleEventListener(ProcessingUnitInstanceLifecycleEventListener eventListener) Description copied from interface:GridServiceContainerAdds a processing unit lifecycle listener to the container.- Specified by:
addProcessingUnitInstanceLifecycleEventListenerin interfaceGridServiceContainer
-
removeProcessingUnitInstanceLifecycleEventListener
public void removeProcessingUnitInstanceLifecycleEventListener(ProcessingUnitInstanceLifecycleEventListener eventListener) Description copied from interface:GridServiceContainerRemoves a processing unit lifecycle listener to the container.- Specified by:
removeProcessingUnitInstanceLifecycleEventListenerin interfaceGridServiceContainer
-
logEntries
Description copied from interface:LogProviderGridComponentReturns the log entries matching the given matcher for the specific grid component. If it is managed by aGridServiceAgent, will get the log through it instead of creating a load on the actual grid component.- Specified by:
logEntriesin interfaceLogProviderGridComponent- Throws:
AdminException
-
logEntriesDirect
Description copied from interface:LogProviderGridComponentSame asLogProviderGridComponent.logEntries(com.gigaspaces.log.LogEntryMatcher), but does not try and get the logs from the agent.- Specified by:
logEntriesDirectin interfaceLogProviderGridComponent- Throws:
AdminException
-
reloadMetricConfiguration
- Specified by:
reloadMetricConfigurationin interfaceMetricProvider- Throws:
AdminException
-
generateDump
Description copied from interface:DumpProviderGenerates dump for all the provided dump processors. Note, this will include a heap dump which can consume time and potentially be of very large size- Specified by:
generateDumpin interfaceDumpProvider- Parameters:
cause- The cause that this dump was generatedcontext- Allows to provide specific parameters to specific processors- Throws:
AdminException
-
generateDump
public DumpResult generateDump(String cause, Map<String, Object> context, String... processor) throws AdminExceptionDescription copied from interface:DumpProviderGenerates dump for the provided processors. The current list of processors include:- summary: General summary information of the process.
- network: Information on the network layer of the process and the OS network stats.
- thread: Thread dump of the process.
- heap: Heap dump of the process. Note, this is a heavy operation and can produce very large dump files
- log: Adds all the log files of the process to the dump file.
- processingUnits: Dump of all the processing units (applicable only for GSCs) information.
- Specified by:
generateDumpin interfaceDumpProvider- Parameters:
cause- The cause this dump was generated.context- Allows to provide specific parameters to specific processors.processor- The list of processors to be used.- Throws:
AdminException
-
getNIODetails
- Specified by:
getNIODetailsin interfaceInternalTransportInfoProvider- Throws:
RemoteException
-
getNIOStatistics
- Specified by:
getNIOStatisticsin interfaceInternalTransportInfoProvider- Throws:
RemoteException
-
enableLRMIMonitoring
- Specified by:
enableLRMIMonitoringin interfaceInternalTransportInfoProvider- Throws:
RemoteException
-
disableLRMIMonitoring
- Specified by:
disableLRMIMonitoringin interfaceInternalTransportInfoProvider- Throws:
RemoteException
-
fetchLRMIMonitoringDetails
- Specified by:
fetchLRMIMonitoringDetailsin interfaceInternalTransportInfoProvider- Throws:
RemoteException
-
getCurrentTimeInMillis
- Specified by:
getCurrentTimeInMillisin interfaceInternalOperatingSystemInfoProvider- Throws:
RemoteException
-
getOSDetails
- Specified by:
getOSDetailsin interfaceInternalOperatingSystemInfoProvider- Throws:
RemoteException
-
getOSStatistics
- Specified by:
getOSStatisticsin interfaceInternalOperatingSystemInfoProvider- Throws:
RemoteException
-
getJVMStatistics
- Specified by:
getJVMStatisticsin interfaceInternalVirtualMachineInfoProvider- Throws:
RemoteException
-
runGc
- Specified by:
runGcin interfaceInternalVirtualMachineInfoProvider- Throws:
RemoteException
-
hasProcessingUnitInstances
public boolean hasProcessingUnitInstances()- Specified by:
hasProcessingUnitInstancesin interfaceInternalGridServiceContainer- Returns:
- false only when all processing unit instances have completed shutdown.
- See Also:
-
getUnconfirmedRemovedProcessingUnitInstancesUid
- Specified by:
getUnconfirmedRemovedProcessingUnitInstancesUidin interfaceInternalGridServiceContainer- Returns:
- UIDs of instances that have been removed from the lookup service/Admin API, but are still reported by the GSC
-
equals
-
hashCode
public int hashCode() -
getExactZones
- Specified by:
getExactZonesin interfaceGridServiceContainer- Returns:
- the list of zones that the GSC satisfies
-