本文整理汇总了Java中javax.management.openmbean.SimpleType.LONG属性的典型用法代码示例。如果您正苦于以下问题:Java SimpleType.LONG属性的具体用法?Java SimpleType.LONG怎么用?Java SimpleType.LONG使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.management.openmbean.SimpleType
的用法示例。
在下文中一共展示了SimpleType.LONG属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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 + "]");
}
}
示例2: 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());
}
}
示例3: 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
};
}
示例4: 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
}
}
示例5: test_from_scenario13
public void test_from_scenario13() throws Exception {
String[] names = { "poolName", "usage", "count", "extention" };
Object[] values = { "TestPoolName", memoryCompositeData, new Long(42),
"Extention" };
OpenType[] types = { SimpleType.STRING, memoryUsageCompositeType,
SimpleType.LONG, SimpleType.STRING };
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());
}
示例6: test_from_scenario11
public void test_from_scenario11() throws Exception {
String[] names = { "notPoolName", "usage", "count" };
Object[] values = { "TestNotPoolName", memoryCompositeData,
new Long(42) };
OpenType[] types = { SimpleType.STRING, memoryUsageCompositeType,
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
}
}
示例7: test_from_scenario2
public void test_from_scenario2() throws Exception {
initialValues[0] = "1";
ArrayType stackTraceArray = new ArrayType(1, stackTraceElementType);
OpenType[] types = { SimpleType.STRING, 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
}
}
示例8: test_from_scenario14
public void test_from_scenario14() throws Exception {
initialValues[10] = 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
}
}
示例9: test_from_scenario3
public void test_from_scenario3() throws Exception {
String[] names = { "poolName", "usage", "count" };
Object[] values = { "TestPoolName", null, null };
OpenType[] types = { SimpleType.STRING, memoryUsageCompositeType,
SimpleType.LONG };
CompositeType compositeType = getCompositeType(names, types);
CompositeData data = new CompositeDataSupport(compositeType, names,
values);
try {
MemoryNotificationInfo.from(data);
fail("should throw NullPointerException");
} catch (NullPointerException e) {
// Expected
}
}
示例10: test_from_scenario4
public void test_from_scenario4() throws Exception { // add
String[] names = { "poolName", "usage", "count" };
Object[] values = { "TestPoolName", memoryCompositeData, new Long(-42) };
OpenType[] types = { SimpleType.STRING, memoryUsageCompositeType,
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());
}
示例11: 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
}
}
示例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
}
}
示例13: getOpenType
public static OpenType<?> getOpenType(Object o)
{
if(o instanceof Long)
{
return SimpleType.LONG;
}
else if(o instanceof String)
{
return SimpleType.STRING;
}
else if(o instanceof Date)
{
return SimpleType.DATE;
}
else if(o instanceof Integer)
{
return SimpleType.INTEGER;
}
else if(o instanceof Boolean)
{
return SimpleType.BOOLEAN;
}
else if(o instanceof Double)
{
return SimpleType.DOUBLE;
}
else if(o instanceof Float)
{
return SimpleType.FLOAT;
}
else
{
throw new IllegalArgumentException();
}
}
示例14: getBaseGcInfoItemTypes
static synchronized OpenType[] getBaseGcInfoItemTypes() {
if (baseGcInfoItemTypes == null) {
OpenType<?> memoryUsageOpenType = memoryUsageMapType.getOpenType();
baseGcInfoItemTypes = new OpenType<?>[] {
SimpleType.LONG,
SimpleType.LONG,
SimpleType.LONG,
SimpleType.LONG,
memoryUsageOpenType,
memoryUsageOpenType,
};
}
return baseGcInfoItemTypes;
}
示例15: getBaseGcInfoItemTypes
static synchronized OpenType<?>[] getBaseGcInfoItemTypes() {
if (baseGcInfoItemTypes == null) {
OpenType<?> memoryUsageOpenType = memoryUsageMapType.getOpenType();
baseGcInfoItemTypes = new OpenType<?>[] {
SimpleType.LONG,
SimpleType.LONG,
SimpleType.LONG,
SimpleType.LONG,
memoryUsageOpenType,
memoryUsageOpenType,
};
}
return baseGcInfoItemTypes;
}