Class DefaultStatisticsService
- java.lang.Object
-
- de.hybris.platform.servicelayer.stats.DefaultStatisticsService
-
- All Implemented Interfaces:
StatisticsService,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean
public class DefaultStatisticsService extends java.lang.Object implements StatisticsService, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
Default StatisticsService for collecting data for use in hAC-charts.
-
-
Constructor Summary
Constructors Constructor Description DefaultStatisticsService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddChart(StatisticsChart chart)Adds allStatisticsCollectors inStatisticsChartchart to the StatisticsService.booleanaddCollector(BasicStatisticsCollector collector)Adds theStatisticsCollectorcollector to the StatisticsService.voidafterPropertiesSet()Finish initializing, register the not yet registered collectors in collector map and chart map at dataholder and start the StatDaemon-Thread, when DefaultStatisticsService was created by Spring.voiddestroy()Stop the StatisticsDaemon-Thread.StatisticsChartgetChart(java.lang.String name)Returns theStatisticsChartidentified by name, if available.booleanremoveChart(java.lang.String name)Removes allStatisticsCollectors contained inStatisticsChartidentified by name.booleanremoveCollector(java.lang.String name)Removes theStatisticsCollectoridentified by name to the StatisticsService.voidsetCharts(java.util.Collection<StatisticsChart> charts)voidsetCollectors(java.util.Collection<BasicStatisticsCollector> collectors)voidsetDataHolder(StatisticsData dataHolder)voidsetInterval(long interval)voidsetStandaloneEnabled(boolean standaloneEnabled)
-
-
-
Method Detail
-
setInterval
public void setInterval(long interval)
-
setDataHolder
public void setDataHolder(StatisticsData dataHolder)
-
addCollector
public boolean addCollector(BasicStatisticsCollector collector)
Description copied from interface:StatisticsServiceAdds theStatisticsCollectorcollector to the StatisticsService.- Specified by:
addCollectorin interfaceStatisticsService- Parameters:
collector- The StatisticsCollector to add to the StatisticsSerice.- Returns:
- boolean Indicating, if Adding was successful.
-
removeCollector
public boolean removeCollector(java.lang.String name)
Description copied from interface:StatisticsServiceRemoves theStatisticsCollectoridentified by name to the StatisticsService.- Specified by:
removeCollectorin interfaceStatisticsService- Parameters:
name- The name of the new StatisticsService to remove.- Returns:
- boolean Indicating, if Removal was successful.
-
addChart
public boolean addChart(StatisticsChart chart)
Description copied from interface:StatisticsServiceAdds allStatisticsCollectors inStatisticsChartchart to the StatisticsService.- Specified by:
addChartin interfaceStatisticsService- Parameters:
chart- The StatisticsChart containing the collectors that should be add.- Returns:
- boolean Indicating, if Adding was successful.
-
removeChart
public boolean removeChart(java.lang.String name)
Description copied from interface:StatisticsServiceRemoves allStatisticsCollectors contained inStatisticsChartidentified by name.- Specified by:
removeChartin interfaceStatisticsService- Parameters:
name- The name of the StatisticsChart containing the StatisticsCollectors to remove.- Returns:
- boolean Indicating, if Removal was successful.
-
destroy
public void destroy()
Stop the StatisticsDaemon-Thread.- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean
-
afterPropertiesSet
public void afterPropertiesSet()
Finish initializing, register the not yet registered collectors in collector map and chart map at dataholder and start the StatDaemon-Thread, when DefaultStatisticsService was created by Spring.- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
getChart
public StatisticsChart getChart(java.lang.String name)
Description copied from interface:StatisticsServiceReturns theStatisticsChartidentified by name, if available. Otherwise returns null.- Specified by:
getChartin interfaceStatisticsService
-
setCharts
public void setCharts(java.util.Collection<StatisticsChart> charts)
-
setCollectors
public void setCollectors(java.util.Collection<BasicStatisticsCollector> collectors)
-
setStandaloneEnabled
public void setStandaloneEnabled(boolean standaloneEnabled)
-
-