Package org.jboss.metatype.api.values

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


  public MetaValue createMetaValue(MetaType metaType, CacheStatisticsMetadata object) {
    if (object == null)
      return null;
    if (metaType instanceof CompositeMetaType) {
      CompositeMetaType composite = (CompositeMetaType) metaType;
      CompositeValueSupport cache = new CompositeValueSupport(composite);
     
      cache.set(TOTAL_ENTRIES, SimpleValueSupport.wrap(object.getTotalEntries()));
      cache.set(HITRATIO, SimpleValueSupport.wrap(object.getHitRatio()));
      cache.set(REQUEST_COUNT, SimpleValueSupport.wrap(object.getRequestCount()));
     
      return cache;
    }
    throw new IllegalArgumentException("Cannot convert cache statistics " + object); //$NON-NLS-1$
  }
View Full Code Here


      // A metadata type with a null type-mapping, JBAS-6215
      MutableCompositeMetaType metadataType = new MutableCompositeMetaType("org.jboss.resource.metadata.mcf.DBMSMetaData", "metadata type");
      metadataType.addItem("typeMapping", "The jdbc type mapping", SimpleMetaType.STRING);
      HashMap<String, MetaValue> items = new HashMap<String, MetaValue>();
      items.put("typeMapping", null);
      CompositeValueSupport metadata = new CompositeValueSupport(metadataType, items);
      propValues.put("metadata", metadata);

      // todo: connection-properties
   }
View Full Code Here

     
      map.put("read", new SimpleValueSupport(SimpleMetaType.BOOLEAN, read));
      map.put("write", new SimpleValueSupport(SimpleMetaType.BOOLEAN, write));
      map.put("create", new SimpleValueSupport(SimpleMetaType.BOOLEAN, create));
     
      return new CompositeValueSupport(composite, map);
   }
View Full Code Here

      assertNotNull("security-domain.deploymentType", sdCV.get("securityDeploymentType"));
      assertEquals("APPLICATION", ((EnumValue) sdCV.get("securityDeploymentType")).getValue());
      assertFalse(lds.getSecurityMetaData() instanceof SecurityDomainApplicationManagedMetaData);
     
      // Set a new security domain and check if the metaType changed
      CompositeValueSupport newSecDomain = new CompositeValueSupport(compType);
      newSecDomain.set("domain", SimpleValueSupport.wrap("test"));
      newSecDomain.set("securityDeploymentType", new EnumValueSupport(
            (EnumMetaType) compType.getType("securityDeploymentType"),
            SecurityDeploymentType.DOMAIN_AND_APPLICATION));
      secDomain.setValue(newSecDomain);
     
      assertTrue(lds.getSecurityMetaData() instanceof SecurityDomainApplicationManagedMetaData);
