Package org.jboss.metatype.api.values

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


   }
  
   protected ManagedComponent createJMSComponent(ManagedObject serviceDeploymentMO)
   {
      assertNotNull(serviceDeploymentMO);
      CollectionValue collection = (CollectionValue) serviceDeploymentMO.getProperty("services").getValue();
      assertNotNull(collection);
      GenericValue topic = (GenericValue) collection.iterator().next();
      assertNotNull(topic);
      ManagedObject topicMO = (ManagedObject) topic.getValue();
      return createComponent(topicMO);
   }
View Full Code Here


   }
  
   protected ManagedProperty getProperty(ManagedObject serviceDeploymentMO, String propertyName)
   {
      assertNotNull(serviceDeploymentMO);
      CollectionValue collection = (CollectionValue) serviceDeploymentMO.getProperty("services").getValue();
      assertNotNull(collection);
      GenericValue topic = (GenericValue) collection.iterator().next();
      assertNotNull(topic);
      ManagedObject topicMO = (ManagedObject) topic.getValue();
      assertNotNull(topicMO);
     
      // downCacheSize
View Full Code Here

            {
               CollectionMetaType amt = (CollectionMetaType) propType;
               MetaType etype = amt.getElementType();
               if (etype == AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE)
               {
                  CollectionValue avalue = (CollectionValue) deployments.getValue();
                  if(avalue != null)
                  {
                     MetaValue[] elements = avalue.getElements();
                     for(int n = 0; n < avalue.getSize(); n ++)
                     {
                        GenericValue gv = (GenericValue) elements[n];
                        ManagedObject propMO = (ManagedObject) gv.getValue();
                        managedObjects.put(propMO.getName(), propMO);
                     }
View Full Code Here

      CollectionMetaType arrayType = assertInstanceOf(resolve(type), CollectionMetaType.class);
      MetaValue[] metaArray = { SimpleValueSupport.wrap("Hello"), SimpleValueSupport.wrap("Goodbye") };
      CollectionValueSupport expected = new CollectionValueSupport(arrayType, metaArray);
     
      MetaValue result = createMetaValue(collection, type);
      CollectionValue actual = assertInstanceOf(result, CollectionValue.class);
      getLog().debug("Collection Value: " + actual);
      assertEquals(expected, actual);
   }
View Full Code Here

      CompositeValue goodbyeValue = new CompositeValueSupport(compositeType, itemNames, itemValues);
      MetaValue[] metaArray = { helloValue, goodbyeValue };
      CollectionValueSupport expected = new CollectionValueSupport(arrayType, metaArray);
     
      MetaValue result = createMetaValue(collection, type);
      CollectionValue actual = assertInstanceOf(result, CollectionValue.class);
      getLog().debug("Collection Value: " + actual);
      assertEquals(expected, actual);
   }
View Full Code Here

      ManagedDeploymentImpl md = new ManagedDeploymentImpl("testManagementDeploymentMO",
            "testManagementDeploymentMO", DeploymentPhase.APPLICATION, null, unitMOs);
      // Create ManagedComponents for the destinations
      ManagedProperty destinationsMP = mo.getProperty("destinations");
      assertNotNull(destinationsMP);
      CollectionValue destinationsValue = (CollectionValue) destinationsMP.getValue();
      assertNotNull(destinationsValue);
      assertEquals(1, destinationsValue.getSize());
      GenericValue q1GV = (GenericValue) destinationsValue.getElements()[0];
      assertNotNull(q1GV);
      ManagedObject q1MO = (ManagedObject) q1GV.getValue();
      assertNotNull(q1MO);

      ComponentType type = new ComponentType("JMSDestination", "queue");
View Full Code Here

         // recalculate element info, since usually more deterministic
         TypeInfo typeInfo = configuration.getTypeInfo(ce.getClass());
         MetaType metaType = metaTypeFactory.resolve(typeInfo);
         elements[i++] = internalCreate(ce, typeInfo, metaType);            
      }
      CollectionValue result = new CollectionValueSupport(type, elements);
      mapping.put(value, result);
      return result;
   }
View Full Code Here

         CompositeValue compositeValue = (CompositeValue)metaValue;
         return unwrapComposite(compositeValue, type);
      }
      else if (metaType.isCollection())
      {
         CollectionValue collectionValue = (CollectionValue)metaValue;
         return unwrapCollection(collectionValue, type);
      }
      else if (metaType.isTable())
      {
         TableValue tableValue = (TableValue)metaValue;
View Full Code Here

   }

   @Override
   public Collection<ManagedConnectionFactoryPropertyMetaData> unwrapMetaValue(MetaValue metaValue)
   {
      CollectionValue cvalue = (CollectionValue) metaValue;
      MetaValue[] elements = cvalue.getElements();
      ArrayList<ManagedConnectionFactoryPropertyMetaData> values = new ArrayList<ManagedConnectionFactoryPropertyMetaData>();
      if(elements != null)
      {
         for(MetaValue mv : elements)
         {
View Full Code Here

      ManagedObject managedObject = initManagedObject(destinations);
      checkManagedObjectDefaults(JmsDestinations.class, managedObject);

      ManagedProperty destinationsMP = managedObject.getProperty("destinations");
      assertNotNull(destinationsMP);
      CollectionValue destinationsValue = (CollectionValue) destinationsMP.getValue();
      assertNotNull(destinationsValue);
      assertEquals(1, destinationsValue.getSize());
      GenericValue q1GV = (GenericValue) destinationsValue.getElements()[0];
      assertNotNull(q1GV);

      ManagedObject q1MO = (ManagedObject) q1GV.getValue();
      assertNotNull(q1MO);
      ManagedProperty domain = q1MO.getProperty("domain");
View Full Code Here

TOP

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

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.