javax.management.openmbean.OpenType Java Examples

The following examples show how to use javax.management.openmbean.OpenType. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DefaultMXBeanMappingFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private MXBeanMapping
    makeTabularMapping(Type objType, boolean sortedMap,
                       Type keyType, Type valueType,
                       MXBeanMappingFactory factory)
        throws OpenDataException {

    final String objTypeName = typeName(objType);
    final MXBeanMapping keyMapping = factory.mappingForType(keyType, factory);
    final MXBeanMapping valueMapping = factory.mappingForType(valueType, factory);
    final OpenType<?> keyOpenType = keyMapping.getOpenType();
    final OpenType<?> valueOpenType = valueMapping.getOpenType();
    final CompositeType rowType =
        new CompositeType(objTypeName,
                          objTypeName,
                          keyValueArray,
                          keyValueArray,
                          new OpenType<?>[] {keyOpenType, valueOpenType});
    final TabularType tabularType =
        new TabularType(objTypeName, objTypeName, rowType, keyArray);
    return new TabularMapping(objType, sortedMap, tabularType,
                                keyMapping, valueMapping);
}
 
Example #2
Source File: DefaultMXBeanMappingFactory.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private MXBeanMapping
    makeTabularMapping(Type objType, boolean sortedMap,
                       Type keyType, Type valueType,
                       MXBeanMappingFactory factory)
        throws OpenDataException {

    final String objTypeName = typeName(objType);
    final MXBeanMapping keyMapping = factory.mappingForType(keyType, factory);
    final MXBeanMapping valueMapping = factory.mappingForType(valueType, factory);
    final OpenType<?> keyOpenType = keyMapping.getOpenType();
    final OpenType<?> valueOpenType = valueMapping.getOpenType();
    final CompositeType rowType =
        new CompositeType(objTypeName,
                          objTypeName,
                          keyValueArray,
                          keyValueArray,
                          new OpenType<?>[] {keyOpenType, valueOpenType});
    final TabularType tabularType =
        new TabularType(objTypeName, objTypeName, rowType, keyArray);
    return new TabularMapping(objType, sortedMap, tabularType,
                                keyMapping, valueMapping);
}
 
Example #3
Source File: DefaultMXBeanMappingFactory.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
private MXBeanMapping
    makeTabularMapping(Type objType, boolean sortedMap,
                       Type keyType, Type valueType,
                       MXBeanMappingFactory factory)
        throws OpenDataException {

    final String objTypeName = typeName(objType);
    final MXBeanMapping keyMapping = factory.mappingForType(keyType, factory);
    final MXBeanMapping valueMapping = factory.mappingForType(valueType, factory);
    final OpenType<?> keyOpenType = keyMapping.getOpenType();
    final OpenType<?> valueOpenType = valueMapping.getOpenType();
    final CompositeType rowType =
        new CompositeType(objTypeName,
                          objTypeName,
                          keyValueArray,
                          keyValueArray,
                          new OpenType<?>[] {keyOpenType, valueOpenType});
    final TabularType tabularType =
        new TabularType(objTypeName, objTypeName, rowType, keyArray);
    return new TabularMapping(objType, sortedMap, tabularType,
                                keyMapping, valueMapping);
}
 
Example #4
Source File: DefaultMXBeanMappingFactory.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
private MXBeanMapping
    makeTabularMapping(Type objType, boolean sortedMap,
                       Type keyType, Type valueType,
                       MXBeanMappingFactory factory)
        throws OpenDataException {

    final String objTypeName = typeName(objType);
    final MXBeanMapping keyMapping = factory.mappingForType(keyType, factory);
    final MXBeanMapping valueMapping = factory.mappingForType(valueType, factory);
    final OpenType<?> keyOpenType = keyMapping.getOpenType();
    final OpenType<?> valueOpenType = valueMapping.getOpenType();
    final CompositeType rowType =
        new CompositeType(objTypeName,
                          objTypeName,
                          keyValueArray,
                          keyValueArray,
                          new OpenType<?>[] {keyOpenType, valueOpenType});
    final TabularType tabularType =
        new TabularType(objTypeName, objTypeName, rowType, keyArray);
    return new TabularMapping(objType, sortedMap, tabularType,
                                keyMapping, valueMapping);
}
 
