Package org.jboss.metatype.api.values

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


  }
 
  public static <T> void getTranslatorValues(MetaValue pValue,
      PropertyMap map, PropertyList list) throws Exception {
    MetaType metaType = pValue.getMetaType();
    MapCompositeValueSupport unwrappedvalueMap = null;
    if (metaType.isComposite()) {
      unwrappedvalueMap = (MapCompositeValueSupport) pValue;

      for (String key : unwrappedvalueMap.getMetaType().keySet()) {
        map = new PropertyMap("property");
        map.put(new PropertySimple("name", key));
        map.put(new PropertySimple("value", ProfileServiceUtil.stringValue((MetaValue)unwrappedvalueMap.get(key))));
        map.put(new PropertySimple("description", "Custom property"));
        list.add(map);
      }
    } else {
      throw new IllegalStateException(pValue + " is not a Composite type");
View Full Code Here



  public static <T> void getTranslatorValues(MetaValue pValue,
      PropertyMap map, PropertyList list) throws Exception {
    MetaType metaType = pValue.getMetaType();
    MapCompositeValueSupport unwrappedvalue = null;
    if (metaType.isComposite()) {
      unwrappedvalue = (MapCompositeValueSupport)pValue;

      for (String key : unwrappedvalue.getMetaType().keySet()) {
        map = new PropertyMap("properties");//$NON-NLS-1$
        map.put(new PropertySimple("name", key));//$NON-NLS-1$
        map.put(new PropertySimple("value", ProfileServiceUtil.stringValue((MetaValue)unwrappedvalue.get(key))));//$NON-NLS-1$
        list.add(map);
      }
    } else {
      throw new IllegalStateException(pValue + " is not a Composite type");
    }
View Full Code Here

      xaProps.put("JmsProviderAdapterJNDI.type", "java.lang.String");
      MetaValue metaValue = this.compositeValueMap(xaProps);
      propValues.put("config-property", metaValue);

      propValues.put("config-property",
            new MapCompositeValueSupport(new HashMap<String, MetaValue>(),
                  new MapCompositeMetaType(SimpleMetaType.STRING)));
      // todo: how to set the specific domain?
      //ApplicationManagedSecurityMetaData secDomain = new ApplicationManagedSecurityMetaData();
      //props.get("security-domain").setValue(secDomain);

      ComponentType compType = new ComponentType("ConnectionFactory", "NoTx");
      createComponentTest("NoTxConnectionFactoryTemplate", propValues, "testNoTxCf", compType, jndiName);

      // Validate the config-property
      ManagementView mgtView = getManagementView();
      ManagedComponent dsMC = getManagedComponent(mgtView, compType, jndiName);
      ManagedProperty configProperty = dsMC.getProperty("config-property");
      assertNotNull(configProperty);
      MetaValue value = configProperty.getValue();
      assertTrue("MapCompositeMetaType", value.getMetaType() instanceof MapCompositeMetaType);
     
      MapCompositeValueSupport cValue = (MapCompositeValueSupport) value;
      cValue.put("testKey", new SimpleValueSupport(SimpleMetaType.STRING, "testValue"));
     
      mgtView.updateComponent(dsMC);

      mgtView = getManagementView();
      dsMC = getManagedComponent(mgtView, compType, jndiName);
      configProperty = dsMC.getProperty("config-property");
      assertNotNull(configProperty);
      cValue = (MapCompositeValueSupport) configProperty.getValue();
      assertNotNull(cValue.get("testKey"));
   }
View Full Code Here

   public MapCompositeValueSupport compositeValueMap(Map<String,String> map)
   {
      // TODO: update MetaValueFactory for MapCompositeMetaType
      // MetaValue metaValue = getMetaValueFactory().create(xaPropValues, getMapType());
      MapCompositeValueSupport metaValue = new MapCompositeValueSupport(SimpleMetaType.STRING);
      for(String key : map.keySet())
      {
         MetaValue value = SimpleValueSupport.wrap(map.get(key));
         metaValue.put(key, value);
      }

      return metaValue;
   }
View Full Code Here

         Map<String, MetaValue> map = new HashMap<String, MetaValue>();
         for (String key : type.keySet())
         {
            map.put(key, toClone.get(key));
         }
         return new MapCompositeValueSupport(map, type);
      }
   }
View Full Code Here

         Map<String, MetaValue> map = new HashMap<String, MetaValue>();
         for (String key : type.keySet())
         {
            map.put(key, toClone.get(key));
         }
         return new MapCompositeValueSupport(map, type);
      }
   }
View Full Code Here

      // Security config
      Map<String, MetaValue> values = new HashMap<String, MetaValue>();
      values.put("admin", createCompositeValue(true, true, true));
      values.put("publisher", createCompositeValue(true, true, false));
      values.put("user", createCompositeValue(true, null, null));
      CompositeValue map = new MapCompositeValueSupport(values, securityConfType);
      propValues.put("securityConfig", map);
     
      createComponentTest("QueueTemplate", propValues, getName(), QueueType, jndiName);
      ManagedComponent queue = activeView.getComponent("testCreateSecureQueue", QueueType);
      assertNotNull(queue);
View Full Code Here

      if("xa-datasource-properties".equals(property.getName()))
      {
         List<XAConnectionPropertyMetaData> list = attachment.getXADataSourceProperties();
         if(list != null)
         {
            MapCompositeValueSupport map = new MapCompositeValueSupport(SimpleMetaType.STRING);
            for(XAConnectionPropertyMetaData prop : list)
            {
               MetaValue svalue = SimpleValueSupport.wrap(prop.getValue());
               map.put(prop.getName(), svalue);
            }
            metaValue = map;
         }
      }
      else
View Full Code Here

         if((value instanceof MapCompositeValueSupport) == false)
         {
            return super.unwrapValue(beanInfo, property, value);
         }
        
         MapCompositeValueSupport mapValue = (MapCompositeValueSupport) value;        
        
         List<XAConnectionPropertyMetaData> list = new ArrayList<XAConnectionPropertyMetaData>();
         for(String name : mapValue.getMetaType().keySet())
         {
            XAConnectionPropertyMetaData prop = new XAConnectionPropertyMetaData();
            prop.setName(name);
            String svalue = (String) getMetaValueFactory().unwrap(mapValue.get(name));
            prop.setValue(svalue);
            list.add(prop);
         }
         unwrapValue = list;
      }
View Full Code Here

         return null;
     
      MetaValue value = null;
      if("config-property".equals(property.getName()))
      {
         MapCompositeValueSupport mapValue = new MapCompositeValueSupport(SimpleMetaType.STRING);
         List<ManagedConnectionFactoryPropertyMetaData> list = attachment.getManagedConnectionFactoryProperties();
         if(list != null)
         {
            for(ManagedConnectionFactoryPropertyMetaData prop : list)
            {
               String name = prop.getName();              
               MetaValue svalue = SimpleValueSupport.wrap(prop.getValue());
               mapValue.put(name, svalue);
               MetaValue stype = SimpleValueSupport.wrap(prop.getType());
               mapValue.put(name+".type", stype);
            }
         }
         value = mapValue;
      }
      else
View Full Code Here

TOP

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

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.