Package org.jboss.metatype.api.values

Examples of org.jboss.metatype.api.values.SimpleValueSupport


      StringBuffer sendRoles = new StringBuffer();
      StringBuffer consumeRoles = new StringBuffer();
      createRoles(createResourceReport, name, sendRoles, consumeRoles);

      operation.invoke(new SimpleValueSupport(SimpleMetaType.STRING, name),
            new SimpleValueSupport(SimpleMetaType.STRING, jndiName),
            new SimpleValueSupport(SimpleMetaType.STRING, DLA),
            new SimpleValueSupport(SimpleMetaType.STRING, expiryAddress),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, maxSize),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, pageSize),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, pageMaxCacheSize),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, maxDeliveryAttempts),
            new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, redeliveryDelay),
            new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, lastValueQueue),
            new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, redistributionDelay),
            new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, sendToDLAOnNoRoute),
            new SimpleValueSupport(SimpleMetaType.STRING, addressFullMessagePolicy),
            new SimpleValueSupport(SimpleMetaType.STRING, sendRoles.toString()),
            new SimpleValueSupport(SimpleMetaType.STRING, consumeRoles.toString()));
      createResourceReport.setStatus(CreateResourceStatus.SUCCESS);
      createResourceReport.setResourceKey("jms.queue." + name);
      createResourceReport.setResourceName("jms.queue." + name);
   }
View Full Code Here


      StringBuffer deleteNonDurableRoles = new StringBuffer();
      StringBuffer createDurableRoles = new StringBuffer();
      StringBuffer deleteDurableRoles = new StringBuffer();
      createRoles(createResourceReport, name, sendRoles, consumeRoles, createNonDurableRoles, deleteNonDurableRoles, createDurableRoles, deleteDurableRoles);

      operation.invoke(new SimpleValueSupport(SimpleMetaType.STRING, name),
            new SimpleValueSupport(SimpleMetaType.STRING, jndiName),
            new SimpleValueSupport(SimpleMetaType.STRING, DLA),
            new SimpleValueSupport(SimpleMetaType.STRING, expiryAddress),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, maxSize),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, pageSize),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, pageMaxCacheSize),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, maxDeliveryAttempts),
            new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, redeliveryDelay),
            new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, lastValueQueue),
            new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, redistributionDelay),
            new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, sendToDLAOnNoRoute),
            new SimpleValueSupport(SimpleMetaType.STRING, addressFullMessagePolicy),
            new SimpleValueSupport(SimpleMetaType.STRING, sendRoles.toString()),
            new SimpleValueSupport(SimpleMetaType.STRING, consumeRoles.toString()),
            new SimpleValueSupport(SimpleMetaType.STRING, createDurableRoles.toString()),
            new SimpleValueSupport(SimpleMetaType.STRING, deleteDurableRoles.toString()),
            new SimpleValueSupport(SimpleMetaType.STRING, createNonDurableRoles.toString()),
            new SimpleValueSupport(SimpleMetaType.STRING, deleteNonDurableRoles.toString()));
      createResourceReport.setStatus(CreateResourceStatus.SUCCESS);
      createResourceReport.setResourceKey("jms.topic." + name);
      createResourceReport.setResourceName("jms.topic." + name);
   }
View Full Code Here

    *
    * @return the null string
    */
   protected SimpleValue initStringNull()
   {
      return new SimpleValueSupport(SimpleMetaType.STRING, null);
   }
View Full Code Here

    *
    * @return the value
    */
   protected SimpleValue initIntegerNull()
   {
      return new SimpleValueSupport(SimpleMetaType.INTEGER, null);
   }
View Full Code Here

      checkSingle(new Date(), false);
   }
  
   public void testSimpleNullUnwrap()
   {
      SimpleValueSupport nullInt = (SimpleValueSupport) SimpleValueSupport.wrap(1);
      nullInt.setValue(null);
      Integer i = (Integer) this.unwrapMetaValue(nullInt);
      assertNotNull(i);
      assertEquals(new Integer(0), i);

      SimpleValueSupport nullBoolean = (SimpleValueSupport) SimpleValueSupport.wrap(true);
      nullBoolean.setValue(null);
      Boolean b = (Boolean) this.unwrapMetaValue(nullBoolean);
      assertNotNull(b);
      assertEquals(Boolean.FALSE, b);
   }