Example #5
Source File: LazyCompositeData.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private static boolean isTypeMatched(OpenType<?> ot1, OpenType<?> ot2) {
    if (ot1 instanceof CompositeType) {
        if (! (ot2 instanceof CompositeType))
            return false;
        if (!isTypeMatched((CompositeType) ot1, (CompositeType) ot2))
            return false;
    } else if (ot1 instanceof TabularType) {
        if (! (ot2 instanceof TabularType))
            return false;
        if (!isTypeMatched((TabularType) ot1, (TabularType) ot2))
            return false;
    } else if (ot1 instanceof ArrayType) {
        if (! (ot2 instanceof ArrayType))
            return false;
        if (!isTypeMatched((ArrayType<?>) ot1, (ArrayType<?>) ot2)) {
            return false;
        }
    } else if (!ot1.equals(ot2)) {
        return false;
    }
    return true;
}
 
Example #6
Source File: DefaultMXBeanMappingFactory.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private MXBeanMapping
    makeTabularMapping(Type objType, boolean sortedMap,
                       Type keyType, Type valueType,
                       MXBeanMappingFactory factory)
        throws OpenDataException {

    final String objTypeName = typeName(objType);
    final MXBeanMapping keyMapping = factory.mappingForType(keyType, factory);
    final MXBeanMapping valueMapping = factory.mappingForType(valueType, factory);
    final OpenType<?> keyOpenType = keyMapping.getOpenType();
    final OpenType<?> valueOpenType = valueMapping.getOpenType();
    final CompositeType rowType =
        new CompositeType(objTypeName,
                          objTypeName,
                          keyValueArray,
                          keyValueArray,
                          new OpenType<?>[] {keyOpenType, valueOpenType});
    final TabularType tabularType =
        new TabularType(objTypeName, objTypeName, rowType, keyArray);
    return new TabularMapping(objType, sortedMap, tabularType,
                                keyMapping, valueMapping);
}
 
Example #7
Source File: DefaultMXBeanMappingFactory.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
private MXBeanMapping
    makeTabularMapping(Type objType, boolean sortedMap,
                       Type keyType, Type valueType,
                       MXBeanMappingFactory factory)
        throws OpenDataException {

    final String objTypeName = typeName(objType);
    final MXBeanMapping keyMapping = factory.mappingForType(keyType, factory);
    final MXBeanMapping valueMapping = factory.mappingForType(valueType, factory);
    final OpenType<?> keyOpenType = keyMapping.getOpenType();
    final OpenType<?> valueOpenType = valueMapping.getOpenType();
    final CompositeType rowType =
        new CompositeType(objTypeName,
                          objTypeName,
                          keyValueArray,
                          keyValueArray,
                          new OpenType<?>[] {keyOpenType, valueOpenType});
    final TabularType tabularType =
        new TabularType(objTypeName, objTypeName, rowType, keyArray);
    return new TabularMapping(objType, sortedMap, tabularType,
                                keyMapping, valueMapping);
}
 
Example #8
Source File: LazyCompositeData.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
private static boolean isTypeMatched(OpenType<?> ot1, OpenType<?> ot2) {
    if (ot1 instanceof CompositeType) {
        if (! (ot2 instanceof CompositeType))
            return false;
        if (!isTypeMatched((CompositeType) ot1, (CompositeType) ot2))
            return false;
    } else if (ot1 instanceof TabularType) {
        if (! (ot2 instanceof TabularType))
            return false;
        if (!isTypeMatched((TabularType) ot1, (TabularType) ot2))
            return false;
    } else if (ot1 instanceof ArrayType) {
        if (! (ot2 instanceof ArrayType))
            return false;
        if (!isTypeMatched((ArrayType<?>) ot1, (ArrayType<?>) ot2)) {
            return false;
        }
    } else if (!ot1.equals(ot2)) {
        return false;
    }
    return true;
}
 
Example #9
Source File: DefaultMXBeanMappingFactory.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
private MXBeanMapping
    makeTabularMapping(Type objType, boolean sortedMap,
                       Type keyType, Type valueType,
                       MXBeanMappingFactory factory)
        throws OpenDataException {

    final String objTypeName = typeName(objType);
    final MXBeanMapping keyMapping = factory.mappingForType(keyType, factory);
    final MXBeanMapping valueMapping = factory.mappingForType(valueType, factory);
    final OpenType<?> keyOpenType = keyMapping.getOpenType();
    final OpenType<?> valueOpenType = valueMapping.getOpenType();
    final CompositeType rowType =
        new CompositeType(objTypeName,
                          objTypeName,
                          keyValueArray,
                          keyValueArray,
                          new OpenType<?>[] {keyOpenType, valueOpenType});
    final TabularType tabularType =
        new TabularType(objTypeName, objTypeName, rowType, keyArray);
    return new TabularMapping(objType, sortedMap, tabularType,
                                keyMapping, valueMapping);
}
 
