Example usage for javax.management.openmbean SimpleType STRING

List of usage examples for javax.management.openmbean SimpleType STRING

Introduction

In this page you can find the example usage for javax.management.openmbean SimpleType STRING.

Prototype

SimpleType STRING

To view the source code for javax.management.openmbean SimpleType STRING.

Click Source Link

Document

The SimpleType instance describing values whose Java class name is java.lang.String.

Usage

From source file:com.seajas.search.profiler.service.management.ManagementService.java

/**
 * {@inheritDoc}/*from   www . j a v  a  2  s.  c  o  m*/
 */
@Override
public CompositeData getLoggingCount() throws OpenDataException {
    Integer count = profilerService.getLoggingCount();

    // Return the compound status as the number of messages

    CompositeType compositeType = new CompositeType("managementResult", "Management result",
            new String[] { "compound", "status" }, new String[] { "Compound value", "Textual representation" },
            new OpenType[] { SimpleType.INTEGER, SimpleType.STRING });

    return new CompositeDataSupport(compositeType, new String[] { "compound", "status" },
            new Object[] { count, "The logging table contains " + count + " entries" });
}

From source file:com.adobe.acs.commons.httpcache.store.mem.impl.MemHttpCacheStoreImpl.java

@Override
@SuppressWarnings("squid:S1192")
protected CompositeType getCacheEntryType() throws OpenDataException {
    return new CompositeType(JMX_PN_CACHEENTRY, JMX_PN_CACHEENTRY,
            new String[] { JMX_PN_CACHEKEY, JMX_PN_STATUS, JMX_PN_SIZE, JMX_PN_CONTENTTYPE, JMX_PN_CHARENCODING,
                    JMX_PN_HITS, JMX_PN_TOTALSIZESERVED },
            new String[] { JMX_PN_CACHEKEY, JMX_PN_STATUS, JMX_PN_SIZE, JMX_PN_CONTENTTYPE, JMX_PN_CHARENCODING,
                    JMX_PN_HITS, JMX_PN_TOTALSIZESERVED },
            new OpenType[] { SimpleType.STRING, SimpleType.INTEGER, SimpleType.STRING, SimpleType.STRING,
                    SimpleType.STRING, SimpleType.INTEGER, SimpleType.STRING });

}

From source file:com.seajas.search.profiler.service.management.ManagementService.java

/**
 * {@inheritDoc}//www . j  a va2s . com
 */
@Override
public CompositeData getElementCacheCount() throws OpenDataException {
    Integer count = cacheService.getCacheCounts().get("elementCache");

    // Return the compound status as the number of messages

    CompositeType compositeType = new CompositeType("managementResult", "Management result",
            new String[] { "compound", "status" }, new String[] { "Compound value", "Textual representation" },
            new OpenType[] { SimpleType.INTEGER, SimpleType.STRING });

    return new CompositeDataSupport(compositeType, new String[] { "compound", "status" },
            new Object[] { count, "The queue cache contains " + count + " entries" });
}

From source file:com.seajas.search.profiler.service.management.ManagementService.java

/**
 * {@inheritDoc}/*from  w w w .  ja  va2 s  . co m*/
 */
@Override
public CompositeData getDeleteCacheCount() throws OpenDataException {
    Integer count = cacheService.getCacheCounts().get("deleteCache");

    // Return the compound status as the number of messages

    CompositeType compositeType = new CompositeType("managementResult", "Management result",
            new String[] { "compound", "status" }, new String[] { "Compound value", "Textual representation" },
            new OpenType[] { SimpleType.INTEGER, SimpleType.STRING });

    return new CompositeDataSupport(compositeType, new String[] { "compound", "status" },
            new Object[] { count, "The delete cache contains " + count + " entries" });
}

From source file:org.jolokia.converter.json.TabularDataExtractor.java

private Object getKey(CompositeType rowType, String key, String value) {
    OpenType keyType = rowType.getType(key);
    if (SimpleType.STRING == keyType) {
        return value;
    } else if (SimpleType.INTEGER == keyType) {
        return Integer.parseInt(value);
    } else if (SimpleType.LONG == keyType) {
        return Long.parseLong(value);
    } else if (SimpleType.SHORT == keyType) {
        return Short.parseShort(value);
    } else if (SimpleType.BYTE == keyType) {
        return Byte.parseByte(value);
    } else if (SimpleType.OBJECTNAME == keyType) {
        try {/*from www .  ja v  a  2s  . c  o m*/
            return new ObjectName(value);
        } catch (MalformedObjectNameException e) {
            throw new IllegalArgumentException("Can not convert " + value + " to an ObjectName", e);
        }
    } else {
        throw new IllegalArgumentException(
                "All keys must be a string, integer, long, short, byte or ObjectName type for accessing TabularData via a path. "
                        + "This is not the case for '" + key + "' which is of type " + keyType);
    }
}

From source file:com.adobe.acs.commons.rewriter.impl.VersionedClientlibsTransformerFactory.java

@Override
@SuppressWarnings("squid:S1192")
protected CompositeType getCacheEntryType() throws OpenDataException {
    return new CompositeType(JMX_PN_CACHEENTRY, JMX_PN_CACHEENTRY, new String[] { JMX_PN_CACHEKEY, "Value" },
            new String[] { JMX_PN_CACHEKEY, "Value" }, new OpenType[] { SimpleType.STRING, SimpleType.STRING });
}

