Examples of MetaValue


Examples of com.voytechs.jnetstream.io.meta.MetaValue

   
    protected void dumpMetaData() throws FileNotFoundException, IOException, EOPacketStream, StreamFormatException, SyntaxError {
        RawformatInputStream stream;
        java.util.Enumeration metaData;
        //CaptureMetaEnumerator metaData;
        MetaValue value;
       
        stream = new RawformatInputStream(fileName);
        metaData = stream.getMetaEnumeration();
       
        while ( metaData.hasMoreElements() ) {
View Full Code Here

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

    // Check if the property is readable
    if (propertyInfo != null && propertyInfo.isReadable() == false)
      return null;

    MetaValue value = null;
    if (TRANSLATOR_PROPERTY.equals(property.getName())) {
      MapCompositeValueSupport mapValue = new MapCompositeValueSupport(SimpleMetaType.STRING);
      List<PropertyMetadata> list = attachment.getJAXBProperties();
      if (list != null) {
        for (PropertyMetadata prop : list) {
          String name = prop.getName();
          MetaValue svalue = SimpleValueSupport.wrap(prop.getValue());
          mapValue.put(name, svalue);
        }
      }
      value = mapValue;
    } else {
View Full Code Here

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

  }

  public static MapCompositeValueSupport compositeValueMap(Map<String, String> map) {
    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

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

       else if (metaType.isComposite()) {
        Properties props = new Properties();
        MapCompositeValueSupport map = (MapCompositeValueSupport) mp.getValue();
        MapCompositeMetaType type = map.getMetaType();
        for (String key : type.keySet()) {
          MetaValue value = map.get(key);
          props.setProperty(key, stringValue(value));
        }
        return props;
       }
       throw new IllegalArgumentException(prop+ " is not a properties type"); //$NON-NLS-1$
View Full Code Here

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

    try {
      Object t = clazz.newInstance();
     
      Map<String, ManagedProperty> managedProperties = mc.getProperties();
      for (ManagedProperty mp: managedProperties.values()) {
        MetaValue value = mp.getValue();
        if (value != null) {
          MetaType type = value.getMetaType();
          if (type.isSimple()) {
            PropertiesUtils.setBeanProperty(t, mp.getMappedName(), ((SimpleValue)value).getValue());
          }
          else if (type.isPrimitive()) {
            PropertiesUtils.setBeanProperty(t, mp.getMappedName(), ((SimpleValue)value).getValue());
View Full Code Here

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

      for (String key:sourceInfo.getProperties().keySet()) {
        ManagedProperty mp = propertyMap.get(key);
               
        if (mp != null) {
          // property found in target, so just add as value
          MetaValue value = sourceInfo.getProperties().get(key).getValue();
          if (ManagedUtil.sameValue(mp.getDefaultValue(), value)) {
            continue;
          }   
         
          if (value != null) {
            mp.setValue(value);
          }
        }
        else {
          // property not found in the target; add as "config-property"
          mp = sourceInfo.getProperties().get(key);
          if (ManagedUtil.sameValue(mp.getDefaultValue(), mp.getValue())) {
            continue;
         
         
          if (mp.getValue() != null) {
            configProps.put(key, ManagedUtil.stringValue(mp.getValue()));
            configProps.put(key+".type", mp.getValue().getMetaType().getClassName());//$NON-NLS-1$ 
          }
        }
      }
     
      if (configProps.size() > 0) {
        MetaValue metaValue = ManagedUtil.compositeValueMap(configProps);
        targetInfo.getProperties().get("config-property").setValue(metaValue);//$NON-NLS-1$         
      }
      return this.targetTemplate.applyTemplate(targetInfo);

    } catch (NoSuchDeploymentException e) {
View Full Code Here

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

  @Override
  public Collection<Session> getSessions() throws AdminException {
    try {
      Collection<Session> sessionList = new ArrayList<Session>();
      ManagedComponent mc = getView().getComponent(DQPNAME, DQPTYPE)
      MetaValue value = ManagedUtil.executeOperation(mc, "getActiveSessions");//$NON-NLS-1$
      MetaValue[] sessions = ((CollectionValueSupport)value).getElements();
      for (MetaValue mv:sessions) {
        sessionList.add((SessionMetadata)MetaValueFactory.getInstance().unwrap(mv, SessionMetadata.class));
      }
      return sessionList;
View Full Code Here

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

  @Override
    public Collection<Request> getRequests() throws AdminException {
    try {
      Collection<Request> requestList = new ArrayList<Request>();
      ManagedComponent mc = getView().getComponent(DQPNAME, DQPTYPE)
      MetaValue value = ManagedUtil.executeOperation(mc, "getRequests");//$NON-NLS-1$
      MetaValue[] requests = ((CollectionValueSupport)value).getElements();     
      for (MetaValue mv:requests) {
        requestList.add((RequestMetadata)MetaValueFactory.getInstance().unwrap(mv, RequestMetadata.class));
      }
      return requestList;
View Full Code Here

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

  @Override
    public Collection<Request> getRequestsForSession(String sessionId) throws AdminException {
    try {
      Collection<Request> requestList = new ArrayList<Request>();
      ManagedComponent mc = getView().getComponent(DQPNAME, DQPTYPE)
      MetaValue value = ManagedUtil.executeOperation(mc, "getRequestsForSession", SimpleValueSupport.wrap(sessionId));//$NON-NLS-1$
      MetaValue[] requests = ((CollectionValueSupport)value).getElements();
      for (MetaValue mv:requests) {
        requestList.add((RequestMetadata)MetaValueFactory.getInstance().unwrap(mv, RequestMetadata.class));
      }
      return requestList;
View Full Code Here

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

  @Override
  public Collection<String> getCacheTypes() throws AdminException {
    try {
      Collection<String> requestList = new ArrayList<String>();
      ManagedComponent mc = getView().getComponent(DQPNAME, DQPTYPE)
      MetaValue value = ManagedUtil.executeOperation(mc, "getCacheTypes");//$NON-NLS-1$
      MetaValue[] requests = ((CollectionValueSupport)value).getElements();
      for (MetaValue mv:requests) {
        requestList.add(ManagedUtil.stringValue(mv));
      }
      return requestList;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.