Example #10
Source File: TypeVersionMapper.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
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);
    }
}
 
Example #11
Source File: TypeConverters.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public OpenType<?> getOpenType() {
    if (!expressions) {
        return valueAccessor.getOpenType();
    } else {
        return SimpleType.STRING;
    }

}
 
Example #12
Source File: MXBeanIntrospector.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private static Descriptor typeDescriptor(OpenType<?> openType,
                                         Type originalType) {
    return new ImmutableDescriptor(
        new String[] {"openType",
                      "originalType"},
        new Object[] {openType,
                      originalTypeString(originalType)});
}
 
Example #13
Source File: LegacyTypeConverterUnitTestCase.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
private OpenType<?> assertCompositeType(CompositeType composite, String name, String type, String description, boolean validateType){
    Assert.assertTrue(composite.keySet().contains(name));
    if (validateType) {
        Assert.assertEquals(type, composite.getType(name).getTypeName());
    }
    Assert.assertEquals(description, composite.getDescription(name));
    return composite.getType(name);
}
 
Example #14
Source File: GcInfoCompositeData.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example #15
Source File: DefaultMXBeanMappingFactory.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
private MXBeanMapping
    makeArrayOrCollectionMapping(Type collectionType, Type elementType,
                                 MXBeanMappingFactory factory)
        throws OpenDataException {

    final MXBeanMapping elementMapping = factory.mappingForType(elementType, factory);
    final OpenType<?> elementOpenType = elementMapping.getOpenType();
    final ArrayType<?> openType = ArrayType.getArrayType(elementOpenType);
    final Class<?> elementOpenClass = elementMapping.getOpenClass();

    final Class<?> openArrayClass;
    final String openArrayClassName;
    if (elementOpenClass.isArray())
        openArrayClassName = "[" + elementOpenClass.getName();
    else
        openArrayClassName = "[L" + elementOpenClass.getName() + ";";
    try {
        openArrayClass = Class.forName(openArrayClassName);
    } catch (ClassNotFoundException e) {
        throw openDataException("Cannot obtain array class", e);
    }

    if (collectionType instanceof ParameterizedType) {
        return new CollectionMapping(collectionType,
                                     openType, openArrayClass,
                                     elementMapping);
    } else {
        if (isIdentity(elementMapping)) {
            return new IdentityMapping(collectionType,
                                       openType);
        } else {
            return new ArrayMapping(collectionType,
                                      openType,
                                      openArrayClass,
                                      elementMapping);
        }
    }
}
 
Example #16
Source File: MerlinMXBean.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
static CompositeType make(String className,
                          String description,
                          String[] itemNames,
                          String[] itemDescriptions,
                          OpenType[] itemTypes) {
    try {
        return new CompositeType(className,
                                 description,
                                 itemNames,
                                 itemDescriptions,
                                 itemTypes);
    } catch (OpenDataException e) {
        throw new Error(e);
    }
}
 
Example #17
Source File: GcInfoCompositeData.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example #18
Source File: DefaultMXBeanMappingFactory.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private MXBeanMapping
    makeArrayOrCollectionMapping(Type collectionType, Type elementType,
                                 MXBeanMappingFactory factory)
        throws OpenDataException {

    final MXBeanMapping elementMapping = factory.mappingForType(elementType, factory);
    final OpenType<?> elementOpenType = elementMapping.getOpenType();
    final ArrayType<?> openType = ArrayType.getArrayType(elementOpenType);
    final Class<?> elementOpenClass = elementMapping.getOpenClass();

    final Class<?> openArrayClass;
    final String openArrayClassName;
    if (elementOpenClass.isArray())
        openArrayClassName = "[" + elementOpenClass.getName();
    else
        openArrayClassName = "[L" + elementOpenClass.getName() + ";";
    try {
        openArrayClass = Class.forName(openArrayClassName);
    } catch (ClassNotFoundException e) {
        throw openDataException("Cannot obtain array class", e);
    }

    if (collectionType instanceof ParameterizedType) {
        return new CollectionMapping(collectionType,
                                     openType, openArrayClass,
                                     elementMapping);
    } else {
        if (isIdentity(elementMapping)) {
            return new IdentityMapping(collectionType,
                                       openType);
        } else {
            return new ArrayMapping(collectionType,
                                      openType,
                                      openArrayClass,
                                      elementMapping);
        }
    }
}
 
