public class DefaultProcessingUnitInstance extends AbstractGridComponent implements InternalProcessingUnitInstance
admin
DEFAULT_HISTORY_SIZE, DEFAULT_MONITOR_INTERVAL
Constructor and Description |
---|
DefaultProcessingUnitInstance(ServiceID serviceID,
PUDetails puDetails,
PUServiceBean puServiceBean,
InternalAdmin admin,
JVMDetails jvmDetails) |
Modifier and Type | Method and Description |
---|---|
boolean |
addSpaceInstanceIfMatching(SpaceInstance spaceInstance)
Adds a space instance only if it is one that the processing unit has started.
|
void |
decrement()
Decrements the instance (and destroying it in the process).
|
void |
destroy()
Destroy the instance.
|
void |
disableLRMIMonitoring() |
void |
enableLRMIMonitoring() |
LRMIMonitoringDetails |
fetchLRMIMonitoringDetails() |
Map<String,AsyncPollingEventContainerServiceDetails> |
getAsyncPollingEventContainerDetails()
Returns a map of
AsyncPollingEventContainerServiceDetails
keyed by their ServiceDetails.getId() . |
int |
getBackupId()
Returns the backup id of the processing unit instance.
|
ClusterInfo |
getClusterInfo()
Returns the cluster info of the processing unit instance.
|
long |
getCurrentTimeInMillis() |
SpaceServiceDetails |
getEmbeddedSpaceDetails()
Returns the embedded space service details as described by the service started within the
processing unit.
|
SpaceServiceDetails[] |
getEmbeddedSpacesDetails()
Returns the embedded space service details as described by the service started within the
processing unit.
|
Map<String,EventContainerServiceDetails> |
getEventContainerDetails()
Returns a map of
EventContainerServiceDetails keyed by their
ServiceDetails.getId() . |
GridServiceContainer |
getGridServiceContainer()
Returns the
GridServiceContainer the processing unit is
running on. |
ServiceID |
getGridServiceContainerServiceID() |
String |
getId()
Returns the Processing unit instance Identifier
|
int |
getInstanceId()
Returns the instance id of the processing unit instance.
|
JeeServiceDetails |
getJeeDetails()
Returns the jee service details of the jee container that was started within this processing
unit.
|
JVMStatistics |
getJVMStatistics() |
ProcessingUnitInstanceStatistics |
getLastStatistics()
This method is non-blocking and should used in conjunction with
ProcessingUnitInstance.getStatistics() or
StatisticsMonitor.setStatisticsInterval(long, java.util.concurrent.TimeUnit) |
MemberAliveIndicatorStatus |
getMemberAliveIndicatorStatus() |
String |
getName()
Returns the name of the processing unit.
|
NIODetails |
getNIODetails() |
NIOStatistics |
getNIOStatistics() |
Map<String,NotifyEventContainerServiceDetails> |
getNotifyEventContainerDetails()
Returns a map of
NotifyEventContainerServiceDetails
keyed by their ServiceDetails.getId() . |
OSDetails |
getOSDetails() |
OSStatistics |
getOSStatistics() |
ProcessingUnitPartition |
getPartition()
Returns the processing unit partition this processing unit instance is part of.
|
Map<String,PollingEventContainerServiceDetails> |
getPollingEventContainerDetails()
Returns a map of
PollingEventContainerServiceDetails
keyed by their ServiceDetails.getId() . |
ProcessingUnit |
getProcessingUnit()
Returns the processing unit this processing unit instance belongs to.
|
String |
getProcessingUnitInstanceName()
Get this processing unit instance String representation.
If this processing unit instance represents a Space instance, this method will return a similar result to SpaceInstance.getSpaceInstanceName() , but with the processing unit name as the Space name. |
String |
getProcessingUnitInstanceSimpleName() |
BeanLevelProperties |
getProperties()
Return the properties the processing unit was deployed with.
|
PUServiceBean |
getPUServiceBean() |
RemotingServiceDetails |
getRemotingDetails()
Returns the remoting service details (the exporter) if configured within the processing
unit.
|
Map<String,ServiceDetails> |
getServiceDetailsByServiceId()
Returns a map of service details by service id.
|
ServiceDetails |
getServiceDetailsByServiceId(String serviceId)
Returns the service details for a specific service id.
|
Map<String,ServiceDetails[]> |
getServiceDetailsByServiceType()
Returns a map of service details by service type.
|
ServiceID |
getServiceID() |
ServiceDetails[] |
getServicesDetails() |
ServiceDetails[] |
getServicesDetailsByServiceType(String serviceType)
Returns the service details by a service type
ServiceDetails.getServiceType() . |
SpaceServiceDetails[] |
getSpaceDetails()
Returns the space service details as described by the service started within the processing
unit.
|
SpaceInstance |
getSpaceInstance()
Returns a space instance that was started within the processing unit instance.
|
SpaceInstance[] |
getSpaceInstances()
Returns all the space instances that were started within the processing unit instance.
|
ProcessingUnitInstanceStatistics |
getStatistics()
Returns the processing unit instance statistics.
|
long |
getStatisticsIntervalMilliseconds() |
String |
getUid()
Returns the unique id of the grid component.
|
Future<Object> |
invoke(String serviceBeanName,
Map<String,Object> namedArgs) |
boolean |
isEmbeddedSpaces()
Returns
true if there are embedded spaces started within this processing unit. |
boolean |
isJee()
Returns
true if this processing unit is a jee processing unit. |
boolean |
isMonitoring()
Returns
true if statistics are now being monitored. |
boolean |
isUndeploying() |
Iterator<ServiceDetails> |
iterator() |
void |
relocate()
Relocates the instance to any suitable
GridServiceContainer . |
void |
relocate(GridServiceContainer gridServiceContainerToRelocateTo)
Relocates the instance to the provided
GridServiceContainer . |
ProcessingUnitInstance |
relocateAndWait()
Relocates the any suitable
GridServiceContainer . |
ProcessingUnitInstance |
relocateAndWait(GridServiceContainer gridServiceContainerToRelocateTo)
Relocates the instance to the provided
GridServiceContainer . |
ProcessingUnitInstance |
relocateAndWait(GridServiceContainer gridServiceContainerToRelocateTo,
long timeout,
TimeUnit timeUnit)
Relocates the instance to the provided
GridServiceContainer . |
ProcessingUnitInstance |
relocateAndWait(long timeout,
TimeUnit timeUnit)
Relocates the any suitable
GridServiceContainer . |
void |
removeSpaceInstance(String uid) |
void |
restart()
Restarts the processing unit instance.
|
ProcessingUnitInstance |
restartAndWait()
Restarts the processing unit instance and waits indefinitely for the restarted processing
unit instance returning it.
|
ProcessingUnitInstance |
restartAndWait(long timeout,
TimeUnit timeUnit)
Restarts the processing unit instance and waits for the restarted processing unit instance
returning it for the provided timeout.
|
void |
runGc() |
void |
setClusterInfo(ClusterInfo clusterInfo) |
void |
setGridServiceContainer(GridServiceContainer gridServiceContainer) |
void |
setMemberAliveIndicatorStatus(org.jini.rio.monitor.ServiceFaultDetectionEvent serviceFaultDetectionEvent) |
void |
setProcessingUnit(ProcessingUnit processingUnit) |
void |
setProcessingUnitPartition(ProcessingUnitPartition processingUnitPartition) |
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.
|
SpaceInstance |
waitForSpaceInstance() |
SpaceInstance |
waitForSpaceInstance(long timeout,
TimeUnit timeUnit) |
addZone, assertStateChangesPermitted, getAdmin, getJVMDetails, getMachine, getOperatingSystem, getTransport, getVirtualMachine, getZones, isDiscovered, setDiscovered, setMachine, setOperatingSystem, setTransport, setVirtualMachine
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
getAdmin
setDiscovered
isDiscovered
setMachine
getMachine
setTransport
getTransport
setOperatingSystem
getOperatingSystem
getJVMDetails
setVirtualMachine
getVirtualMachine
addZone
public DefaultProcessingUnitInstance(ServiceID serviceID, PUDetails puDetails, PUServiceBean puServiceBean, InternalAdmin admin, JVMDetails jvmDetails)
public String getUid()
GridComponent
getUid
in interface GridComponent
getUid
in interface InternalVirtualMachineInfoProvider
public String getId()
ProcessingUnitInstance
getId
in interface ProcessingUnitInstance
public int getInstanceId()
ProcessingUnitInstance
getInstanceId
in interface ProcessingUnitInstance
public int getBackupId()
ProcessingUnitInstance
getBackupId
in interface ProcessingUnitInstance
public ServiceID getServiceID()
getServiceID
in interface InternalProcessingUnitInstance
public ProcessingUnit getProcessingUnit()
ProcessingUnitInstance
getProcessingUnit
in interface ProcessingUnitInstance
public String getName()
ProcessingUnitInstance
getName
in interface ProcessingUnitInstance
public String getProcessingUnitInstanceName()
ProcessingUnitInstance
SpaceInstance.getSpaceInstanceName()
, but with the processing unit name as the Space name.
Otherwise, it will return: {Processing unit name} [instance id] - the name of this processing
unit (see ProcessingUnitInstance.getName()
) and the instance id (see ProcessingUnitInstance.getInstanceId()
); for
example, MyPU [3]getProcessingUnitInstanceName
in interface ProcessingUnitInstance
public String getProcessingUnitInstanceSimpleName()
getProcessingUnitInstanceSimpleName
in interface InternalProcessingUnitInstance
public void setProcessingUnit(ProcessingUnit processingUnit)
setProcessingUnit
in interface InternalProcessingUnitInstance
public ClusterInfo getClusterInfo()
ProcessingUnitInstance
getClusterInfo
in interface ProcessingUnitInstance
public BeanLevelProperties getProperties()
ProcessingUnitInstance
getProperties
in interface ProcessingUnitInstance
public Iterator<ServiceDetails> iterator()
iterator
in interface Iterable<ServiceDetails>
public Map<String,EventContainerServiceDetails> getEventContainerDetails()
ProcessingUnitInstance
EventContainerServiceDetails
keyed by their
ServiceDetails.getId()
.getEventContainerDetails
in interface ProcessingUnitInstance
public Map<String,PollingEventContainerServiceDetails> getPollingEventContainerDetails()
ProcessingUnitInstance
PollingEventContainerServiceDetails
keyed by their ServiceDetails.getId()
.getPollingEventContainerDetails
in interface ProcessingUnitInstance
public Map<String,NotifyEventContainerServiceDetails> getNotifyEventContainerDetails()
ProcessingUnitInstance
NotifyEventContainerServiceDetails
keyed by their ServiceDetails.getId()
.getNotifyEventContainerDetails
in interface ProcessingUnitInstance
public Map<String,AsyncPollingEventContainerServiceDetails> getAsyncPollingEventContainerDetails()
ProcessingUnitInstance
AsyncPollingEventContainerServiceDetails
keyed by their ServiceDetails.getId()
.getAsyncPollingEventContainerDetails
in interface ProcessingUnitInstance
public SpaceServiceDetails[] getSpaceDetails()
ProcessingUnitInstance
getSpaceDetails
in interface ProcessingUnitInstance
public SpaceServiceDetails getEmbeddedSpaceDetails()
ProcessingUnitInstance
null
if no embedded space was started within the processing
unit.getEmbeddedSpaceDetails
in interface ProcessingUnitInstance
public SpaceServiceDetails[] getEmbeddedSpacesDetails()
ProcessingUnitInstance
getEmbeddedSpacesDetails
in interface ProcessingUnitInstance
public ServiceDetails[] getServicesDetails()
public ServiceID getGridServiceContainerServiceID()
getGridServiceContainerServiceID
in interface InternalProcessingUnitInstance
public void setGridServiceContainer(GridServiceContainer gridServiceContainer)
setGridServiceContainer
in interface InternalProcessingUnitInstance
public GridServiceContainer getGridServiceContainer()
ProcessingUnitInstance
GridServiceContainer
the processing unit is
running on.getGridServiceContainer
in interface ProcessingUnitInstance
public void setProcessingUnitPartition(ProcessingUnitPartition processingUnitPartition)
setProcessingUnitPartition
in interface InternalProcessingUnitInstance
public ProcessingUnitPartition getPartition()
ProcessingUnitInstance
getPartition
in interface ProcessingUnitInstance
public PUServiceBean getPUServiceBean()
getPUServiceBean
in interface InternalProcessingUnitInstance
public boolean isEmbeddedSpaces()
ProcessingUnitInstance
true
if there are embedded spaces started within this processing unit.isEmbeddedSpaces
in interface ProcessingUnitInstance
public SpaceInstance getSpaceInstance()
ProcessingUnitInstance
null
if no embedded space instances were started (or none has been detected
yet).getSpaceInstance
in interface ProcessingUnitInstance
public SpaceInstance[] getSpaceInstances()
ProcessingUnitInstance
getSpaceInstances
in interface ProcessingUnitInstance
public SpaceInstance waitForSpaceInstance()
waitForSpaceInstance
in interface ProcessingUnitInstance
public SpaceInstance waitForSpaceInstance(long timeout, TimeUnit timeUnit)
waitForSpaceInstance
in interface ProcessingUnitInstance
public boolean addSpaceInstanceIfMatching(SpaceInstance spaceInstance)
InternalProcessingUnitInstance
addSpaceInstanceIfMatching
in interface InternalProcessingUnitInstance
public void removeSpaceInstance(String uid)
removeSpaceInstance
in interface InternalProcessingUnitInstance
public boolean isJee()
ProcessingUnitInstance
true
if this processing unit is a jee processing unit.isJee
in interface ProcessingUnitInstance
public JeeServiceDetails getJeeDetails()
ProcessingUnitInstance
getJeeDetails
in interface ProcessingUnitInstance
public RemotingServiceDetails getRemotingDetails()
ProcessingUnitInstance
getRemotingDetails
in interface ProcessingUnitInstance
public ServiceDetails getServiceDetailsByServiceId(String serviceId)
ProcessingUnitInstance
getServiceDetailsByServiceId
in interface ProcessingUnitInstance
public Map<String,ServiceDetails> getServiceDetailsByServiceId()
ProcessingUnitInstance
getServiceDetailsByServiceId
in interface ProcessingUnitInstance
public ServiceDetails[] getServicesDetailsByServiceType(String serviceType)
ProcessingUnitInstance
ServiceDetails.getServiceType()
.getServicesDetailsByServiceType
in interface ProcessingUnitInstance
public Map<String,ServiceDetails[]> getServiceDetailsByServiceType()
ProcessingUnitInstance
getServiceDetailsByServiceType
in interface ProcessingUnitInstance
public void destroy()
ProcessingUnitInstance
destroy
in interface ProcessingUnitInstance
public void relocate(GridServiceContainer gridServiceContainerToRelocateTo)
ProcessingUnitInstance
GridServiceContainer
.
Note, the current processing instance is unusable once this call has been made. If the
relocated processing unit instance is needed, or waiting for the relocation is required, use
ProcessingUnitInstance.relocateAndWait(org.openspaces.admin.gsc.GridServiceContainer)
or ProcessingUnitInstance.relocateAndWait(org.openspaces.admin.gsc.GridServiceContainer, long,
java.util.concurrent.TimeUnit)
.
relocate
in interface ProcessingUnitInstance
public ProcessingUnitInstance relocateAndWait(GridServiceContainer gridServiceContainerToRelocateTo)
ProcessingUnitInstance
GridServiceContainer
.
The relocated instance will be returned waiting for it indefinitely.relocateAndWait
in interface ProcessingUnitInstance
public ProcessingUnitInstance relocateAndWait(GridServiceContainer gridServiceContainerToRelocateTo, long timeout, TimeUnit timeUnit)
ProcessingUnitInstance
GridServiceContainer
.
The relocated instance will be returned waiting for it for the provided timeout.relocateAndWait
in interface ProcessingUnitInstance
public void relocate()
ProcessingUnitInstance
GridServiceContainer
.
Note, the current processing instance is unusable once this call has been made. If the
relocated processing unit instance is needed, or waiting for the relocation is required, use
ProcessingUnitInstance.relocateAndWait()
or ProcessingUnitInstance.relocateAndWait(long, java.util.concurrent.TimeUnit)
.
relocate
in interface ProcessingUnitInstance
public ProcessingUnitInstance relocateAndWait()
ProcessingUnitInstance
GridServiceContainer
. The
relocated instance will be returned waiting for it indefinitely.relocateAndWait
in interface ProcessingUnitInstance
public ProcessingUnitInstance relocateAndWait(long timeout, TimeUnit timeUnit)
ProcessingUnitInstance
GridServiceContainer
. The
relocated instance will be returned waiting for it for the provided timeout.relocateAndWait
in interface ProcessingUnitInstance
public void restart()
ProcessingUnitInstance
Note, the current processing unit instance is unusable once this call has been made. If
the restarted processing unit instance is needed, or waiting for the restart is required, use
ProcessingUnitInstance.restartAndWait()
or ProcessingUnitInstance.restartAndWait(long, java.util.concurrent.TimeUnit)
.
restart
in interface ProcessingUnitInstance
public ProcessingUnitInstance restartAndWait()
ProcessingUnitInstance
restartAndWait
in interface ProcessingUnitInstance
ProcessingUnitInstance.restart()
public ProcessingUnitInstance restartAndWait(long timeout, TimeUnit timeUnit)
ProcessingUnitInstance
restartAndWait
in interface ProcessingUnitInstance
ProcessingUnitInstance.restart()
public void decrement()
ProcessingUnitInstance
decrement
in interface ProcessingUnitInstance
ProcessingUnit.canDecrementInstance()
public ProcessingUnitInstanceStatistics getLastStatistics()
InternalProcessingUnitInstance
ProcessingUnitInstance.getStatistics()
or
StatisticsMonitor.setStatisticsInterval(long, java.util.concurrent.TimeUnit)
getLastStatistics
in interface InternalProcessingUnitInstance
public ProcessingUnitInstanceStatistics getStatistics()
ProcessingUnitInstance
getStatistics
in interface ProcessingUnitInstance
public void setStatisticsInterval(long interval, TimeUnit timeUnit)
StatisticsMonitor
setStatisticsInterval
in interface StatisticsMonitor
public long getStatisticsIntervalMilliseconds()
getStatisticsIntervalMilliseconds
in interface InternalProcessingUnitInstance
public void setClusterInfo(ClusterInfo clusterInfo)
setClusterInfo
in interface InternalProcessingUnitInstance
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 NIODetails getNIODetails() throws RemoteException
getNIODetails
in interface InternalTransportInfoProvider
RemoteException
public NIOStatistics getNIOStatistics() throws RemoteException
getNIOStatistics
in interface InternalTransportInfoProvider
RemoteException
public void enableLRMIMonitoring() throws RemoteException
enableLRMIMonitoring
in interface InternalTransportInfoProvider
RemoteException
public void disableLRMIMonitoring() throws RemoteException
disableLRMIMonitoring
in interface InternalTransportInfoProvider
RemoteException
public LRMIMonitoringDetails fetchLRMIMonitoringDetails() throws RemoteException
fetchLRMIMonitoringDetails
in interface InternalTransportInfoProvider
RemoteException
public long getCurrentTimeInMillis() throws RemoteException
getCurrentTimeInMillis
in interface InternalOperatingSystemInfoProvider
RemoteException
public OSDetails getOSDetails() throws RemoteException
getOSDetails
in interface InternalOperatingSystemInfoProvider
RemoteException
public OSStatistics getOSStatistics() throws RemoteException
getOSStatistics
in interface InternalOperatingSystemInfoProvider
RemoteException
public JVMStatistics getJVMStatistics() throws RemoteException
getJVMStatistics
in interface InternalVirtualMachineInfoProvider
RemoteException
public void runGc() throws RemoteException
runGc
in interface InternalVirtualMachineInfoProvider
RemoteException
public Future<Object> invoke(String serviceBeanName, Map<String,Object> namedArgs)
invoke
in interface InternalProcessingUnitInstance
public boolean isUndeploying()
isUndeploying
in interface InternalProcessingUnitInstance
public void setMemberAliveIndicatorStatus(org.jini.rio.monitor.ServiceFaultDetectionEvent serviceFaultDetectionEvent)
setMemberAliveIndicatorStatus
in interface InternalProcessingUnitInstance
public MemberAliveIndicatorStatus getMemberAliveIndicatorStatus()
getMemberAliveIndicatorStatus
in interface ProcessingUnitInstance
Copyright © GigaSpaces.