Search in sources :

Example 6 with HttpCacheConfig

use of com.adobe.acs.commons.httpcache.config.HttpCacheConfig in project acs-aem-commons by Adobe-Consulting-Services.

the class HttpCacheEngineImpl method getRegisteredHttpCacheConfigs.

@Override
public TabularData getRegisteredHttpCacheConfigs() throws OpenDataException {
    // @formatter:off
    // Exposing all google guava stats.
    final CompositeType cacheEntryType = new CompositeType(JMX_PN_HTTPCACHE_CONFIG, JMX_PN_HTTPCACHE_CONFIG, new String[] { JMX_PN_ORDER, JMX_PN_OSGICOMPONENT }, new String[] { JMX_PN_ORDER, JMX_PN_OSGICOMPONENT }, new OpenType[] { SimpleType.INTEGER, SimpleType.STRING });
    final TabularDataSupport tabularData = new TabularDataSupport(new TabularType(JMX_PN_HTTPCACHE_CONFIGS, JMX_PN_HTTPCACHE_CONFIGS, cacheEntryType, new String[] { JMX_PN_OSGICOMPONENT }));
    for (HttpCacheConfig cacheConfig : this.cacheConfigs) {
        final Map<String, Object> row = new HashMap<String, Object>();
        Map<String, Object> osgiConfig = cacheConfigConfigs.get(cacheConfig);
        row.put(JMX_PN_ORDER, cacheConfig.getOrder());
        row.put(JMX_PN_OSGICOMPONENT, (String) osgiConfig.get(Constants.SERVICE_PID));
        tabularData.put(new CompositeDataSupport(cacheEntryType, row));
    }
    return tabularData;
}
Also used : ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) TabularDataSupport(javax.management.openmbean.TabularDataSupport) TabularType(javax.management.openmbean.TabularType) CompositeDataSupport(javax.management.openmbean.CompositeDataSupport) HttpCacheConfig(com.adobe.acs.commons.httpcache.config.HttpCacheConfig) CompositeType(javax.management.openmbean.CompositeType)

Aggregations

HttpCacheConfig (com.adobe.acs.commons.httpcache.config.HttpCacheConfig)6 CacheKey (com.adobe.acs.commons.httpcache.keys.CacheKey)3 HttpCacheConfigComparator (com.adobe.acs.commons.httpcache.config.impl.HttpCacheConfigComparator)1 HttpCacheException (com.adobe.acs.commons.httpcache.exception.HttpCacheException)1 HashMap (java.util.HashMap)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)1 CompositeDataSupport (javax.management.openmbean.CompositeDataSupport)1 CompositeType (javax.management.openmbean.CompositeType)1 TabularDataSupport (javax.management.openmbean.TabularDataSupport)1 TabularType (javax.management.openmbean.TabularType)1 SlingHttpServletRequest (org.apache.sling.api.SlingHttpServletRequest)1 SlingHttpServletResponse (org.apache.sling.api.SlingHttpServletResponse)1 DynamicClassLoaderManager (org.apache.sling.commons.classloader.DynamicClassLoaderManager)1