Search in sources :

Example 41 with OpenDataException

use of javax.management.openmbean.OpenDataException in project geode by apache.

the class Region method listRegionAttributes.

@Override
public CompositeData listRegionAttributes() {
    String value = JMXProperties.getInstance().getProperty(getKey("listRegionAttributes"), "");
    String[] itemValues = value.split(",");
    Map<String, Object> itemValuesHM = new HashMap<String, Object>();
    // compressionCodec
    if (null != itemValues[0]) {
        itemValuesHM.put(regAttItemNames[0], itemValues[0]);
    }
    // enableOffHeapMemory
    if (null != itemValues[1]) {
        itemValuesHM.put(regAttItemNames[1], Boolean.parseBoolean(itemValues[1]));
    }
    // scope
    if (null != itemValues[3]) {
        itemValuesHM.put(regAttItemNames[3], itemValues[3]);
    }
    // diskStoreName
    if (null != itemValues[4]) {
        itemValuesHM.put(regAttItemNames[4], itemValues[4]);
    }
    // diskSynchronous
    if (null != itemValues[5]) {
        itemValuesHM.put(regAttItemNames[5], Boolean.parseBoolean(itemValues[5]));
    }
    CompositeData lraCompData;
    try {
        lraCompData = new CompositeDataSupport(listRegionAttributesCompData, itemValuesHM);
    } catch (OpenDataException e) {
        e.printStackTrace();
        lraCompData = null;
    }
    return lraCompData;
}
Also used : HashMap(java.util.HashMap) OpenDataException(javax.management.openmbean.OpenDataException) CompositeData(javax.management.openmbean.CompositeData) CompositeDataSupport(javax.management.openmbean.CompositeDataSupport)

Example 42 with OpenDataException

use of javax.management.openmbean.OpenDataException in project jackrabbit-oak by apache.

the class ConsolidatedDataStoreCacheStats method getCacheStats.

@Override
public TabularData getCacheStats() {
    TabularDataSupport tds;
    try {
        TabularType tt = new TabularType(CacheStatsData.class.getName(), "Consolidated DataStore Cache Stats", CacheStatsData.TYPE, new String[] { "name" });
        tds = new TabularDataSupport(tt);
        for (DataStoreCacheStatsMBean stats : cacheStats) {
            tds.put(new CacheStatsData(stats).toCompositeData());
        }
    } catch (OpenDataException e) {
        throw new IllegalStateException(e);
    }
    return tds;
}
Also used : ConsolidatedDataStoreCacheStatsMBean(org.apache.jackrabbit.oak.api.jmx.ConsolidatedDataStoreCacheStatsMBean) OpenDataException(javax.management.openmbean.OpenDataException) TabularDataSupport(javax.management.openmbean.TabularDataSupport) TabularType(javax.management.openmbean.TabularType)

Example 43 with OpenDataException

use of javax.management.openmbean.OpenDataException in project jackrabbit-oak by apache.

the class AbstractCheckpointMBean method listCheckpoints.

@Override
public TabularData listCheckpoints() {
    try {
        TabularDataSupport tab = new TabularDataSupport(new TabularType(getTypeName(), "Checkpoints", createCompositeType(), new String[] { "id" }));
        collectCheckpoints(tab);
        return tab;
    } catch (OpenDataException e) {
        throw new IllegalStateException(e);
    }
}
Also used : OpenDataException(javax.management.openmbean.OpenDataException) TabularDataSupport(javax.management.openmbean.TabularDataSupport) TabularType(javax.management.openmbean.TabularType)

Example 44 with OpenDataException

use of javax.management.openmbean.OpenDataException in project jackrabbit-oak by apache.

the class ConsolidatedCacheStats method getCacheStats.

@Override
public TabularData getCacheStats() {
    TabularDataSupport tds;
    try {
        TabularType tt = new TabularType(CacheStatsData.class.getName(), "Consolidated Cache Stats", CacheStatsData.TYPE, new String[] { "name" });
        tds = new TabularDataSupport(tt);
        for (CacheStatsMBean stats : cacheStats.getServices()) {
            tds.put(new CacheStatsData(stats).toCompositeData());
        }
        for (CacheStatsMBean stats : persistentCacheStats.getServices()) {
            tds.put(new CacheStatsData(stats).toCompositeData());
        }
    } catch (OpenDataException e) {
        throw new IllegalStateException(e);
    }
    return tds;
}
Also used : OpenDataException(javax.management.openmbean.OpenDataException) TabularDataSupport(javax.management.openmbean.TabularDataSupport) TabularType(javax.management.openmbean.TabularType) ConsolidatedCacheStatsMBean(org.apache.jackrabbit.oak.api.jmx.ConsolidatedCacheStatsMBean) CacheStatsMBean(org.apache.jackrabbit.oak.api.jmx.CacheStatsMBean) PersistentCacheStatsMBean(org.apache.jackrabbit.oak.api.jmx.PersistentCacheStatsMBean)

Example 45 with OpenDataException

use of javax.management.openmbean.OpenDataException in project jackrabbit-oak by apache.

the class TrackingCorruptIndexHandler method getFailingIndexStats.

//~-----------------------------------------------------< MBean Support >
public TabularData getFailingIndexStats(String asyncName) {
    TabularDataSupport tds;
    try {
        TabularType tt = new TabularType(TrackingCorruptIndexHandler.class.getName(), "Failing Index Stats", FailingIndexStats.TYPE, new String[] { "path" });
        tds = new TabularDataSupport(tt);
        Map<String, CorruptIndexInfo> infos = getFailingIndexData(asyncName);
        for (Map.Entry<String, CorruptIndexInfo> e : infos.entrySet()) {
            FailingIndexStats stats = new FailingIndexStats(e.getValue());
            tds.put(stats.toCompositeData());
        }
    } catch (OpenDataException e) {
        throw new IllegalStateException(e);
    }
    return tds;
}
Also used : OpenDataException(javax.management.openmbean.OpenDataException) TabularDataSupport(javax.management.openmbean.TabularDataSupport) TabularType(javax.management.openmbean.TabularType) Map(java.util.Map)

Aggregations

OpenDataException (javax.management.openmbean.OpenDataException)51 CompositeDataSupport (javax.management.openmbean.CompositeDataSupport)24 TabularDataSupport (javax.management.openmbean.TabularDataSupport)22 TabularType (javax.management.openmbean.TabularType)22 CompositeType (javax.management.openmbean.CompositeType)21 CompositeData (javax.management.openmbean.CompositeData)17 OpenType (javax.management.openmbean.OpenType)15 ObjectName (javax.management.ObjectName)8 HashMap (java.util.HashMap)6 Map (java.util.Map)5 MBeanServer (javax.management.MBeanServer)5 TabularData (javax.management.openmbean.TabularData)5 ArrayType (javax.management.openmbean.ArrayType)4 InvalidObjectException (java.io.InvalidObjectException)3 SortedMap (java.util.SortedMap)3 JMException (javax.management.JMException)3 StandardMBean (javax.management.StandardMBean)3 IOException (java.io.IOException)2 GenericArrayType (java.lang.reflect.GenericArrayType)2 Method (java.lang.reflect.Method)2