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,java.util.EventListener,org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener<JCoConnectionsSnapshotClusterResultEvent>
public class JCoConnectionsSnapshotClusterHandler extends AbstractEventListener<JCoConnectionsSnapshotClusterResultEvent> implements JCoConnectionMonitor
Initiates the snapshot of all cluster and collects the result if requested.
-
-
Constructor Summary
Constructors Constructor Description JCoConnectionsSnapshotClusterHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckState()Check current state of snapshot in buffer and refreshes it if lifetime is outdated.protected java.lang.StringcreateClusterSnapshot(boolean withFile, boolean updateCache)Initiates the creation of one jco connections snapshot file for all cluster.java.lang.StringcreateSnapshotFile()Create JCo connections snapshot file operation.java.lang.StringcreateSnapshotXML()Returns all current JCo connections as XML String.protected voidfinalizeSnapshot(java.lang.String snapshotUuid)Finalize snapshot.java.util.DategetCacheExpirationTimestamp()Returns the snapshot buffer valid to time stamp.java.util.DategetCacheTimestamp()Returns the snapshot time stamp.java.lang.IntegergetLongRunnerCount()Returns the number of JCo connections whose lifetime exceed a specific threshold parameter.java.lang.IntegergetNodesCount()Returns the total number of nodes of the result.java.lang.IntegergetNodesWithoutResultCount()Returns the total number of nodes with result of the result.java.lang.IntegergetPoolLimitReachedCount()Returns number of RFC destinations whose pool size is reached.java.lang.IntegergetTotalCount()Returns the total number of JCo connections.booleanisSnapshotInProcess()Returns an indicator whether a snapshot is currently in creation.protected voidonEvent(JCoConnectionsSnapshotClusterResultEvent event)This method is called byApplicationListener.onApplicationEvent(ApplicationEvent)and processes the given event.voidresetCache()Resets the snapshot buffer.voidsetCacheLifetimeInSeconds(long cacheLifetimeInSeconds)Injection setter for cache lifetime.voidsetCollectionTimeoutInSeconds(long collectionTimeoutInSeconds)Injection setter for collection timeout.voidsetEventService(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
-
-
-
-
Method Detail
-
setEventService
public void setEventService(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
public java.lang.String createSnapshotFile()
Description copied from interface:JCoConnectionMonitorCreate JCo connections snapshot file operation.- Specified by:
createSnapshotFilein interfaceJCoConnectionMonitor- Returns:
- result message
-
createSnapshotXML
public java.lang.String createSnapshotXML()
Description copied from interface:JCoConnectionMonitorReturns all current JCo connections as XML String.- Specified by:
createSnapshotXMLin interfaceJCoConnectionMonitor- Returns:
- XML String
-
getTotalCount
public java.lang.Integer getTotalCount()
Description copied from interface:JCoConnectionMonitorReturns the total number of JCo connections.- Specified by:
getTotalCountin interfaceJCoConnectionMonitor- Returns:
- number of JCo connections
-
getLongRunnerCount
public java.lang.Integer 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
public java.lang.Integer 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
public java.lang.Integer getNodesCount()
Returns the total number of nodes of the result.- Returns:
- number of nodes
-
getNodesWithoutResultCount
public java.lang.Integer getNodesWithoutResultCount()
Returns the total number of nodes with result of the result.- Returns:
- number of nodes without result
-
getCacheTimestamp
public java.util.Date getCacheTimestamp()
Returns the snapshot time stamp.- Returns:
- snapshot time stamp
-
getCacheExpirationTimestamp
public java.util.Date 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
protected java.lang.String createClusterSnapshot(boolean withFile, boolean updateCache)Initiates the creation of one jco connections snapshot file for all cluster.- Parameters:
withFile- create snapshot fileupdateCache- update cache indicator- Returns:
- status message
-
finalizeSnapshot
protected void finalizeSnapshot(java.lang.String snapshotUuid) throws JCoMonitorExceptionFinalize snapshot.- Parameters:
snapshotUuid- snapshot uuid- Throws:
JCoMonitorException-JCoMonitorException
-
onEvent
protected void onEvent(JCoConnectionsSnapshotClusterResultEvent event)
Description copied from class:AbstractEventListenerThis method is called byApplicationListener.onApplicationEvent(ApplicationEvent)and processes the given event.- Specified by:
onEventin classAbstractEventListener<JCoConnectionsSnapshotClusterResultEvent>- Parameters:
event- the event to be processed- See Also:
ApplicationListener.onApplicationEvent(ApplicationEvent)
-
-