Package org.jboss.metatype.api.values

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


      result.stackName = getSimpleValue(compVal, "stackName", String.class);
     
      MetaValue mv = compVal.get("protocolStackConfiguration");
      assertNotNull(result.stackName + " has a protocolStackConfiguration", mv);
      assertTrue("protocolStackConfiguration (" + mv.getClass().getSimpleName() + ") is a CollectionValue",mv instanceof CollectionValue);
      CollectionValue config = (CollectionValue) mv;
      MetaValue[] elements = config.getElements();
      for (MetaValue element : elements)
      {
         ManagedObjectTestUtil.validateProtocolStackConfiguration(element);
      }
     
      mv = compVal.get("channelObjectName");
      validateObjectNameMetaValue(mv);
     
      mv = compVal.get("protocolObjectNames");
      assertNotNull(result.stackName + " has protocolObjectNames", mv);
      assertTrue("protocolObjectNames (" + mv.getClass().getSimpleName() + ") is a CollectionValue", mv instanceof CollectionValue);
      CollectionValue protocolNames = (CollectionValue) mv;
      elements = protocolNames.getElements();
      for (MetaValue element : elements)
      {
         validateObjectNameMetaValue(element);
      }
     
View Full Code Here


      assertNotNull(getSimpleValue(compVal, "creator", String.class));
      String coord = getSimpleValue(compVal, "coordinator", String.class);
      assertNotNull(coord);
      MetaValue mv = compVal.get("members");
      assertTrue(mv instanceof CollectionValue);
      CollectionValue protocolNames = (CollectionValue) mv;
      MetaValue[] elements = protocolNames.getElements();
      boolean foundCoord = false;
      for (MetaValue element : elements)
      {
         assertTrue(element instanceof SimpleValue);
         Object val = ((SimpleValue) element).getValue();
View Full Code Here

      }
   }
  
   protected ManagedComponent createDSComponent(ManagedObject deployment)
   {
      CollectionValue collection = (CollectionValue) deployment.getProperty("deployments").getValue();
      GenericValue generic = (GenericValue) collection.iterator().next();
      ManagedObject mo = (ManagedObject) generic.getValue();
      return createComponent(mo);
   }
View Full Code Here

        
         String name = (String) ((SimpleValue) stackValue.get("name")).getValue();
        
         String description = (String) ((SimpleValue) stackValue.get("description")).getValue();
        
         CollectionValue protocolsValue = (CollectionValue) stackValue.get("configuration");
         ProtocolData[] protocolData = CONFIG_MAPPER.unwrapMetaValue(protocolsValue)
         // fixes http://jira.jboss.com/jira/browse/JGRP-290
         ProtocolStackUtil.substituteVariables(protocolData); // replace vars with system props
        
         result.put(stack, new ProtocolStackConfigInfo(name, description, protocolData));
View Full Code Here

   }
  
   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

      // Create the ManagedObjects
      ManagedObject deploymentMO = getMOF().initManagedObject(deployment, null);
      ManagedObject mo = getMOF().initManagedObject(bmd, null);
      assertNotNull(mo);
      // Change the value
      CollectionValue bindingSets = (CollectionValue) mo.getProperty("standardBindings").getValue();
      assertNotNull(bindingSets);
      setPortValue("HttpsConnector", bindingSets, 13245);

      // Persist
      ManagedComponent component = new ManagedComponentImpl(null, null, mo);
View Full Code Here

      MapCompositeValueSupport newParametersValue = cloneCompositeValue((CompositeValue) parametersValue);
      newParametersValue.put("oob_thread_pool.max_threads", newVal);
      MapCompositeValueSupport newUdp = cloneCompositeValue((CompositeValue) udp);
      newUdp.put("protocolParameters", newParametersValue);
      protocols[0] = newUdp;
      CollectionValue newConfigurationValue =
         new CollectionValueSupport(((CollectionValue) configurationValue).getMetaType(), protocols);
      MapCompositeValueSupport updatedStack = cloneCompositeValue((CompositeValue) stackValue);
      updatedStack.put("configuration", newConfigurationValue);
      MapCompositeValueSupport newMapValue = cloneCompositeValue((CompositeValue) mapValue);
      newMapValue.put("udp-async", updatedStack);
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

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.