当前位置: 首页>>代码示例>>Java>>正文


Java SimpleType.STRING属性代码示例

本文整理汇总了Java中javax.management.openmbean.SimpleType.STRING属性的典型用法代码示例。如果您正苦于以下问题:Java SimpleType.STRING属性的具体用法?Java SimpleType.STRING怎么用?Java SimpleType.STRING使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.management.openmbean.SimpleType的用法示例。


在下文中一共展示了SimpleType.STRING属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getBaseGcNotifInfoCompositeType

private static synchronized CompositeType getBaseGcNotifInfoCompositeType() {
    if (baseGcNotifInfoCompositeType == null) {
        try {
            OpenType<?>[] baseGcNotifInfoItemTypes = new OpenType<?>[] {
                SimpleType.STRING,
                SimpleType.STRING,
                SimpleType.STRING,
                GcInfoCompositeData.getBaseGcInfoCompositeType()
            };
            baseGcNotifInfoCompositeType =
                new CompositeType("sun.management.BaseGarbageCollectionNotifInfoCompositeType",
                                  "CompositeType for Base GarbageCollectionNotificationInfo",
                                  gcNotifInfoItemNames,
                                  gcNotifInfoItemNames,
                                  baseGcNotifInfoItemTypes);
        } catch (OpenDataException e) {
            // shouldn't reach here
            throw new RuntimeException(e);
        }
    }
    return baseGcNotifInfoCompositeType;
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:22,代码来源:GarbageCollectionNotifInfoCompositeData.java

示例2: getBaseGcNotifInfoCompositeType

private static synchronized CompositeType getBaseGcNotifInfoCompositeType() {
    if (baseGcNotifInfoCompositeType == null) {
        try {
            OpenType<?>[] baseGcNotifInfoItemTypes = new OpenType<?>[] {
                SimpleType.STRING,
                SimpleType.STRING,
                SimpleType.STRING,
                GcInfoCompositeData.getBaseGcInfoCompositeType()
            };
            baseGcNotifInfoCompositeType =
                new CompositeType("sun.management.BaseGarbageCollectionNotifInfoCompositeType",
                                  "CompositeType for Base GarbageCollectionNotificationInfo",
                                  gcNotifInfoItemNames,
                                  gcNotifInfoItemNames,
                                  baseGcNotifInfoItemTypes);
        } catch (OpenDataException e) {
            // shouldn't reach here
            throw Util.newException(e);
        }
    }
    return baseGcNotifInfoCompositeType;
}
 
开发者ID:JetBrains,项目名称:jdk8u_jdk,代码行数:22,代码来源:GarbageCollectionNotifInfoCompositeData.java

示例3: getPhiValues

@Override
public TabularData getPhiValues() throws OpenDataException {
    final CompositeType ct = new CompositeType("Node", "Node", new String[] { "Endpoint", "PHI" },
            new String[] { "IP of the endpoint", "PHI value" },
            new OpenType[] { SimpleType.STRING, SimpleType.DOUBLE });
    final TabularDataSupport results = new TabularDataSupport(
            new TabularType("PhiList", "PhiList", ct, new String[] { "Endpoint" }));
    final JsonArray arr = client.getJsonArray("/failure_detector/endpoint_phi_values");

    for (JsonValue v : arr) {
        JsonObject o = (JsonObject) v;
        String endpoint = o.getString("endpoint");
        double phi = Double.parseDouble(o.getString("phi"));

        if (phi != Double.MIN_VALUE) {
            // returned values are scaled by PHI_FACTOR so that the are on
            // the same scale as PhiConvictThreshold
            final CompositeData data = new CompositeDataSupport(ct, new String[] { "Endpoint", "PHI" },
                    new Object[] { endpoint, phi * PHI_FACTOR });
            results.put(data);
        }
    }

    return results;
}
 
开发者ID:scylladb,项目名称:scylla-jmx,代码行数:25,代码来源:FailureDetector.java

示例4: TestClass

public TestClass(String str, URL url)
{
   this.str = str;
   this.url = url;
   list.add("a");
   list.add("b");
   list.add("c");
   map.put("1", "a");
   map.put("2", "b");
   map.put("3", "c");
   try
   {
      CompositeType type = new CompositeType("My type",
                                             "My type",
                                             new String[]{"item1", "item2"},
                                             new String[]{"item1", "item2"},
                                             new OpenType[]{SimpleType.STRING, SimpleType.STRING});
      compositeData = new CompositeDataSupport(type, new String[]{"item1", "item2"}, new Object[]{"item value 1", "item value 2"});
   }
   catch (OpenDataException e)
   {
      e.printStackTrace();
   }

}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:25,代码来源:HttpAdaptor.java

示例5: getJmxType

private OpenType<?> getJmxType(Class<?> type) {
    if (type == Boolean.class) {
        return SimpleType.BOOLEAN;
    } else if (type == Integer.class || type == AtomicInteger.class) {
        return SimpleType.INTEGER;
    } else if (type == Long.class || type == AtomicLong.class) {
        return SimpleType.LONG;
    } else if (type == Double.class) {
        return SimpleType.DOUBLE;
    } else if (type == String.class) {
        return SimpleType.STRING;
    } else {
        throw new UnsupportedOperationException(
                "Don't know how to process Monitorable of type [" + type + "]");
    }
}
 
开发者ID:performancecopilot,项目名称:parfait,代码行数:16,代码来源:JmxView.java

示例6: simpleTypeOf

private static SimpleType<?> simpleTypeOf(Class<?> clazz) throws IllegalArgumentException {
	if (clazz == boolean.class || clazz == Boolean.class) {
		return SimpleType.BOOLEAN;
	} else if (clazz == byte.class || clazz == Byte.class) {
		return SimpleType.BYTE;
	} else if (clazz == short.class || clazz == Short.class) {
		return SimpleType.SHORT;
	} else if (clazz == char.class || clazz == Character.class) {
		return SimpleType.CHARACTER;
	} else if (clazz == int.class || clazz == Integer.class) {
		return SimpleType.INTEGER;
	} else if (clazz == long.class || clazz == Long.class) {
		return SimpleType.LONG;
	} else if (clazz == float.class || clazz == Float.class) {
		return SimpleType.FLOAT;
	} else if (clazz == double.class || clazz == Double.class) {
		return SimpleType.DOUBLE;
	} else if (clazz == String.class) {
		return SimpleType.STRING;
	} else {
		throw new IllegalArgumentException("There is no SimpleType for " + clazz.getName());
	}
}
 
开发者ID:softindex,项目名称:datakernel,代码行数:23,代码来源:AttributeNodeForSimpleType.java

示例7: before

@Before
public void before() throws OpenDataException {
	exceptionDetailsItemNames = new String[]{
			"lastException",
			"lastExceptionCausedObject",
			"lastExceptionStackTrace",
			"lastExceptionTimestamp",
			"totalExceptions"
	};

	exceptionDetailsItemTypes = new OpenType<?>[]{
			SimpleType.STRING,
			SimpleType.STRING,
			new ArrayType<>(1, SimpleType.STRING),
			SimpleType.LONG,
			SimpleType.INTEGER
	};
}
 
开发者ID:softindex,项目名称:datakernel,代码行数:18,代码来源:ExceptionStatsTest.java

示例8: test_from_scenario7

public void test_from_scenario7() throws Exception {
    String[] names = { "poolName", "usage", "count" };
    Object[] values = { "TestPoolName", memoryCompositeData, "42" };
    OpenType[] types = { SimpleType.STRING, memoryUsageCompositeType,
            SimpleType.STRING };

    CompositeType compositeType = getCompositeType(names, types);
    CompositeData data = new CompositeDataSupport(compositeType, names,
            values);
    try {
        MemoryNotificationInfo.from(data);
        fail("should throw IllegalArgumentException");
    } catch (IllegalArgumentException e) {
        // Expected
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:16,代码来源:MemoryNotificationInfoTest.java

示例9: test_from_scenario4

public void test_from_scenario4() throws Exception {
    initialValues[0] = null;
    ArrayType stackTraceArray = new ArrayType(1, stackTraceElementType);
    OpenType[] types = { SimpleType.LONG, SimpleType.STRING,
            SimpleType.STRING, SimpleType.BOOLEAN, SimpleType.BOOLEAN,
            SimpleType.LONG, SimpleType.LONG, SimpleType.LONG,
            SimpleType.LONG, SimpleType.STRING, SimpleType.LONG,
            SimpleType.STRING, stackTraceArray, SimpleType.STRING };
    CompositeType compositeType = getCompositeType(initialNames, types);
    CompositeData data = new CompositeDataSupport(compositeType,
            initialNames, initialValues);
    try {
        ThreadInfo.from(data);
        fail("should throw NullPointerException");
    } catch (NullPointerException e) {
        // Expected
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:18,代码来源:ThreadInfoTest.java

示例10: test_from_scenario16

public void test_from_scenario16() throws Exception {
    initialValues[12] = null;
    ArrayType stackTraceArray = new ArrayType(1, stackTraceElementType);
    OpenType[] types = { SimpleType.LONG, SimpleType.STRING,
            SimpleType.STRING, SimpleType.BOOLEAN, SimpleType.BOOLEAN,
            SimpleType.LONG, SimpleType.LONG, SimpleType.LONG,
            SimpleType.LONG, SimpleType.STRING, SimpleType.LONG,
            SimpleType.STRING, stackTraceArray, SimpleType.STRING };
    CompositeType compositeType = getCompositeType(initialNames, types);
    CompositeData data = new CompositeDataSupport(compositeType,
            initialNames, initialValues);
    try {
        ThreadInfo.from(data);
        fail("should throw IllegalArgumentException");
    } catch (IllegalArgumentException e) {
        // Expected
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:18,代码来源:ThreadInfoTest.java

示例11: test_from_scenario8

public void test_from_scenario8() throws Exception {
    initialValues[4] = null;
    ArrayType stackTraceArray = new ArrayType(1, stackTraceElementType);
    OpenType[] types = { SimpleType.LONG, SimpleType.STRING,
            SimpleType.STRING, SimpleType.BOOLEAN, SimpleType.BOOLEAN,
            SimpleType.LONG, SimpleType.LONG, SimpleType.LONG,
            SimpleType.LONG, SimpleType.STRING, SimpleType.LONG,
            SimpleType.STRING, stackTraceArray, SimpleType.STRING };
    CompositeType compositeType = getCompositeType(initialNames, types);
    CompositeData data = new CompositeDataSupport(compositeType,
            initialNames, initialValues);
    try {
        ThreadInfo.from(data);
        fail("should throw NullPointerException");
    } catch (NullPointerException e) {
        // Expected
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:18,代码来源:ThreadInfoTest.java

示例12: test_from_scenario6

public void test_from_scenario6() throws Exception {
    String[] names = { "poolName", "usage", "count" };
    Object[] values = { "TestPoolName", new Long(1), new Long(42) };
    OpenType[] types = { SimpleType.STRING, SimpleType.LONG,
            SimpleType.LONG };

    CompositeType compositeType = getCompositeType(names, types);
    CompositeData data = new CompositeDataSupport(compositeType, names,
            values);
    try {
        MemoryNotificationInfo.from(data);
        fail("should throw IllegalArgumentException");
    } catch (IllegalArgumentException e) {
        // Expected
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:16,代码来源:MemoryNotificationInfoTest.java

示例13: test_from_scenario12

public void test_from_scenario12() throws Exception {
    String[] names = { "poolName", "usage", "count", "extention" };
    Object[] values = { "TestPoolName", memoryCompositeData, new Long(42),
            null };
    OpenType[] types = { SimpleType.STRING, memoryUsageCompositeType,
            SimpleType.LONG, SimpleType.LONG };

    CompositeType compositeType = getCompositeType(names, types);
    CompositeData data = new CompositeDataSupport(compositeType, names,
            values);
    MemoryNotificationInfo info = MemoryNotificationInfo.from(data);
    assertEquals(values[0], info.getPoolName());
    assertEquals(values[2], info.getCount());
    MemoryUsage usage = info.getUsage();
    assertEquals(1, usage.getInit());
    assertEquals(2, usage.getUsed());
    assertEquals(3, usage.getCommitted());
    assertEquals(4, usage.getMax());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:19,代码来源:MemoryNotificationInfoTest.java

示例14: getMemoryNotificationInfoCompositeType

/**
 * @return an instance of {@link CompositeType}for the
 *         {@link MemoryNotificationInfo}class.
 */
private static CompositeType getMemoryNotificationInfoCompositeType() {
    if (MEMORYNOTIFICATIONINFO_COMPOSITETYPE == null) {
        String[] typeNames = { "poolName", "usage", "count" };
        String[] typeDescs = { "poolName", "usage", "count" };
        OpenType[] typeTypes = { SimpleType.STRING,
                getMemoryUsageCompositeType(), SimpleType.LONG };
        try {
            MEMORYNOTIFICATIONINFO_COMPOSITETYPE = new CompositeType(
                    MemoryNotificationInfo.class.getName(),
                    MemoryNotificationInfo.class.getName(), typeNames,
                    typeDescs, typeTypes);
        } catch (OpenDataException e) {
            if (ManagementUtils.VERBOSE_MODE) {
                e.printStackTrace(System.err);
            }// end if
        }
    }
    return MEMORYNOTIFICATIONINFO_COMPOSITETYPE;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:23,代码来源:ManagementUtils.java

示例15: getBaseGcNotifInfoCompositeType

private static synchronized CompositeType getBaseGcNotifInfoCompositeType() {
    if (baseGcNotifInfoCompositeType == null) {
        try {
            OpenType[] baseGcNotifInfoItemTypes = new OpenType[] {
                SimpleType.STRING,
                SimpleType.STRING,
                SimpleType.STRING,
                GcInfoCompositeData.getBaseGcInfoCompositeType()
            };
            baseGcNotifInfoCompositeType =
                new CompositeType("sun.management.BaseGarbageCollectionNotifInfoCompositeType",
                                  "CompositeType for Base GarbageCollectionNotificationInfo",
                                  gcNotifInfoItemNames,
                                  gcNotifInfoItemNames,
                                  baseGcNotifInfoItemTypes);
        } catch (OpenDataException e) {
            // shouldn't reach here
            throw Util.newException(e);
        }
    }
    return baseGcNotifInfoCompositeType;
}
 
开发者ID:greghaskins,项目名称:openjdk-jdk7u-jdk,代码行数:22,代码来源:GarbageCollectionNotifInfoCompositeData.java


注:本文中的javax.management.openmbean.SimpleType.STRING属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。