< prev index next >

src/java.management/share/classes/sun/management/MappedMXBeanType.java

Print this page




  28 import java.lang.management.MemoryNotificationInfo;
  29 import java.lang.management.MonitorInfo;
  30 import java.lang.management.LockInfo;
  31 import java.lang.management.ThreadInfo;
  32 import java.lang.reflect.*;
  33 import java.util.List;
  34 import java.util.Map;
  35 import java.util.*;
  36 import java.io.InvalidObjectException;
  37 import java.security.AccessController;
  38 import java.security.PrivilegedAction;
  39 import java.security.PrivilegedActionException;
  40 import java.security.PrivilegedExceptionAction;
  41 import javax.management.openmbean.*;
  42 import static javax.management.openmbean.SimpleType.*;
  43 
  44 /**
  45  * A mapped mxbean type maps a Java type to an open type.
  46  * Only the following Java types are mappable
  47  * (currently required by the platform MXBeans):
  48  *   1. Primitive types
  49  *   2. Wrapper classes such java.lang.Integer, etc
  50  *   3. Classes with only getter methods and with a static "from" method
  51  *      that takes a CompositeData argument.
  52  *   4. E[] where E is a type of 1-4 (can be multi-dimensional array)
  53  *   5. List<E> where E is a type of 1-3
  54  *   6. Map<K, V> where K and V are a type of 1-4


  55  *
  56  * OpenDataException will be thrown if a Java type is not supported.
  57  */
  58 // Suppress unchecked cast warnings at line 442, 523 and 546
  59 // Suppress unchecked calls at line 235, 284, 380 and 430.
  60 @SuppressWarnings("unchecked")
  61 public abstract class MappedMXBeanType {
  62     private static final WeakHashMap<Type,MappedMXBeanType> convertedTypes =
  63         new WeakHashMap<>();
  64 
  65     boolean  isBasicType = false;
  66     OpenType<?> openType = inProgress;
  67     Class<?>    mappedTypeClass;
  68 
  69     static synchronized MappedMXBeanType newMappedType(Type javaType)
  70             throws OpenDataException {
  71 
  72         MappedMXBeanType mt = null;
  73         if (javaType instanceof Class) {
  74             final Class<?> c = (Class<?>) javaType;




  28 import java.lang.management.MemoryNotificationInfo;
  29 import java.lang.management.MonitorInfo;
  30 import java.lang.management.LockInfo;
  31 import java.lang.management.ThreadInfo;
  32 import java.lang.reflect.*;
  33 import java.util.List;
  34 import java.util.Map;
  35 import java.util.*;
  36 import java.io.InvalidObjectException;
  37 import java.security.AccessController;
  38 import java.security.PrivilegedAction;
  39 import java.security.PrivilegedActionException;
  40 import java.security.PrivilegedExceptionAction;
  41 import javax.management.openmbean.*;
  42 import static javax.management.openmbean.SimpleType.*;
  43 
  44 /**
  45  * A mapped mxbean type maps a Java type to an open type.
  46  * Only the following Java types are mappable
  47  * (currently required by the platform MXBeans):
  48  * <ol>
  49  *   <li>Primitive types</li>
  50  *   <li>Wrapper classes such java.lang.Integer, etc</li>
  51  *   <li>Classes with only getter methods and with a static "from" method
  52  *      that takes a CompositeData argument.</li>
  53  *   <li>{@code E[]} where {@code E} is a type of 1-4 (can be multi-dimensional array)</li>
  54  *   <li>{@code List<E>} where E is a type of 1-3</li>
  55  *   <li>{@code Map<K, V>} where {@code K} and {@code V} are a type of 1-4</li>
  56  * </ol>
  57  *
  58  * OpenDataException will be thrown if a Java type is not supported.
  59  */
  60 // Suppress unchecked cast warnings at line 442, 523 and 546
  61 // Suppress unchecked calls at line 235, 284, 380 and 430.
  62 @SuppressWarnings("unchecked")
  63 public abstract class MappedMXBeanType {
  64     private static final WeakHashMap<Type,MappedMXBeanType> convertedTypes =
  65         new WeakHashMap<>();
  66 
  67     boolean  isBasicType = false;
  68     OpenType<?> openType = inProgress;
  69     Class<?>    mappedTypeClass;
  70 
  71     static synchronized MappedMXBeanType newMappedType(Type javaType)
  72             throws OpenDataException {
  73 
  74         MappedMXBeanType mt = null;
  75         if (javaType instanceof Class) {
  76             final Class<?> c = (Class<?>) javaType;


< prev index next >