Class MainCacheMBeanImpl

  • All Implemented Interfaces:
    MainCacheMBean, org.springframework.beans.factory.InitializingBean

    @ManagedResource(description="Overview of the main cache of the hybris platform.")
    public class MainCacheMBeanImpl
    extends AbstractJMXMBean
    implements MainCacheMBean
    hybris MBean. Shows statistics for the hybris platform main cache.
    • Constructor Detail

      • MainCacheMBeanImpl

        public MainCacheMBeanImpl()
    • Method Detail

      • getMaximumCacheSize

        @ManagedAttribute(description="The maximum number of cache entries. When it is exceeded, the cache mechanism removes the least recently used entries before adding new ones.")
        public java.lang.Integer getMaximumCacheSize()
        Specified by:
        getMaximumCacheSize in interface MainCacheMBean
        Returns:
        the maximum cache size.
      • getCurrentCacheSize

        @ManagedAttribute(description="Current amount of entries in internal cache.")
        public java.lang.Integer getCurrentCacheSize()
        Specified by:
        getCurrentCacheSize in interface MainCacheMBean
        Returns:
        the current cache size.
      • getCurrentCacheSizeInPercent

        @ManagedAttribute(description="Current size of the internal cache in percent, related to maximumCacheSize.")
        public java.lang.Integer getCurrentCacheSizeInPercent()
        Specified by:
        getCurrentCacheSizeInPercent in interface MainCacheMBean
        Returns:
        the current cache size as percent value (0 - 100). Related to maximum cahce size.
      • getMaxReachedCacheSize

        @ManagedAttribute(description="The maximum number of cache entries reached since the cache creation and reseted when clearCache is called.")
        public java.lang.Integer getMaxReachedCacheSize()
        Specified by:
        getMaxReachedCacheSize in interface MainCacheMBean
        Returns:
        the maximum reached entities number of the cache. Related to MainCacheMBean.getCurrentCacheSize()
      • getMaxReachedCacheSizeInPercent

        @ManagedAttribute(description="The maximum number of cache entries in percent (related to maximumCacheSize), reached since the cache creation or a last clear.")
        public java.lang.Integer getMaxReachedCacheSizeInPercent()
        Specified by:
        getMaxReachedCacheSizeInPercent in interface MainCacheMBean
        Returns:
        the maximum reached entities number in percent (0 - 100) (related to maximumCacheSize)
      • getEntitiesGetCount

        @ManagedAttribute(description="The number of entities requested from the cache since its creation or a last clear.")
        public java.lang.Long getEntitiesGetCount()
        Specified by:
        getEntitiesGetCount in interface MainCacheMBean
        Returns:
        how many entities where requested from the cache since last clear
      • getEntitiesAddCount

        @ManagedAttribute(description="The number of entities added to the cache since creation or last clear.")
        public java.lang.Long getEntitiesAddCount()
        Specified by:
        getEntitiesAddCount in interface MainCacheMBean
        Returns:
        how many entities where added to the cache since creation or last clear
      • getEntitiesRemoveCount

        @ManagedAttribute(description="The number of entities removed from the cache since its creation or the last clear.")
        public java.lang.Long getEntitiesRemoveCount()
        Specified by:
        getEntitiesRemoveCount in interface MainCacheMBean
        Returns:
        how many entities where removed from the cache since last clear
      • getEntitiesMissCount

        @ManagedAttribute(description="The number of entities not existing in cache that were requested since a last clear.")
        public java.lang.Long getEntitiesMissCount()
        Specified by:
        getEntitiesMissCount in interface MainCacheMBean
        Returns:
        how many entities where requested but wasn't in the cache since creation or last clear
      • getEntitiesMissCountInPercent

        @ManagedAttribute(description="The number of entities which were requested but wasn\'t in the cache in percent.")
        public java.lang.Long getEntitiesMissCountInPercent()
        Specified by:
        getEntitiesMissCountInPercent in interface MainCacheMBean
        Returns:
        in percent how many entities were requested but wasn't in the cache since creation or last clear.
      • clearCache

        @ManagedOperation(description="Clears the internal cache and the cache statistics.")
        public void clearCache()
        Description copied from interface: MainCacheMBean
        clears the cache and the statistics.
        Specified by:
        clearCache in interface MainCacheMBean
      • startCacheStatistics

        @ManagedOperation(description="Starts collecting data for the cache statistics.")
        public java.lang.String startCacheStatistics()
        Description copied from interface: MainCacheMBean
        Starts the collecting of the cache statistics.
        Specified by:
        startCacheStatistics in interface MainCacheMBean
        Returns:
        a status information if this was successful or not.
      • stopCacheStatistics

        @ManagedOperation(description="Stops collecting data for the cache statistics.")
        public java.lang.String stopCacheStatistics()
        Description copied from interface: MainCacheMBean
        Stops the collection of the cache statistics.
        Specified by:
        stopCacheStatistics in interface MainCacheMBean
        Returns:
        a status information if this was successful or not.
      • showCacheStatistics

        @ManagedOperation(description="Shows the cache statistics.")
        @ManagedOperationParameter(name="lowerBound",description="lower key ratio in percent") @ManagedOperationParameter(name="upperBound",description="upper key ratio in percent")
        public java.util.Collection<java.lang.String> showCacheStatistics​(int lowerBound,
                                                                          int upperBound)
        Description copied from interface: MainCacheMBean
        Returns a collection with the cache statistics.
        Specified by:
        showCacheStatistics in interface MainCacheMBean
        Parameters:
        lowerBound - the lower bound the the returned collection. Each entry factor is greater or equal.
        upperBound - the upper bound for the returned collection. Each entry factor is equal or less.
        Returns:
        a collection with the informations