Class JCoConnectionsSnapshotClusterHandler
java.lang.Object
de.hybris.platform.servicelayer.event.impl.AbstractEventListener<JCoConnectionsSnapshotClusterResultEvent>
de.hybris.platform.sap.core.jco.monitor.event.JCoConnectionsSnapshotClusterHandler
- All Implemented Interfaces:
JCoConnectionMonitor,EventListener,org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener<JCoConnectionsSnapshotClusterResultEvent>
public class JCoConnectionsSnapshotClusterHandler
extends de.hybris.platform.servicelayer.event.impl.AbstractEventListener<JCoConnectionsSnapshotClusterResultEvent>
implements JCoConnectionMonitor
Initiates the snapshot of all cluster and collects the result if requested.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCheck current state of snapshot in buffer and refreshes it if lifetime is outdated.protected StringcreateClusterSnapshot(boolean withFile, boolean updateCache) Initiates the creation of one jco connections snapshot file for all cluster.Create JCo connections snapshot file operation.Returns all current JCo connections as XML String.protected voidfinalizeSnapshot(String snapshotUuid) Finalize snapshot.Returns the snapshot buffer valid to time stamp.Returns the snapshot time stamp.Returns the number of JCo connections whose lifetime exceed a specific threshold parameter.Returns the total number of nodes of the result.Returns the total number of nodes with result of the result.Returns number of RFC destinations whose pool size is reached.Returns the total number of JCo connections.booleanReturns an indicator whether a snapshot is currently in creation.protected voidvoidResets the snapshot buffer.voidsetCacheLifetimeInSeconds(long cacheLifetimeInSeconds) Injection setter for cache lifetime.voidsetCollectionTimeoutInSeconds(long collectionTimeoutInSeconds) Injection setter for collection timeout.voidsetEventService(de.hybris.platform.servicelayer.event.EventService eventService) Injection setter forEventService.voidsetJCoConnectionMonitorClusterProvider(JCoConnectionMonitorClusterProvider jcoConnectionMonitorClusterProvider) Injection setter forJCoConnectionMonitorClusterProvider.Methods inherited from class de.hybris.platform.servicelayer.event.impl.AbstractEventListener
afterPropertiesSet, onApplicationEvent, setApplicationContext, setClusterService, setTenantService
-
Constructor Details
-
JCoConnectionsSnapshotClusterHandler
public JCoConnectionsSnapshotClusterHandler()
-
-
Method Details
-
setEventService
public void setEventService(de.hybris.platform.servicelayer.event.EventService eventService) Injection setter forEventService.- Parameters:
eventService- the eventService to set
-
setJCoConnectionMonitorClusterProvider
public void setJCoConnectionMonitorClusterProvider(JCoConnectionMonitorClusterProvider jcoConnectionMonitorClusterProvider) Injection setter forJCoConnectionMonitorClusterProvider.- Parameters:
jcoConnectionMonitorClusterProvider- the jcoConnectionMonitorClusterProvider to set
-
setCollectionTimeoutInSeconds
public void setCollectionTimeoutInSeconds(long collectionTimeoutInSeconds) Injection setter for collection timeout.- Parameters:
collectionTimeoutInSeconds- collection timeout in seconds
-
setCacheLifetimeInSeconds
public void setCacheLifetimeInSeconds(long cacheLifetimeInSeconds) Injection setter for cache lifetime.- Parameters:
cacheLifetimeInSeconds- cache lifetime in seconds
-
createSnapshotFile
Description copied from interface:JCoConnectionMonitorCreate JCo connections snapshot file operation.- Specified by:
createSnapshotFilein interfaceJCoConnectionMonitor- Returns:
- result message
-
createSnapshotXML
Description copied from interface:JCoConnectionMonitorReturns all current JCo connections as XML String.- Specified by:
createSnapshotXMLin interfaceJCoConnectionMonitor- Returns:
- XML String
-
getTotalCount
Description copied from interface:JCoConnectionMonitorReturns the total number of JCo connections.- Specified by:
getTotalCountin interfaceJCoConnectionMonitor- Returns:
- number of JCo connections
-
getLongRunnerCount
Description copied from interface:JCoConnectionMonitorReturns the number of JCo connections whose lifetime exceed a specific threshold parameter. The threshold parameter is defined in the project.properties file. Its default value is the same as the value of the default session timeout (3600 seconds).- Specified by:
getLongRunnerCountin interfaceJCoConnectionMonitor- Returns:
- number of JCo connections whose lifetime exceed the defined threshold
-
getPoolLimitReachedCount
Description copied from interface:JCoConnectionMonitorReturns number of RFC destinations whose pool size is reached.- Specified by:
getPoolLimitReachedCountin interfaceJCoConnectionMonitor- Returns:
- number of RFC destinations whose pool size is reached
-
getNodesCount
Returns the total number of nodes of the result.- Returns:
- number of nodes
-
getNodesWithoutResultCount
Returns the total number of nodes with result of the result.- Returns:
- number of nodes without result
-
getCacheTimestamp
Returns the snapshot time stamp.- Returns:
- snapshot time stamp
-
getCacheExpirationTimestamp
Returns the snapshot buffer valid to time stamp.- Returns:
- snapshot valid to time stamp
-
resetCache
public void resetCache()Resets the snapshot buffer. -
isSnapshotInProcess
public boolean isSnapshotInProcess()Returns an indicator whether a snapshot is currently in creation.- Returns:
- snapshot in process indicator
-
checkState
protected void checkState()Check current state of snapshot in buffer and refreshes it if lifetime is outdated. -
createClusterSnapshot
Initiates the creation of one jco connections snapshot file for all cluster.- Parameters:
withFile- create snapshot fileupdateCache- update cache indicator- Returns:
- status message
-
finalizeSnapshot
Finalize snapshot.- Parameters:
snapshotUuid- snapshot uuid- Throws:
JCoMonitorException-JCoMonitorException
-
onEvent
- Specified by:
onEventin classde.hybris.platform.servicelayer.event.impl.AbstractEventListener<JCoConnectionsSnapshotClusterResultEvent>
-