View Full Code Here

   }

   @Override
   public MetaValue createMetaValue(MetaType metaType, ConnectionFactoryControl control)
   {
      CompositeValueSupport cvs = new CompositeValueSupport(TYPE);
      cvs.set("name", new SimpleValueSupport(SimpleMetaType.STRING, control.getName()));
      List<org.hornetq.api.core.Pair<TransportConfiguration, TransportConfiguration>> pairs = control.getStaticConnectors();
      StringBuffer liveTransportClassNames = new StringBuffer();
      StringBuffer liveTransportParams = new StringBuffer();
      StringBuffer backupTransportClassNames = new StringBuffer();
      StringBuffer backupTransportParams = new StringBuffer();
      for (Pair<TransportConfiguration, TransportConfiguration> pair : pairs)
      {
         if (pair.a != null)
         {
            TransportConfiguration live = pair.a;
            if(liveTransportClassNames.length() > 0)
            {
               liveTransportClassNames.append(",");
            }
            liveTransportClassNames.append(live.getFactoryClassName());

            Map<String, Object> params = live.getParams();
            liveTransportParams.append("{");
            for (Map.Entry<String, Object> stringObjectEntry : params.entrySet())
            {
               if(liveTransportParams.length() > 1)
               {
                  liveTransportParams.append(",");
               }
               liveTransportParams.append(stringObjectEntry.getKey()).append("=").append(stringObjectEntry.getValue());
            }
            liveTransportParams.append("}");
         }

         if (pair.b != null)
         {
            TransportConfiguration backUp = pair.b;
            if(backupTransportClassNames.length() > 0)
            {
               backupTransportClassNames.append(",");
            }
            backupTransportClassNames.append(backUp.getFactoryClassName());

            Map<String, Object> params = backUp.getParams();
            backupTransportParams.append("{");
            for (Map.Entry<String, Object> stringObjectEntry : params.entrySet())
            {
               if(backupTransportParams.length() > 1)
               {
                  backupTransportParams.append(",");
               }
               backupTransportParams.append(stringObjectEntry.getKey()).append("=").append(stringObjectEntry.getValue());
            }
            backupTransportParams.append("}");
         }

      }
      cvs.set("liveTransportClassNames", new SimpleValueSupport(SimpleMetaType.STRING, liveTransportClassNames));
      cvs.set("liveTransportParams", new SimpleValueSupport(SimpleMetaType.STRING, liveTransportParams));
      cvs.set("backupTransportClassNames", new SimpleValueSupport(SimpleMetaType.STRING, backupTransportClassNames));
      cvs.set("backupTransportParams", new SimpleValueSupport(SimpleMetaType.STRING, backupTransportParams));
      cvs.set("Bindings", new SimpleValueSupport(SimpleMetaType.STRING, getJndiString(control.getJNDIBindings())));
      cvs.set("DiscoveryAddress", new SimpleValueSupport(SimpleMetaType.STRING, control.getDiscoveryAddress()));
      cvs.set("DiscoveryPort", new SimpleValueSupport(SimpleMetaType.STRING, control.getDiscoveryPort()));
      cvs.set("DiscoveryRefreshTimeout", new SimpleValueSupport(SimpleMetaType.STRING, control.getDiscoveryRefreshTimeout()));
      cvs.set("DiscoveryInitialWaitTimeout", new SimpleValueSupport(SimpleMetaType.STRING, control.getDiscoveryInitialWaitTimeout()));
      cvs.set("ClientID", new SimpleValueSupport(SimpleMetaType.STRING, control.getClientID()));
      cvs.set("DupsOKBatchSize", new SimpleValueSupport(SimpleMetaType.STRING, control.getDupsOKBatchSize()));
      cvs.set("TransactionBatchSize", new SimpleValueSupport(SimpleMetaType.STRING, control.getTransactionBatchSize()));
      cvs.set("ClientFailureCheckPeriod", new SimpleValueSupport(SimpleMetaType.STRING, control.getClientFailureCheckPeriod()));
      cvs.set("ConnectionTTL", new SimpleValueSupport(SimpleMetaType.STRING, control.getConnectionTTL()));
      cvs.set("CallTimeout", new SimpleValueSupport(SimpleMetaType.STRING, control.getCallTimeout()));
      cvs.set("ConsumerWindowSize", new SimpleValueSupport(SimpleMetaType.STRING, control.getConfirmationWindowSize()));
      cvs.set("ConsumerMaxRate", new SimpleValueSupport(SimpleMetaType.STRING, control.getConsumerMaxRate()));
      cvs.set("ConfirmationWindowSize", new SimpleValueSupport(SimpleMetaType.STRING, control.getConfirmationWindowSize()));
      cvs.set("ProducerMaxRate", new SimpleValueSupport(SimpleMetaType.STRING, control.getProducerMaxRate()));
      cvs.set("ProducerWindowSize", new SimpleValueSupport(SimpleMetaType.STRING, control.getProducerWindowSize()));
      cvs.set("CacheLargeMessagesClient", new SimpleValueSupport(SimpleMetaType.STRING, control.isCacheLargeMessagesClient()));
      cvs.set("MinLargeMessageSize", new SimpleValueSupport(SimpleMetaType.STRING, control.getMinLargeMessageSize()));
      cvs.set("BlockOnNonDurableSend", new SimpleValueSupport(SimpleMetaType.STRING, control.isBlockOnNonDurableSend()));
      cvs.set("BlockOnAcknowledge", new SimpleValueSupport(SimpleMetaType.STRING, control.isBlockOnAcknowledge()));
      cvs.set("BlockOnDurableSend", new SimpleValueSupport(SimpleMetaType.STRING, control.isBlockOnDurableSend()));
      cvs.set("AutoGroup", new SimpleValueSupport(SimpleMetaType.STRING, control.isAutoGroup()));
      cvs.set("PreAcknowledge", new SimpleValueSupport(SimpleMetaType.STRING, control.isPreAcknowledge()));
      cvs.set("MaxRetryInterval", new SimpleValueSupport(SimpleMetaType.STRING, control.getMaxRetryInterval()));
      cvs.set("RetryIntervalMultiplier", new SimpleValueSupport(SimpleMetaType.STRING, control.getRetryIntervalMultiplier()));
      cvs.set("ReconnectAttempts", new SimpleValueSupport(SimpleMetaType.STRING, control.getReconnectAttempts()));
      cvs.set("FailoverOnServerShutdown", new SimpleValueSupport(SimpleMetaType.STRING, control.isFailoverOnServerShutdown()));
      cvs.set("ScheduledThreadPoolMaxSize", new SimpleValueSupport(SimpleMetaType.STRING, control.getScheduledThreadPoolMaxSize()));
      cvs.set("ThreadPoolMaxSize", new SimpleValueSupport(SimpleMetaType.STRING, control.getThreadPoolMaxSize()));
      cvs.set("GroupID", new SimpleValueSupport(SimpleMetaType.STRING, control.getGroupID()));
      cvs.set("InitialMessagePacketSize", new SimpleValueSupport(SimpleMetaType.STRING, control.getInitialMessagePacketSize()));
      cvs.set("UseGlobalPools", new SimpleValueSupport(SimpleMetaType.STRING, control.isUseGlobalPools()));
      cvs.set("RetryInterval", new SimpleValueSupport(SimpleMetaType.STRING, control.getRetryInterval()));
      cvs.set("ConnectionLoadBalancingPolicyClassName", new SimpleValueSupport(SimpleMetaType.STRING, control.getConnectionLoadBalancingPolicyClassName()));
      return cvs;
   }
