Package javax.management.openmbean

Examples of javax.management.openmbean.OpenType


         while (componentType.isArray())
         {
            ++dimension;
            componentType = componentType.getComponentType();
         }
         OpenType componentOpenType = getOpenType(componentType);
         try
         {
            return new ArrayType(dimension, componentOpenType);
         }
         catch (RuntimeException e)
         {
            throw e;
         }
         catch (Exception e)
         {
            throw new RuntimeException(e);
         }
      }
      if (type instanceof GenericArrayType)
      {
         GenericArrayType arrayType = (GenericArrayType) type;
         int dimension = 1;
         Type componentType = arrayType.getGenericComponentType();
         while (componentType instanceof GenericArrayType)
         {
            ++dimension;
            arrayType = (GenericArrayType) componentType;
            componentType = arrayType.getGenericComponentType();
         }
         OpenType componentOpenType = getOpenType(componentType);
         try
         {
            return new ArrayType(dimension, componentOpenType);
         }
         catch (RuntimeException e)
View Full Code Here


         return null;
      Class rawClass = (Class) rawType;
      if (Collection.class.isAssignableFrom(rawClass) == false)
         return null;
      Type componentType = parameterizedType.getActualTypeArguments()[0];
      OpenType componentOpenType = getOpenType(componentType);
      try
      {
         return new ArrayType(1, componentOpenType);
      }
      catch (RuntimeException e)
View Full Code Here

    */
   public static ArrayType checkCollectionClass(Class clazz)
   {
      if (Collection.class.isAssignableFrom(clazz) == false)
         return null;
      OpenType componentOpenType = getOpenType(Object.class);
      try
      {
         return new ArrayType(1, componentOpenType);
      }
      catch (RuntimeException e)
View Full Code Here

   {
      if (value == null)
         return null;

      ArrayType arrayType = (ArrayType) openType;
      OpenType elementType = arrayType.getElementOpenType();
      int dimension = arrayType.getDimension();

      Class clazz = value.getClass();
      if (clazz.isArray())
      {
View Full Code Here

   {
      if (value == null)
         return null;

      ArrayType arrayType = (ArrayType) getOpenType(type);
      OpenType elementType = arrayType.getElementOpenType();
      int dimension = arrayType.getDimension();
      Object[] oldArray = (Object[]) value;
      if (type instanceof Class)
      {
         Class clazz = (Class) type;
View Full Code Here

      if (value instanceof Map)
      {
         TabularDataSupport table = new TabularDataSupport(tabularType);
         CompositeType entryType = tabularType.getRowType();
         OpenType keyType = entryType.getType(MAP_KEY);
         OpenType valueType = entryType.getType(MAP_VALUE);
        
         Map<Object, Object> m = (Map<Object, Object>) value;
         for (Iterator<Map.Entry<Object, Object>> i = m.entrySet().iterator(); i.hasNext();)
         {
            Map.Entry<Object, Object> entry = i.next();
View Full Code Here

      Object[] values = new Object[names.length];
     
      for (int i = 0 ; i < names.length; ++i)
      {
         String name = names[i];
         OpenType itemType = compositeType.getType(name);
         Method method = getCompositeDataMethod(clazz, name, itemType == SimpleType.BOOLEAN);
         Object itemValue = method.invoke(value, null);
         values[i] = construct(itemType, itemValue, context);
      }
      return new CompositeDataSupport(compositeType, names, values);
View Full Code Here

   */
  static void checkAttribute(CompositeType ctype, String name,
           OpenType type)
    throws IllegalArgumentException
  {
    OpenType foundType = ctype.getType(name);
    if (foundType == null)
      throw new IllegalArgumentException("Could not find a field named " +
           name);
    if (!(foundType.equals(type)))
      throw new IllegalArgumentException("Field " + name + " is not of " +
           "type " + type.getClassName());
  }
View Full Code Here

      {
  throw new IllegalStateException("Something went wrong in creating " +
          "the array for the stack trace element.",
          e);
      }
    OpenType foundType = type.getType("LockedMonitors");
    if (foundType != null)
      try
  {
    CompositeType mType = new CompositeType(MonitorInfo.class.getName(),
              "Information on a object monitor lock",
              new String[] { "ClassName",
                 "IdentityHashCode",
                 "LockedStackDepth",
                 "LockedStackFrame"
              },
              new String[] { "Name of the class",
                 "Identity hash code " +
                 "of the class",
                 "Stack depth at time " +
                 "of lock",
                 "Stack frame at time " +
                 "of lock",
              },
              new OpenType[] {
                SimpleType.STRING, SimpleType.INTEGER,
                SimpleType.INTEGER, getStackTraceType()
              });
    if (!(foundType.equals(new ArrayType(1, mType))))
      throw new IllegalArgumentException("Field LockedMonitors is not of " +
                 "type " + mType.getClassName());
  }
    catch (OpenDataException e)
      {
  throw new IllegalStateException("Something went wrong in creating " +
          "the composite data type for the " +
          "object monitor information array.", e);
      }
    foundType = type.getType("LockedSynchronizers");
    if (foundType != null)
      try
  {
    CompositeType lType = new CompositeType(LockInfo.class.getName(),
              "Information on a lock",
              new String[] { "ClassName",
                 "IdentityHashCode"
              },
              new String[] { "Name of the class",
                 "Identity hash code " +
                 "of the class"
              },
              new OpenType[] {
                SimpleType.STRING, SimpleType.INTEGER
              });
    if (!(foundType.equals(new ArrayType(1, lType))))
      throw new IllegalArgumentException("Field LockedSynchronizers is not of " +
                 "type " + lType.getClassName());
  }
    catch (OpenDataException e)
      {
View Full Code Here

        all.addAll(Arrays.asList(items));

        String names[] = new String[all.size()];
        String descriptions[] = new String[all.size()];
        OpenType types[] = new OpenType[all.size()];

        int n = 0;
        for (Item item : all) {
            names[n] = item.name;
            descriptions[n] = item.description;
View Full Code Here

TOP

Related Classes of javax.management.openmbean.OpenType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.