Package javax.management.openmbean

Examples of javax.management.openmbean.CompositeType.keySet()


    }

    @Override
    public TabularData getConnectionList() throws JMException {
        CompositeType rowType = JdbcConnectionStat.Entry.getCompositeType();
        String[] indexNames = rowType.keySet().toArray(new String[rowType.keySet().size()]);

        TabularType tabularType = new TabularType("ConnectionListStatistic", "ConnectionListStatistic", rowType,
                                                  indexNames);
        TabularData data = new TabularDataSupport(tabularType);
View Full Code Here


        return resetCount.get();
    }

    public TabularData getDataSourceList() throws JMException {
        CompositeType rowType = getDruidDataSourceCompositeType();
        String[] indexNames = rowType.keySet().toArray(new String[rowType.keySet().size()]);

        TabularType tabularType = new TabularType("DruidDataSourceStat", "DruidDataSourceStat", rowType, indexNames);
        TabularData data = new TabularDataSupport(tabularType);

        final Set<DruidDataSource> dataSources = getDruidDataSourceInstances();
View Full Code Here

        return resetCount.get();
    }

    public TabularData getDataSourceList() throws JMException {
        CompositeType rowType = getDruidDataSourceCompositeType();
        String[] indexNames = rowType.keySet().toArray(new String[rowType.keySet().size()]);

        TabularType tabularType = new TabularType("DruidDataSourceStat", "DruidDataSourceStat", rowType, indexNames);
        TabularData data = new TabularDataSupport(tabularType);

        final Set<DruidDataSource> dataSources = getDruidDataSourceInstances();
View Full Code Here

        if (propertyPrefix == null)
            propertyPrefix = "";
        if (result instanceof CompositeDataSupport) {
            CompositeDataSupport data = (CompositeDataSupport) result;
            CompositeType compositeType = data.getCompositeType();
            Set keys = compositeType.keySet();
            for (Iterator iter = keys.iterator(); iter.hasNext();) {
                String key = (String) iter.next();
                Object value = data.get(key);
                OpenType type = compositeType.getType(key);
                if (type instanceof SimpleType) {
View Full Code Here

        Boolean b = (Boolean)value;
        jg.writeBoolean(b);
      } else if(value instanceof CompositeData) {
        CompositeData cds = (CompositeData)value;
        CompositeType comp = cds.getCompositeType();
        Set<String> keys = comp.keySet();
        jg.writeStartObject();
        for(String key: keys) {
          writeAttribute(jg, key, cds.get(key));
        }
        jg.writeEndObject();
View Full Code Here

public class JmxInstanceTest extends TestCase {
    public void testJMXInstanceStatics() {
        CompositeType it = JmxInstance.INSTANCE;
        Assert.assertEquals(
            new HashSet<String>(Arrays.asList(AdminServiceMBean.INSTANCE)),
            it.keySet());

        TabularType tt = JmxInstance.INSTANCE_TABLE;
        Assert.assertEquals("Instances", tt.getTypeName());
    }
View Full Code Here

        buf.append("Composite data:\n");

        final CompositeData data = (CompositeData) o;
        final CompositeType type = data.getCompositeType();

        final Set keySet = type.keySet();
        final Iterator iter = keySet.iterator();
        while (iter.hasNext())
        {
            final String key = (String) iter.next();
            final Object item = data.get(key);
View Full Code Here

     */
    public static Map<String, Serializable> compositeDataToMap(final CompositeData data)
    {
        final Map<String, Serializable> map = new HashMap<String, Serializable>();
        final CompositeType type = data.getCompositeType();
        final Set<String> keySet = TypeCast.asSet(type.keySet());

        for (String name : keySet)
        {
            map.put(name, (Serializable) data.get(name));
        }
View Full Code Here

        if (propertyPrefix == null)
            propertyPrefix = "";
        if (result instanceof CompositeDataSupport) {
            CompositeDataSupport data = (CompositeDataSupport) result;
            CompositeType compositeType = data.getCompositeType();
            Set keys = compositeType.keySet();
            for (Iterator iter = keys.iterator(); iter.hasNext();) {
                String key = (String) iter.next();
                Object value = data.get(key);
                OpenType type = compositeType.getType(key);
                if (type instanceof SimpleType) {
View Full Code Here

        if (propertyPrefix == null)
            propertyPrefix = "";
        if (result instanceof CompositeDataSupport) {
            CompositeDataSupport data = (CompositeDataSupport) result;
            CompositeType compositeType = data.getCompositeType();
            Set<String> keys = compositeType.keySet();
            for (Iterator<String> iter = keys.iterator(); iter.hasNext();) {
                String key = iter.next();
                Object value = data.get(key);
                OpenType<?> type = compositeType.getType(key);
                if (type instanceof SimpleType<?>) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.