View Full Code Here

    *
    * @throws Exception for any problem
    */
   public void testSetValue()throws Exception
   {
      SimpleValueSupport value = (SimpleValueSupport) initStringValue1();
      value.setValue("value2");
      assertEquals("value2", value.getValue());
   }
View Full Code Here

    */
   public void testErrors() throws Exception
   {
      try
      {
         new SimpleValueSupport(null, "value1");
         fail("Excepted IllegalArgumentException for null simple type");
      }
      catch (Throwable t)
      {
         checkThrowable(IllegalArgumentException.class, t);
      }

      new SimpleValueSupport(SimpleMetaType.STRING, null);
   }
View Full Code Here

   public static SimpleValue createSimpleValue(SimpleMetaType type, Serializable value)
   {
      if (value == null)
         return null;

      return new SimpleValueSupport(type, value);
   }
View Full Code Here

      simple.setLongvalue(1);
      simple.setShortvalue((short) 1);

      ManagedObject managedObject = initManagedObject(simple);
      ManagedProperty booleanvalue = managedObject.getProperty("booleanvalue");
      booleanvalue.setValue(new SimpleValueSupport(SimpleMetaType.BOOLEAN, null));
      assertEquals("booleanvalue", false, simple.isBooleanvalue());
      ManagedProperty bytevalue = managedObject.getProperty("bytevalue");
      bytevalue.setValue(new SimpleValueSupport(SimpleMetaType.BYTE, null));
      assertEquals("bytevalue", 0, simple.getBytevalue());
      ManagedProperty charactervalue = managedObject.getProperty("charactervalue");
      charactervalue.setValue(new SimpleValueSupport(SimpleMetaType.CHARACTER, null));
      assertEquals("charactervalue", '0', simple.getCharactervalue());
      ManagedProperty doublevalue = managedObject.getProperty("doublevalue");
      doublevalue.setValue(new SimpleValueSupport(SimpleMetaType.DOUBLE, null));
      assertEquals("doublevalue", 0d, simple.getDoublevalue());
      ManagedProperty floatvalue = managedObject.getProperty("floatvalue");
      floatvalue.setValue(new SimpleValueSupport(SimpleMetaType.FLOAT, null));
      assertEquals("floatvalue", 0f, simple.getFloatvalue());
      ManagedProperty integervalue = managedObject.getProperty("integervalue");
      integervalue.setValue(new SimpleValueSupport(SimpleMetaType.INTEGER, null));
      assertEquals("integervalue", 0, simple.getIntegervalue());
      ManagedProperty longvalue = managedObject.getProperty("longvalue");
      longvalue.setValue(new SimpleValueSupport(SimpleMetaType.LONG, null));
      assertEquals("longvalue", 0, simple.getLongvalue());
      ManagedProperty shortvalue = managedObject.getProperty("shortvalue");
      shortvalue.setValue(new SimpleValueSupport(SimpleMetaType.SHORT, null));
      assertEquals("shortvalue", 0, simple.getShortvalue());
   }
View Full Code Here

     * Set up a security role.
     */
    protected CompositeValue createCompositeValue(Boolean read, Boolean write, Boolean create) {
        Map<String, MetaValue> map = new HashMap<String, MetaValue>();

        map.put("read", new SimpleValueSupport(SimpleMetaType.BOOLEAN, read));
        map.put("write", new SimpleValueSupport(SimpleMetaType.BOOLEAN, write));
        map.put("create", new SimpleValueSupport(SimpleMetaType.BOOLEAN, create));

        return new CompositeValueSupport(composite, map);
    }
View Full Code Here

TOP

Related Classes of org.jboss.metatype.api.values.SimpleValueSupport

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.