Example #19
Source File: ModelControllerMBeanTestCase.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
private void assertMapType(OpenType<?> mapType, OpenType<?> keyType, OpenType<?> valueType) {
    TabularType type = assertCast(TabularType.class, mapType);
    Assert.assertEquals(1, type.getIndexNames().size());
    Assert.assertEquals("key", type.getIndexNames().get(0));
    Assert.assertEquals(2, type.getRowType().keySet().size());
    Assert.assertTrue(type.getRowType().keySet().contains("key"));
    Assert.assertTrue(type.getRowType().keySet().contains("value"));
    Assert.assertEquals(keyType, type.getRowType().getType("key"));
    Assert.assertEquals(valueType, type.getRowType().getType("value"));

}
 
Example #20
Source File: DefaultMXBeanMappingFactory.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private MXBeanMapping
    makeArrayOrCollectionMapping(Type collectionType, Type elementType,
                                 MXBeanMappingFactory factory)
        throws OpenDataException {

    final MXBeanMapping elementMapping = factory.mappingForType(elementType, factory);
    final OpenType<?> elementOpenType = elementMapping.getOpenType();
    final ArrayType<?> openType = ArrayType.getArrayType(elementOpenType);
    final Class<?> elementOpenClass = elementMapping.getOpenClass();

    final Class<?> openArrayClass;
    final String openArrayClassName;
    if (elementOpenClass.isArray())
        openArrayClassName = "[" + elementOpenClass.getName();
    else
        openArrayClassName = "[L" + elementOpenClass.getName() + ";";
    try {
        openArrayClass = Class.forName(openArrayClassName);
    } catch (ClassNotFoundException e) {
        throw openDataException("Cannot obtain array class", e);
    }

    if (collectionType instanceof ParameterizedType) {
        return new CollectionMapping(collectionType,
                                     openType, openArrayClass,
                                     elementMapping);
    } else {
        if (isIdentity(elementMapping)) {
            return new IdentityMapping(collectionType,
                                       openType);
        } else {
            return new ArrayMapping(collectionType,
                                      openType,
                                      openArrayClass,
                                      elementMapping);
        }
    }
}
 
Example #21
Source File: StreamServiceTest.java    From cassandra-reaper with Apache License 2.0 5 votes vote down vote up
private CompositeType makeFilesType_4_0_0() throws OpenDataException {
  String typeName = "org.apache.cassandra.streaming.ProgressInfo";
  String description = "ProgressInfo";
  String[] itemNames = {
      "currentBytes",
      "direction",
      "fileName",
      "peer",
      "peer storage port",
      "planId",
      "sessionIndex",
      "totalBytes"
  };
  String[] itemDescriptions = {
      "currentBytes",
      "direction",
      "fileName",
      "peer",
      "peer storage port",
      "planId",
      "sessionIndex",
      "totalBytes"
  };
  OpenType[] itemTypes = {
      SimpleType.LONG,
      SimpleType.STRING,
      SimpleType.STRING,
      SimpleType.STRING,
      SimpleType.INTEGER,
      SimpleType.STRING,
      SimpleType.INTEGER,
      SimpleType.LONG,
  };

  return new CompositeType(typeName, description, itemNames, itemDescriptions, itemTypes);
}
 
Example #22
Source File: GcInfoCompositeData.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example #23
Source File: MerlinMXBean.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
static ArrayType make(int dims, OpenType baseType) {
    try {
        return new ArrayType(dims, baseType);
    } catch (OpenDataException e) {
        throw new Error(e);
    }
}
 
Example #24
Source File: MerlinMXBean.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
static CompositeType make(String className,
                          String description,
                          String[] itemNames,
                          String[] itemDescriptions,
                          OpenType[] itemTypes) {
    try {
        return new CompositeType(className,
                                 description,
                                 itemNames,
                                 itemDescriptions,
                                 itemTypes);
    } catch (OpenDataException e) {
        throw new Error(e);
    }
}
 
