Package org.jboss.metatype.api.values

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


        parenComponent.name);

    // Get data roles from VDB
    ManagedProperty property = mcVdb.getProperty("dataPolicies");
    if (property != null) {
      CollectionValueSupport valueSupport = (CollectionValueSupport) property
          .getValue();
      MetaValue[] metaValues = valueSupport.getElements();

      for (MetaValue value : metaValues) {
        GenericValueSupport genValueSupport = (GenericValueSupport) value;
        ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport
            .getValue();

        String dataRoleName = ProfileServiceUtil.getSimpleValue(
            managedObject, "name", String.class);
        Boolean anyAuthenticated = ProfileServiceUtil.getSimpleValue(
            managedObject, "anyAuthenticated", Boolean.class);
        String description = ProfileServiceUtil.getSimpleValue(
            managedObject, "description", String.class);

        /**
         *
         * A discovered resource must have a unique key, that must stay
         * the same when the resource is discovered the next time
         */
        DiscoveredResourceDetails detail = new DiscoveredResourceDetails(
            discoveryContext.getResourceType(), // ResourceType
            dataRoleName, // Resource Key
            dataRoleName, // Resource Name
            null, // Version
            PluginConstants.ComponentType.DATA_ROLE.DESCRIPTION, // Description
            discoveryContext.getDefaultPluginConfiguration(), // Plugin
            // Config
            null // Process info from a process scan
        );

        Configuration configuration = detail.getPluginConfiguration();

        configuration.put(new PropertySimple("name", dataRoleName));
        configuration.put(new PropertySimple("anyAuthenticated",
            anyAuthenticated));
        configuration
            .put(new PropertySimple("description", description));

        PropertyList mappedRoleNameList = new PropertyList(
            "mappedRoleNameList");
        configuration.put(mappedRoleNameList);
        ManagedProperty mappedRoleNames = managedObject
            .getProperty("mappedRoleNames");
        if (mappedRoleNames != null) {
          CollectionValueSupport props = (CollectionValueSupport)mappedRoleNames.getValue();
          for (MetaValue mappedRoleName : props.getElements()) {
            mappedRoleNameList.add(new PropertySimple("name", ProfileServiceUtil.stringValue(mappedRoleName)));
          }

        }
        // Add to return values
View Full Code Here


            }
         }
      }
      MetaValue[] elements = new MetaValue[tmp.size()];
      tmp.toArray(elements);
      CollectionValueSupport msgs = new CollectionValueSupport(TYPE, elements);
      return msgs;
   }
View Full Code Here

            }
         }
      }
      MetaValue[] elements = new MetaValue[tmp.size()];
      tmp.toArray(elements);
      CollectionValueSupport msgs = new CollectionValueSupport(TYPE, elements);
      return msgs;
   }
View Full Code Here

            cvs2.set("manage", new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, role.isManage()));
            tmp.add(cvs2);
         }
         MetaValue[] elements = new MetaValue[tmp.size()];
         tmp.toArray(elements);
         CollectionValueSupport sec = new CollectionValueSupport(TYPE, elements);
         cvs.set("roles", sec);
      }
      return cvs;
   }
View Full Code Here

                  }
               }
            }
            GenericValue[] beanMOs = new GenericValue[tmpBeans.size()];
            tmpBeans.toArray(beanMOs);
            CollectionValueSupport values = new CollectionValueSupport(beansType, beanMOs);
            beansMP.setValue(values);
            // Update the bean factory properties
            bmdfMMO.setProperties(newProps);
         }
      }
      GenericValue[] mos = new GenericValue[tmpBFs.size()];
      tmpBFs.toArray(mos);
      CollectionValueSupport values = new CollectionValueSupport(beansFactoryType, mos);
      // This bypasses the write through back to the metadata
      beanFactoriesMP.getFields().setField(Fields.VALUE, values);
   }
View Full Code Here

         }
         protocolValue.put("protocolParameters", new MapCompositeValueSupport(paramValues, PROTOCOL_PARAMETER_MAP_TYPE));
        
         dataElements[i] = new MapCompositeValueSupport(protocolValue, PROTOCOL_STACK_CONFIG_TYPE);
      }
      return new CollectionValueSupport(TYPE, dataElements);
   }
View Full Code Here

            for (ObjectName protON : protNames)
            {
               onValues.add(valueFactory.create(protON));
            }
            data.put("protocolObjectNames",
                  new CollectionValueSupport(PROTOCOL_OBJECT_NAMES_TYPE,
                        onValues.toArray(new MetaValue[onValues.size()])));
         }
        
         data.put("localAddress", SimpleValueSupport.wrap(chInfo.getLocalAddress().toString()));
        
         MetaValue viewValue = createViewMetaValue(chInfo.getCurrentView());
         data.put("currentView", viewValue);
        
         elements.add(new MapCompositeValueSupport(data, CHANNEL_TYPE));
      }
      return new CollectionValueSupport(TYPE, elements.toArray(new MetaValue[elements.size()]));
   }
View Full Code Here

      MetaValue[] memberValues = new MetaValue[members.size()];
      for (int i = 0; i < memberValues.length; i++)
      {
         memberValues[i] = SimpleValueSupport.wrap(members.get(i).toString());
      }
      viewMap.put("members", new CollectionValueSupport(MEMBERS_TYPE, memberValues));
      if (memberValues.length > 0)
      {
         viewMap.put("coordinator", memberValues[0]);
      }
     
View Full Code Here

      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

TOP

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

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.