From source file:com.adobe.acs.commons.httpcache.store.jcr.impl.JCRHttpCacheStoreImpl.java

protected CompositeType getCacheEntryType() throws OpenDataException {
    return new CompositeType(JMX_PN_CACHEENTRY, JMX_PN_CACHEENTRY,
            new String[] { JMX_PN_CACHEKEY, JMX_PN_STATUS, JMX_PN_SIZE, JMX_PN_CONTENTTYPE,
                    JMX_PN_CHARENCODING },
            new String[] { JMX_PN_CACHEKEY, JMX_PN_STATUS, JMX_PN_SIZE, JMX_PN_CONTENTTYPE,
                    JMX_PN_CHARENCODING },
            new OpenType[] { SimpleType.STRING, SimpleType.INTEGER, SimpleType.STRING, SimpleType.STRING,
                    SimpleType.STRING });

}

From source file:com.adobe.acs.commons.httpcache.engine.impl.HttpCacheEngineImpl.java

@Override
public TabularData getRegisteredHttpCacheRules() throws OpenDataException {
    // @formatter:off
    final CompositeType cacheEntryType = new CompositeType(JMX_HTTPCACHE_HANDLING_RULE,
            JMX_HTTPCACHE_HANDLING_RULE, new String[] { JMX_HTTPCACHE_HANDLING_RULE },
            new String[] { JMX_HTTPCACHE_HANDLING_RULE }, new OpenType[] { SimpleType.STRING });

    final TabularDataSupport tabularData = new TabularDataSupport(
            new TabularType(JMX_PN_HTTPCACHE_HANDLING_RULES, JMX_PN_HTTPCACHE_HANDLING_RULES, cacheEntryType,
                    new String[] { JMX_HTTPCACHE_HANDLING_RULE }));
    // @formatter:on

    for (final Map.Entry<String, HttpCacheHandlingRule> entry : cacheHandlingRules.entrySet()) {
        final Map<String, Object> row = new HashMap<String, Object>();

        row.put(JMX_HTTPCACHE_HANDLING_RULE, entry.getValue().getClass().getName());
        tabularData.put(new CompositeDataSupport(cacheEntryType, row));
    }/*from w  ww.  j  a  v a 2 s  . c o  m*/

    return tabularData;
}

From source file:com.alibaba.dragoon.stat.WebURIStatistic.java

public static CompositeType getCompositeType() throws JMException {

    OpenType<?>[] indexTypes = new OpenType<?>[] {
            ////from ww w .j a v  a2 s. c om
            SimpleType.LONG, SimpleType.STRING, SimpleType.INTEGER, SimpleType.INTEGER, SimpleType.LONG, // count
            SimpleType.LONG, SimpleType.LONG, SimpleType.LONG, SimpleType.STRING, SimpleType.STRING, // LastErrorClass
            SimpleType.STRING, SimpleType.DATE, SimpleType.STRING, SimpleType.DATE, SimpleType.STRING // LastErrorUser
            , SimpleType.LONG, SimpleType.LONG, SimpleType.LONG, SimpleType.LONG, SimpleType.LONG, // LastErrorUser
            SimpleType.LONG, new ArrayType<Long>(SimpleType.LONG, true),
            new ArrayType<CompositeType>(1, Profiler.EntryStatistic.getCompositeType())//
            , SimpleType.STRING //
            //
            , SimpleType.LONG, SimpleType.LONG, SimpleType.LONG//
            //
            , SimpleType.LONG, SimpleType.LONG, SimpleType.LONG, SimpleType.LONG, SimpleType.LONG //
            , SimpleType.LONG, SimpleType.LONG, SimpleType.LONG, SimpleType.LONG, SimpleType.LONG//
            , SimpleType.LONG, SimpleType.LONG, SimpleType.LONG, SimpleType.LONG //
            , new ArrayType<Integer>(SimpleType.INTEGER, true), SimpleType.LONG };

    String[] indexNames = { //
            //
            "ID", "URI", "RunningCount", "ConcurrentMax", "Count", //
            "ErrorCount", "TotalTime", "MaxTime", "LastErrorMessage", "LastErrorClass" //
            , "LastErrorStackTrace", "LastErrorTime", "LastErrorReferer", "LastAccessedTime", "LastErrorUser" //
            , "JdbcExecuteCount", "JdbcFetchRowCount", "JdbcFetchRowPeak", "JdbcUpdateCount", "JdbcCommitCount" //
            , "JdbcRollbackCount", "Histogram", "ProfileEntries", "LastErrorUrl" // added by wangye

            , "OSMacOSXCount", "OSWindowsCount", "OSLinuxCount", "BrowserIE6Count", "BrowserIE7Count",
            "BrowserIE8Count", "BrowserIE9Count", "BrowserIE10Count", "BrowserIECount", "BrowserFirefoxCount",
            "BrowserChromeCount", "BrowserSafariCount", "BrowserOperaCount", "DeviceAndroidCount",
            "DeviceIpadCount", "DeviceIphoneCount", "DeviceWindowsPhoneCount" //
            , "IP", "JdbcTransactionMillis" };
    String[] indexDescriptions = indexNames;
    return new CompositeType("URIStatistic", "URI Statistic", indexNames, indexDescriptions, indexTypes);
}

From source file:com.adobe.acs.commons.httpcache.engine.impl.HttpCacheEngineImpl.java

@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 }));

    // @formatter:on

    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));
    }//from  w  w w .jav a 2 s.  co m

    return tabularData;
}