Package javax.management.openmbean

Examples of javax.management.openmbean.ArrayType


         fail("Expected IllegalArgumentException for null simple type");

      caught = false;
      try
      {
         ArrayType arrayType = new ArrayType(1, SimpleType.STRING);
         new OpenMBeanParameterInfoSupport(
            "name", "description", arrayType, new String[0], null);
      }
      catch (OpenDataException e)
      {
         caught = true;
      }
      if (caught == false)
         fail("Expected OpenDataException for array type and default value");

      caught = false;
      try
      {
         ArrayType arrayType = new ArrayType(1, SimpleType.STRING);
         new OpenMBeanParameterInfoSupport(
            "name", "description", arrayType, null, null);
      }
      catch (OpenDataException e)
      {
         caught = true;
      }
      if (caught == true)
         fail("Didn't expect OpenDataException for array type and no default value and legals");

      caught = false;
      try
      {
         String[] itemNames = new String[] { "name1", "name2" };
         String[] itemDescriptions = new String[] { "desc1", "desc2" };
         OpenType[] itemTypes = new OpenType[] { SimpleType.STRING, SimpleType.INTEGER };
         CompositeType rowType = new CompositeType("rowTypeName", "rowDescription",
            itemNames, itemDescriptions, itemTypes);

         String[] indexNames = new String[] { "name1", "name2" };
         TabularType tabularType = new TabularType("typeName", "description", rowType, indexNames);
         TabularDataSupport data = new TabularDataSupport(tabularType);

         new OpenMBeanParameterInfoSupport(
            "name", "description", tabularType, data, null);
      }
      catch (OpenDataException e)
      {
         caught = true;
      }
      if (caught == false)
         fail("Expected OpenDataException for tabular type and default value");

      caught = false;
      try
      {
         String[] itemNames = new String[] { "name1", "name2" };
         String[] itemDescriptions = new String[] { "desc1", "desc2" };
         OpenType[] itemTypes = new OpenType[] { SimpleType.STRING, SimpleType.INTEGER };
         CompositeType rowType = new CompositeType("rowTypeName", "rowDescription",
            itemNames, itemDescriptions, itemTypes);

         String[] indexNames = new String[] { "name1", "name2" };
         TabularType tabularType = new TabularType("typeName", "description", rowType, indexNames);

         new OpenMBeanParameterInfoSupport(
            "name", "description", tabularType, null, null);
      }
      catch (OpenDataException e)
      {
         caught = true;
      }
      if (caught == true)
         fail("Didn't expect OpenDataException for tabular type and null default value and legals");

      caught = false;
      try
      {
         ArrayType arrayType = new ArrayType(1, SimpleType.STRING);
         new OpenMBeanParameterInfoSupport(
            "name", "description", arrayType, null, new String[] { "hello", "goodbye" });
      }
      catch (OpenDataException e)
      {
         caught = true;
      }
      if (caught == false)
         fail("Expected OpenDataException for array type and default value");

      caught = false;
      try
      {
         ArrayType arrayType = new ArrayType(1, SimpleType.STRING);
         new OpenMBeanParameterInfoSupport(
            "name", "description", arrayType, null, new String[0]);
      }
      catch (OpenDataException e)
      {
View Full Code Here


         fail("Expected IllegalArgumentException for null simple type");

      caught = false;
      try
      {
         ArrayType arrayType = new ArrayType(1, SimpleType.STRING);
         new OpenMBeanParameterInfoSupport(
            "name", "description", arrayType, new String[0], null, null);
      }
      catch (OpenDataException e)
      {
         caught = true;
      }
      if (caught == false)
         fail("Expected OpenDataException for array type and default value");

      caught = false;
      try
      {
         ArrayType arrayType = new ArrayType(1, SimpleType.STRING);
         new OpenMBeanParameterInfoSupport(
            "name", "description", arrayType, null, null, null);
      }
      catch (OpenDataException e)
      {
         caught = true;
      }
      if (caught == true)
         fail("Didn't expect OpenDataException for array type and no default value");

      caught = false;
      try
      {
         String[] itemNames = new String[] { "name1", "name2" };
         String[] itemDescriptions = new String[] { "desc1", "desc2" };
         OpenType[] itemTypes = new OpenType[] { SimpleType.STRING, SimpleType.INTEGER };
         CompositeType rowType = new CompositeType("rowTypeName", "rowDescription",
            itemNames, itemDescriptions, itemTypes);

         String[] indexNames = new String[] { "name1", "name2" };
         TabularType tabularType = new TabularType("typeName", "description", rowType, indexNames);
         TabularDataSupport data = new TabularDataSupport(tabularType);

         new OpenMBeanParameterInfoSupport(
            "name", "description", tabularType, data, null, null);
      }
      catch (OpenDataException e)
      {
         caught = true;
      }
      if (caught == false)
         fail("Expected OpenDataException for tabular type and default value");

      caught = false;
      try
      {
         String[] itemNames = new String[] { "name1", "name2" };
         String[] itemDescriptions = new String[] { "desc1", "desc2" };
         OpenType[] itemTypes = new OpenType[] { SimpleType.STRING, SimpleType.INTEGER };
         CompositeType rowType = new CompositeType("rowTypeName", "rowDescription",
            itemNames, itemDescriptions, itemTypes);

         String[] indexNames = new String[] { "name1", "name2" };
         TabularType tabularType = new TabularType("typeName", "description", rowType, indexNames);

         new OpenMBeanParameterInfoSupport(
            "name", "description", tabularType, null, null, null);
      }
      catch (OpenDataException e)
      {
         caught = true;
      }
      if (caught == true)
         fail("Didn't expect OpenDataException for tabular type and null default value");

      caught = false;
      try
      {
         ArrayType arrayType = new ArrayType(1, SimpleType.STRING);
         new OpenMBeanParameterInfoSupport(
            "name", "description", arrayType, new String[] { "hello", "goodbye" }, null, null);
      }
      catch (OpenDataException e)
      {
View Full Code Here

  makeArrayOrCollectionConverter(Type collectionType, Type elementType)
      throws OpenDataException {

        final OpenConverter elementConverter = toConverter(elementType);
  final OpenType elementOpenType = elementConverter.getOpenType();
  final ArrayType openType = new ArrayType(1, elementOpenType);
  final Class elementOpenClass = elementConverter.getOpenClass();

  final Class openArrayClass;
        final String openArrayClassName;
        if (elementOpenClass.isArray())
View Full Code Here

            _bindingItemNames = new String[]{"Binding Key", "Queue Names"};
            _bindingItemIndexNames = new String[]{_bindingItemNames[0]};
           
            _bindingItemTypes = new OpenType[2];
            _bindingItemTypes[0] = SimpleType.STRING;
            _bindingItemTypes[1] = new ArrayType(1, SimpleType.STRING);
            _bindingDataType = new CompositeType("Exchange Binding", "Binding key and Queue names",
                                                 _bindingItemNames, _bindingItemNames, _bindingItemTypes);
            _bindinglistDataType = new TabularType("Exchange Bindings", "Exchange Bindings for " + getName(),
                                                   _bindingDataType, _bindingItemIndexNames);
        }
View Full Code Here

    private static void init() throws OpenDataException
    {
        _msgContentAttributeTypes[0] = SimpleType.LONG; // For message id
        _msgContentAttributeTypes[1] = SimpleType.STRING; // For MimeType
        _msgContentAttributeTypes[2] = SimpleType.STRING; // For Encoding
        _msgContentAttributeTypes[3] = new ArrayType(1, SimpleType.BYTE); // For message content
        _msgContentType =
            new CompositeType("Message Content", "AMQ Message Content", _msgContentAttributes, _msgContentAttributes,
                _msgContentAttributeTypes);

        _msgAttributeTypes[0] = SimpleType.LONG; // For message id
        _msgAttributeTypes[1] = new ArrayType(1, SimpleType.STRING); // For header attributes
        _msgAttributeTypes[2] = SimpleType.LONG; // For size
        _msgAttributeTypes[3] = SimpleType.BOOLEAN; // For redelivered

        _messageDataType =
            new CompositeType("Message", "AMQ Message", _msgAttributeNames, _msgAttributeNames, _msgAttributeTypes);
View Full Code Here

            _bindingItemIndexNames = new String[]{_bindingItemNames[0]};

            _bindingItemTypes = new OpenType[3];
            _bindingItemTypes[0] = SimpleType.INTEGER;
            _bindingItemTypes[1] = SimpleType.STRING;
            _bindingItemTypes[2] = new ArrayType(1, SimpleType.STRING);
            _bindingDataType = new CompositeType("Exchange Binding", "Queue name and header bindings",
                                                 _bindingItemNames, _bindingItemNames, _bindingItemTypes);
            _bindinglistDataType = new TabularType("Exchange Bindings", "List of exchange bindings for " + getName(),
                                                   _bindingDataType, _bindingItemIndexNames);
        }
View Full Code Here

    private static void init() throws OpenDataException
    {
        _msgContentAttributeTypes[0] = SimpleType.LONG; // For message id
        _msgContentAttributeTypes[1] = SimpleType.STRING; // For MimeType
        _msgContentAttributeTypes[2] = SimpleType.STRING; // For Encoding
        _msgContentAttributeTypes[3] = new ArrayType(1, SimpleType.BYTE); // For message content
        _msgContentType =
            new CompositeType("Message Content", "AMQ Message Content", _msgContentAttributes, _msgContentAttributes,
                _msgContentAttributeTypes);

        _msgAttributeTypes[0] = SimpleType.LONG; // For message id
        _msgAttributeTypes[1] = new ArrayType(1, SimpleType.STRING); // For header attributes
        _msgAttributeTypes[2] = SimpleType.LONG; // For size
        _msgAttributeTypes[3] = SimpleType.BOOLEAN; // For redelivered

        _messageDataType =
            new CompositeType("Message", "AMQ Message", _msgAttributeNames, _msgAttributeNames, _msgAttributeTypes);
View Full Code Here

                    SimpleType.LONG,
                    SimpleType.LONG,
                    SimpleType.STRING,
                    SimpleType.LONG,
                    SimpleType.STRING,
                    new ArrayType(1, createGoodStackTraceElementCompositeType()) };
            result = new CompositeType(ThreadInfo.class.getName(),
                    ThreadInfo.class.getName(), typeNames, typeDescs, typeTypes);
        } catch (OpenDataException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
View Full Code Here

        final Class    elementClass  = theClass.getComponentType();
       
        final SimpleType  simpleType  = getSimpleType( elementClass );
        if ( simpleType != null )
        {
          type  = new ArrayType( dimensions, simpleType );
        }
        else
        {
          final Object  element  = getAnyArrayElement( o );
         
          if ( CompositeData.class.isAssignableFrom( elementClass ) )
          {
            if ( element == null )
            {
              type  = SimpleType.VOID;
            }
            else
            {
              type  = new ArrayType( dimensions, ((CompositeData)element).getCompositeType() );
            }
          }
          else if ( TabularData.class.isAssignableFrom( elementClass ) )
          {
            if ( element == null )
            {
              type  = SimpleType.VOID;
            }
            else
            {
              type  = new ArrayType( dimensions, ((TabularData)element).getTabularType() );
            }
          }
        }
       
      }
View Full Code Here

   
    final OpenType[]  openTypes  = new OpenType[ itemNames.length ];
   
    openTypes[ 0 = SimpleType.STRING;
    openTypes[ 1 = t.getCause() == null ? SimpleType.VOID : getThrowableOpenType( t.getCause() );
    openTypes[ 2 = new ArrayType( t.getStackTrace().length,
              getStackTraceElementOpenType() );
   
   
    return( new CompositeType(
      t.getClass().getName(),
View Full Code Here

TOP

Related Classes of javax.management.openmbean.ArrayType

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.