當前位置: 首頁>>代碼示例>>Java>>正文


Java SimpleType類代碼示例

本文整理匯總了Java中javax.management.openmbean.SimpleType的典型用法代碼示例。如果您正苦於以下問題:Java SimpleType類的具體用法?Java SimpleType怎麽用?Java SimpleType使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SimpleType類屬於javax.management.openmbean包,在下文中一共展示了SimpleType類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getVersionedArrayType

import javax.management.openmbean.SimpleType; //導入依賴的package包/類
private ArrayType<?> getVersionedArrayType(ArrayType<?> type, String version)
    throws OpenDataException
{
    if (type.isPrimitiveArray()) {
        return type;
    }
    OpenType<?> ot = getVersionedType(
        type.getElementOpenType(),
        version
    );
    if (ot instanceof SimpleType) {
        return new ArrayType<>((SimpleType<?>)ot, type.isPrimitiveArray());
    } else {
        return new ArrayType<>(type.getDimension(), ot);
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:17,代碼來源:TypeVersionMapper.java

示例2: getMBeanInfo

import javax.management.openmbean.SimpleType; //導入依賴的package包/類
@Override
public MBeanInfo getMBeanInfo() {

	ArrayList<OpenMBeanAttributeInfoSupport> attributes = new ArrayList<>();

	attributes.add(new OpenMBeanAttributeInfoSupport("enabled", "enabled", SimpleType.BOOLEAN, true, true, true));
	for (String type : registry.getTypes()) {
		attributes.add(new OpenMBeanAttributeInfoSupport(type, type, getCompositeType(type), true, false, false));
	}

	OpenMBeanParameterInfo[] params = new OpenMBeanParameterInfoSupport[0];
	OpenMBeanOperationInfoSupport reset = new OpenMBeanOperationInfoSupport("reset", "Reset all Metrics", params,
			SimpleType.VOID, MBeanOperationInfo.ACTION);

	OpenMBeanInfoSupport PSOMBInfo = new OpenMBeanInfoSupport(this.getClass().getName(), description,
			attributes.toArray(new OpenMBeanAttributeInfoSupport[0]), new OpenMBeanConstructorInfoSupport[0],
			new OpenMBeanOperationInfoSupport[] { reset }, new MBeanNotificationInfo[0]);

	return PSOMBInfo;
}
 
開發者ID:mevdschee,項目名稱:tqdev-metrics,代碼行數:21,代碼來源:JmxReporter.java

示例3: getCompositeType

import javax.management.openmbean.SimpleType; //導入依賴的package包/類
private OpenType<?> getCompositeType(final Type baseType, final TypeDefinition<?> baseTypeDefinition) {

        final SimpleType<?> innerItemType = SimpleTypeResolver.getSimpleType(baseType);
        final String innerItemName = this.typeProviderWrapper.getJMXParamForBaseType(baseTypeDefinition);

        final String[] itemNames = new String[]{innerItemName};
        final String description = getNullableDescription() == null ? getAttributeYangName() : getNullableDescription();

        final OpenType<?>[] itemTypes = new OpenType[]{innerItemType};
        try {
            return new CompositeType(getUpperCaseCammelCase(), description, itemNames, itemNames, itemTypes);
        } catch (final OpenDataException e) {
            throw new RuntimeException("Unable to create " + CompositeType.class + " with inner element of type "
                    + itemTypes, e);
        }
    }
 
開發者ID:hashsdn,項目名稱:hashsdn-controller,代碼行數:17,代碼來源:JavaAttribute.java

示例4: getBaseGcNotifInfoCompositeType

import javax.management.openmbean.SimpleType; //導入依賴的package包/類
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,代碼行數:23,代碼來源:GarbageCollectionNotifInfoCompositeData.java

示例5: getBaseGcNotifInfoCompositeType

import javax.management.openmbean.SimpleType; //導入依賴的package包/類
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,代碼行數:23,代碼來源:GarbageCollectionNotifInfoCompositeData.java

示例6: getPhiValues

import javax.management.openmbean.SimpleType; //導入依賴的package包/類
@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,代碼行數:26,代碼來源:FailureDetector.java

示例7: TestClass

import javax.management.openmbean.SimpleType; //導入依賴的package包/類
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,代碼行數:26,代碼來源:HttpAdaptor.java

示例8: getJmxType

import javax.management.openmbean.SimpleType; //導入依賴的package包/類
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,代碼行數:17,代碼來源:JmxView.java

示例9: getThrottleConfig

import javax.management.openmbean.SimpleType; //導入依賴的package包/類
@Override
// MBean method
// @Description is set at the interface level
public final CompositeDataSupport getThrottleConfig() throws OpenDataException {

    final CompositeType throttleConfigurationType = new CompositeType(
            "Throttle Configuration",
            "Throttle Configuration",
            new String[]{"Throttle (in ms)", "Batch size"},
            new String[]{"Throttle (in ms)", "Batch size"},
            new OpenType[]{SimpleType.INTEGER, SimpleType.INTEGER}
    );

    final Map<String, Object> data = new HashMap<String, Object>();
    data.put("Throttle (in ms)", this.throttle.get());
    data.put("Batch size", this.batchSize.get());
    return new CompositeDataSupport(throttleConfigurationType, data);
}
 
開發者ID:Adobe-Consulting-Services,項目名稱:acs-aem-samples,代碼行數:19,代碼來源:SampleContentReplicationHarnessImpl.java

示例10: simpleTypeOf

import javax.management.openmbean.SimpleType; //導入依賴的package包/類
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,代碼行數:24,代碼來源:AttributeNodeForSimpleType.java

示例11: before

import javax.management.openmbean.SimpleType; //導入依賴的package包/類
@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,代碼行數:19,代碼來源:ExceptionStatsTest.java

示例12: testJsonObject

import javax.management.openmbean.SimpleType; //導入依賴的package包/類
@Test
public void testJsonObject() throws Exception {
    ModelNode description = createDescription(ModelType.OBJECT);

    TypeConverter converter = getConverter(description);

    Assert.assertEquals(SimpleType.STRING, converter.getOpenType());

    ModelNode node = new ModelNode();
    node.get("long").set(5L);
    node.get("string").set("Value");
    node.get("a", "b").set(true);
    node.get("c", "d").set(40);

    String json = node.toJSONString(false);
    String data = assertCast(String.class, converter.fromModelNode(node));
    Assert.assertEquals(json, data);

    Assert.assertEquals(ModelNode.fromJSONString(json), converter.toModelNode(data));
}
 
開發者ID:wildfly,項目名稱:wildfly-core,代碼行數:21,代碼來源:LegacyTypeConverterUnitTestCase.java

示例13: propertiesToCompositeData

import javax.management.openmbean.SimpleType; //導入依賴的package包/類
private CompositeDataSupport propertiesToCompositeData(final Map<String, ?> properties) {
    // try {
    try {
        final String[] keys = properties.keySet().toArray(new String[0]);
        final OpenType[] itemTypes = new OpenType[keys.length];
        for (int i = 0; i < itemTypes.length; i++) {
            itemTypes[i] = SimpleType.STRING;
        }
        CompositeType propsType;
        propsType = new CompositeType("Properties type", "properties", keys, keys, itemTypes);
        final CompositeDataSupport propsData = new CompositeDataSupport(propsType, properties);
        return propsData;
    } catch (final OpenDataException e) {
        throw new AssertException("problem with jmx data generation", e);
    }
}
 
開發者ID:huihoo,項目名稱:olat,代碼行數:17,代碼來源:ClusterEventBus.java

示例14: getOpenType

import javax.management.openmbean.SimpleType; //導入依賴的package包/類
private static OpenType getOpenType(Object value) throws OpenDataException {
    if (value == null) {
        return SimpleType.VOID;
    }

    //if (OpenType.ALLOWED_CLASSNAMES_LIST.contains(name)) {
    int dim = 0;
    Class<?> cls = value.getClass();
    while (cls.isArray()) {
    	cls = value.getClass().getComponentType();
    	dim++;
    }
	SimpleType<?> type = getTypeForName(cls.getName());
	if (type != null && dim > 0) {
		if (cls.isPrimitive() && dim == 1) {
    		return new ArrayType<>(type, true);
		}
		return new ArrayType<>(dim, type);
	}
   	return type;
}
 
開發者ID:dsukhoroslov,項目名稱:bagri,代碼行數:22,代碼來源:JMXUtils.java

示例15: getBaseGcNotifInfoCompositeType

import javax.management.openmbean.SimpleType; //導入依賴的package包/類
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:aducode,項目名稱:openjdk-source-code-learn,代碼行數:23,代碼來源:GarbageCollectionNotifInfoCompositeData.java


注:本文中的javax.management.openmbean.SimpleType類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。