View Full Code Here

         for(Object o : object)
         {
            Map m = (Map) o;
            try
            {
               CompositeValueSupport cvs = new CompositeValueSupport(MSG_TYPE);
               cvs.set("JMSMessageID", SimpleValueSupport.wrap((Serializable) m.get("JMSMessageID").toString()));
               cvs.set("JMSTimestamp", SimpleValueSupport.wrap((Serializable) m.get("JMSTimestamp").toString()));
               cvs.set("JMSPriority", SimpleValueSupport.wrap((Serializable) m.get("JMSPriority").toString()));
               cvs.set("JMSDeliveryMode", SimpleValueSupport.wrap((Serializable) m.get("JMSDeliveryMode").toString()));
               cvs.set("JMSExpiration", SimpleValueSupport.wrap((Serializable) m.get("JMSExpiration").toString()));
               tmp.add(cvs);
            }
            catch(Exception e)
            {
               log.warn("Skipping msg: "+m, e);
View Full Code Here

         for(Object o : object)
         {
            Object[] m = (Object[]) o;
            try
            {
               CompositeValueSupport cvs = new CompositeValueSupport(MSG_TYPE);
               if(m[0] != null)
                  cvs.set("name", SimpleValueSupport.wrap((Serializable) m[0].toString()));
               if(m[1] != null)
                  cvs.set("clientID", SimpleValueSupport.wrap((Serializable) m[1].toString()));
               if(m[2] != null)
                  cvs.set("subName", SimpleValueSupport.wrap((Serializable) m[2].toString()));
               if(m[3] != null)
                  cvs.set("durable", SimpleValueSupport.wrap((Serializable) m[3].toString()));
               if(m[4] != null)
                  cvs.set("messageCount", SimpleValueSupport.wrap((Serializable) m[4].toString()));
               if(m[5] != null)
                  cvs.set("filter", SimpleValueSupport.wrap((Serializable) m[5].toString()));
               tmp.add(cvs);
            }
            catch(Exception e)
            {
               log.warn("Skipping msg: "+m, e);
View Full Code Here

   }

   @Override
   public MetaValue createMetaValue(MetaType metaType, Object[] val)
   {
      CompositeValueSupport cvs = new CompositeValueSupport(ADDRESS_SETTINGS_TYPE);
      if (val[0] instanceof JMSQueueConfiguration)
      {
         JMSQueueConfiguration queueConfiguration = (JMSQueueConfiguration) val[0];
         cvs.set("name", new SimpleValueSupport(SimpleMetaType.STRING, queueConfiguration.getName()));
         cvs.set("jndiBindings", new SimpleValueSupport(SimpleMetaType.STRING, getJndiString(queueConfiguration.getBindings())));
      }
      else
      {
         TopicConfiguration topicConfiguration = (TopicConfiguration) val[0];
         cvs.set("name", new SimpleValueSupport(SimpleMetaType.STRING, topicConfiguration.getName()));
         cvs.set("jndiBindings", new SimpleValueSupport(SimpleMetaType.STRING, getJndiString(topicConfiguration.getBindings())));
      }
      AddressSettingsInfo addressSettings = (AddressSettingsInfo) val[1];
      cvs.set("dla", new SimpleValueSupport(SimpleMetaType.STRING, addressSettings.getDeadLetterAddress()));
      cvs.set("expiryAddress", new SimpleValueSupport(SimpleMetaType.STRING, addressSettings.getExpiryAddress()));
      cvs.set("maxSize", new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, addressSettings.getMaxSizeBytes()));
      cvs.set("pageSize", new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, addressSettings.getPageSizeBytes()));
      cvs.set("maxDeliveryAttempts", new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, addressSettings.getMaxDeliveryAttempts()));
      cvs.set("redeliveryDelay", new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, addressSettings.getRedeliveryDelay()));
      cvs.set("lastValueQueue", new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, addressSettings.isLastValueQueue()));
      cvs.set("redistributionDelay", new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, addressSettings.getRedistributionDelay()));
      cvs.set("sendToDLAOnNoRoute", new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, addressSettings.isSendToDLAOnNoRoute()));
      cvs.set("addressFullMessagePolicy", new SimpleValueSupport(SimpleMetaType.STRING, addressSettings.getAddressFullMessagePolicy()));
      if(val.length == 3)
      {
         ArrayList<MetaValue> tmp = new ArrayList<MetaValue>();
         RoleInfo[] roles = (RoleInfo[]) val[2];
         for (RoleInfo role : roles)
         {
            CompositeValueSupport cvs2 = new CompositeValueSupport(SECURITY_TYPE);
            cvs2.set("name", new SimpleValueSupport(SimpleMetaType.STRING, role.getName()));
            cvs2.set("send", new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, role.isSend()));
            cvs2.set("consume", new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, role.isConsume()));
            cvs2.set("createDurableQueue", new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, role.isCreateDurableQueue()));
            cvs2.set("deleteDurableQueue", new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, role.isDeleteDurableQueue()));
            cvs2.set("createNonDurableQueue", new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, role.isCreateNonDurableQueue()));
            cvs2.set("deleteNonDurableQueue", new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, role.isDeleteNonDurableQueue()));
            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);
View Full Code Here

            // FIXME -- deal with description
//            protocolValue.put("description", SimpleValueSupport.wrap(params[j].getDescription()));
//            paramValue.put("description", null);
            paramValue.put("value", SimpleValueSupport.wrap(params[j].getValue()));
           
            paramValues.put(params[j].getName(), new CompositeValueSupport(PROTOCOL_PARAMETER_TYPE, paramValue));
         }
         protocolValue.put("protocolParameters", new MapCompositeValueSupport(paramValues, PROTOCOL_PARAMETER_MAP_TYPE));
        
         dataElements[i] = new MapCompositeValueSupport(protocolValue, PROTOCOL_STACK_CONFIG_TYPE);
      }
View Full Code Here

         stackValue.put("description", SimpleValueSupport.wrap(info.getDescription()));
        
         ProtocolData[] data = info.getConfiguration();        
         stackValue.put("configuration", CONFIG_MAPPER.createMetaValue(CONFIG_MAPPER.getMetaType(), data));
        
         result.put(entry.getKey(), new CompositeValueSupport(TYPE, stackValue));
      }
     
      return new MapCompositeValueSupport(result, TYPE);
   }
View Full Code Here

TOP

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

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.