Example #25
Source File: VMOptionOpenDataTest.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private static void validateType(CompositeData data) {
    CompositeType type = data.getCompositeType();
    Set<String> keys = Arrays.stream(names).collect(Collectors.toSet());
    if (!type.keySet().equals(keys)) {
        throw new RuntimeException("key not matched: " + type.keySet().toString());
    }
    for (int i=0; i < names.length; i++) {
        OpenType t = type.getType(names[i]);
        if (t != types[i]) {
            throw new AssertionError(names[i] + ": type not matched: " +
                t + " expected: " + types[i]);
        }
    }
}
 
Example #26
Source File: DefaultMXBeanMappingFactory.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private MXBeanMapping
    makeArrayOrCollectionMapping(Type collectionType, Type elementType,
                                 MXBeanMappingFactory factory)
        throws OpenDataException {

    final MXBeanMapping elementMapping = factory.mappingForType(elementType, factory);
    final OpenType<?> elementOpenType = elementMapping.getOpenType();
    final ArrayType<?> openType = ArrayType.getArrayType(elementOpenType);
    final Class<?> elementOpenClass = elementMapping.getOpenClass();

    final Class<?> openArrayClass;
    final String openArrayClassName;
    if (elementOpenClass.isArray())
        openArrayClassName = "[" + elementOpenClass.getName();
    else
        openArrayClassName = "[L" + elementOpenClass.getName() + ";";
    try {
        openArrayClass = Class.forName(openArrayClassName);
    } catch (ClassNotFoundException e) {
        throw openDataException("Cannot obtain array class", e);
    }

    if (collectionType instanceof ParameterizedType) {
        return new CollectionMapping(collectionType,
                                     openType, openArrayClass,
                                     elementMapping);
    } else {
        if (isIdentity(elementMapping)) {
            return new IdentityMapping(collectionType,
                                       openType);
        } else {
            return new ArrayMapping(collectionType,
                                      openType,
                                      openArrayClass,
                                      elementMapping);
        }
    }
}
 
Example #27
Source File: DefaultMXBeanMappingFactory.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private MXBeanMapping
    makeArrayOrCollectionMapping(Type collectionType, Type elementType,
                                 MXBeanMappingFactory factory)
        throws OpenDataException {

    final MXBeanMapping elementMapping = factory.mappingForType(elementType, factory);
    final OpenType<?> elementOpenType = elementMapping.getOpenType();
    final ArrayType<?> openType = ArrayType.getArrayType(elementOpenType);
    final Class<?> elementOpenClass = elementMapping.getOpenClass();

    final Class<?> openArrayClass;
    final String openArrayClassName;
    if (elementOpenClass.isArray())
        openArrayClassName = "[" + elementOpenClass.getName();
    else
        openArrayClassName = "[L" + elementOpenClass.getName() + ";";
    try {
        openArrayClass = Class.forName(openArrayClassName);
    } catch (ClassNotFoundException e) {
        throw openDataException("Cannot obtain array class", e);
    }

    if (collectionType instanceof ParameterizedType) {
        return new CollectionMapping(collectionType,
                                     openType, openArrayClass,
                                     elementMapping);
    } else {
        if (isIdentity(elementMapping)) {
            return new IdentityMapping(collectionType,
                                       openType);
        } else {
            return new ArrayMapping(collectionType,
                                      openType,
                                      openArrayClass,
                                      elementMapping);
        }
    }
}
 
Example #28
Source File: TypeConverters.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public OpenType<?> getOpenType() {
    try {
        return ArrayType.getArrayType(getConverter(valueTypeNode, null).getOpenType());
    } catch (OpenDataException e) {
        throw new RuntimeException(e);
    }
}
 
Example #29
Source File: GcInfoCompositeData.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example #30
Source File: MXBeanMapping.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static Class<?> makeOpenClass(Type javaType, OpenType<?> openType) {
    if (javaType instanceof Class<?> && ((Class<?>) javaType).isPrimitive())
        return (Class<?>) javaType;
    try {
        String className = openType.getClassName();
        return Class.forName(className, false, MXBeanMapping.class.getClassLoader());
    } catch (ClassNotFoundException e) {
        throw new RuntimeException(e);  // should not happen
    }
}