Package org.jboss.metatype.api.values

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


   }
   private String getVersion(ResourceDiscoveryContext ctx) throws Exception
   {
      ManagementView managementView = getProfileService(ctx);
      ManagedOperation operation = ManagementSupport.getOperation(managementView, "JMSServerMO", "getVersion", new ComponentType("JMSManage", "ServerManage"));
      SimpleValueSupport support = (SimpleValueSupport) operation.invoke();
      return support.getValue().toString();
   }
View Full Code Here


   {
      try
      {
         ManagementView view = getProfileService();
         ManagedOperation operation = ManagementSupport.getOperation(view, getComponentName(), "isPaused", getComponentType());
         SimpleValueSupport val = (SimpleValueSupport) operation.invoke(new SimpleValueSupport(SimpleMetaType.STRING, resourceContext.getResourceKey()));
         boolean paused = ((Boolean)val.getValue()).booleanValue();
         return paused ? AvailabilityType.DOWN : AvailabilityType.UP;
      }
      catch (Exception e)
      {
         return AvailabilityType.DOWN;
View Full Code Here

      StringBuffer consumeRoles = new StringBuffer();
      createRoles(configurationUpdateReport, name, sendRoles, consumeRoles);
      try
      {
         ManagedOperation operation = ManagementSupport.getOperation(view, JMSConstants.Queue.COMPONENT_NAME, "updateQueueConfiguration", JMSConstants.Queue.COMPONENT_TYPE);
         operation.invoke(new SimpleValueSupport(SimpleMetaType.STRING, resourceContext.getResourceKey()),
             new SimpleValueSupport(SimpleMetaType.STRING, jndiName),
             new SimpleValueSupport(SimpleMetaType.STRING, DLA),
             new SimpleValueSupport(SimpleMetaType.STRING, expiryAddress),
             new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, maxSize),
             new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, pageSize),
             new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, pageMaxCacheSize),
             new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, maxDeliveryAttempts),
             new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, redeliveryDelay),
             new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, lastValueQueue),
             new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, redistributionDelay),
             new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, sendToDLAOnNoRoute),
             new SimpleValueSupport(SimpleMetaType.STRING, addressFullMessagePolicy),
             new SimpleValueSupport(SimpleMetaType.STRING, sendRoles.toString()),
             new SimpleValueSupport(SimpleMetaType.STRING, consumeRoles.toString()));
      }
      catch (Exception e)
      {
         configurationUpdateReport.setStatus(ConfigurationUpdateStatus.FAILURE);
         configurationUpdateReport.setErrorMessage(e.getMessage());
View Full Code Here

      for (PropertySimple prop : props)
      {
         String[] val = prop.getName().split(":");
         if (val.length == 1)
         {
            params[pos] = new SimpleValueSupport(SimpleMetaType.STRING, getStringValue(prop.getStringValue()));
            signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING, "java.lang.String");
         }
         else
         {
            if (val[0].equals("Boolean"))
            {
               params[pos] = new SimpleValueSupport(SimpleMetaType.STRING, getStringValue(prop.getBooleanValue()));
               signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING, "java.lang.Boolean");
            }
            else if (val[0].equals("boolean"))
            {
               params[pos] = new SimpleValueSupport(SimpleMetaType.STRING, getStringValue(prop.getBooleanValue()));
               signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING, "boolean");
            }
            else if (val[0].equals("String"))
            {
               params[pos] = new SimpleValueSupport(SimpleMetaType.STRING, getStringValue(prop.getStringValue()));
               signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING, "java.lang.String");
            }
            else if (val[0].equals("Long"))
            {
               params[pos] = new SimpleValueSupport(SimpleMetaType.STRING, getStringValue(prop.getLongValue()));
               signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING, "java.lang.Long");
            }
            else if (val[0].equals("long"))
            {
               params[pos] = new SimpleValueSupport(SimpleMetaType.STRING, getStringValue(prop.getLongValue()));
               signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING, "long");
            }
            else if (val[0].equals("Integer"))
            {
               params[pos] = new SimpleValueSupport(SimpleMetaType.STRING, getStringValue(prop.getIntegerValue()));
               signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING, "java.lang.Integer");
            }
            else if (val[0].equals("int"))
            {
               params[pos] = new SimpleValueSupport(SimpleMetaType.STRING, getStringValue(prop.getIntegerValue()));
               signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING, "int");
            }
            else if (val[0].equals("Double"))
            {
               params[pos] = new SimpleValueSupport(SimpleMetaType.STRING, getStringValue(prop.getDoubleValue()));
               signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING, "java.lang.Double");
            }
            else if (val[0].equals("double"))
            {
               params[pos] = new SimpleValueSupport(SimpleMetaType.STRING, getStringValue(prop.getDoubleValue()));
               signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING, "double");
            }
         }
         pos++;
      }
   }
View Full Code Here

   private OperationResult formatResults(Object val, String type) throws Exception
   {
      if (type == null)
      {
         SimpleValueSupport valueSupport = (SimpleValueSupport) val;
         return new OperationResult(valueSupport.getValue().toString());
      }
      else if(type.equalsIgnoreCase("String"))
      {
         SimpleValueSupport valueSupport = (SimpleValueSupport) val;
         return new OperationResult(valueSupport.getValue().toString());
      }
      else if(type.equalsIgnoreCase("JMSMessage"))
      {
         OperationResult operationResult = new OperationResult();
         Configuration c = operationResult.getComplexResults();
         PropertyList property = new PropertyList("result");
         CollectionValueSupport valueSupport = (CollectionValueSupport) val;
         MetaValue[] msgs =  valueSupport.getElements();
         for (MetaValue mv : msgs)
         {
            CompositeValueSupport msg = (CompositeValueSupport) mv;
            org.rhq.core.domain.configuration.PropertyMap p1 = new org.rhq.core.domain.configuration.PropertyMap("element");
            property.add(p1);
            ImmutableCompositeMetaType metaType = (ImmutableCompositeMetaType) msg.getMetaType();
            Set<String> keys = metaType.keySet();
            for (String key : keys)
            {
               SimpleValueSupport sattr = (SimpleValueSupport) msg.get(key);
               p1.put(new PropertySimple(key,sattr.getValue()));
            }
         }
         c.put(property);
         return operationResult;
      }
      else if (val instanceof CompositeValueSupport)
      {
         CompositeValueSupport valueSupport = (CompositeValueSupport) val;
         if (valueSupport.containsKey("cause"))
         {
            CompositeValueSupport cause = (CompositeValueSupport) valueSupport.get("cause");
            SimpleValueSupport message = (SimpleValueSupport) cause.get("message");
            Exception exception = new Exception(message.toString());
            throw exception;
         }
         return new OperationResult("not yet");
      }
      return new OperationResult("not yet");
View Full Code Here

      ArrayValueSupport value = (ArrayValueSupport) operation.invoke();

      for (int i = 0; i < value.getLength(); i++)
      {
         SimpleValueSupport queue = (SimpleValueSupport) value.getValue(i);
         ResourceType resourceType = resourceDiscoveryContext.getResourceType();
         String queueName = queue.getValue().toString();
         set.add(new DiscoveredResourceDetails(resourceType,
             queueName,
             queueName,
             "a JMS ConnectionFactory",
             "",
View Full Code Here

                                        boolean useGlobalPools,
                                        long retryInterval,
                                        String connectionLoadBalancingPolicyClassName) throws Exception
   {
      ManagedOperation operation = ManagementSupport.getOperation(managementView, COMPONENT_NAME, "updateConnectionFactory", new ComponentType("JMSManage", "ConnectionFactoryManage"));
      operation.invoke(new SimpleValueSupport(SimpleMetaType.STRING, name),
            new SimpleValueSupport(SimpleMetaType.STRING, clientId),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, dupsOkBatchSize),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, transactionBatchSize),
            new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, clientFailureCheckPeriod),
            new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, connectionTTL),
            new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, callTimeout),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, consumerWindowSize),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, confirmationWindowSize),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, producerMaxRate),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, producerWindowSize),
            new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, cacheLargeMessageClient),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, minLargeMessageSize),
            new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, blockOnNonDurableSend),
            new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, blockOnAcknowledge),
            new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, blockOnDurableSend),
            new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, autoGroup),
            new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, preAcknowledge),
            new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, maxRetryInterval),
            new SimpleValueSupport(SimpleMetaType.DOUBLE_PRIMITIVE, retryIntervalMultiplier),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, reconnectAttempts),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, scheduledThreadPoolMaxSize),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, threadPoolMaxSize),
            new SimpleValueSupport(SimpleMetaType.STRING, groupId),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, initialMessagePacketSize),
            new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, useGlobalPools),
            new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, retryInterval),
            new SimpleValueSupport(SimpleMetaType.STRING, connectionLoadBalancingPolicyClassName));

      configurationUpdateReport.setStatus(ConfigurationUpdateStatus.SUCCESS);
   }
View Full Code Here

      ArrayValueSupport value = (ArrayValueSupport) operation.invoke();

      for (int i = 0; i < value.getLength(); i++)
      {
         SimpleValueSupport queue = (SimpleValueSupport) value.getValue(i);
         ResourceType resourceType = resourceDiscoveryContext.getResourceType();
         String queueName = "jms.topic." + queue.getValue();
         set.add(new DiscoveredResourceDetails(resourceType,
             queueName,
             queueName,
             "a JMS Topic",
             "",
View Full Code Here

         }
         else if ("started".equalsIgnoreCase(measurementScheduleRequest.getName()))
         {
            ManagementView managementView = getProfileService();
            ManagedOperation operation = ManagementSupport.getOperation(managementView, "JMSServerMO", "isStarted", new ComponentType("JMSManage", "ServerManage"));
            SimpleValueSupport support = (SimpleValueSupport) operation.invoke();
            measurementReport.addData(new MeasurementDataTrait(measurementScheduleRequest, support.getValue().toString()));
         }
      }

   }
View Full Code Here

                                        long retryInterval,
                                        String connectionLoadBalancingPolicyClassName)
         throws Exception
   {
      ManagedOperation operation = ManagementSupport.getOperation(managementView, JMSConstants.ConnectionFactory.COMPONENT_NAME, "createConnectionFactory", JMSConstants.ConnectionFactory.COMPONENT_TYPE);
      operation.invoke(new SimpleValueSupport(SimpleMetaType.STRING, name),
            new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, ha),
            new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, useDiscovery),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, cfType),
            new SimpleValueSupport(SimpleMetaType.STRING, connectorNames),
            new SimpleValueSupport(SimpleMetaType.STRING, bindings),
            new SimpleValueSupport(SimpleMetaType.STRING, clientId),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, dupsOkBatchSize),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, transactionBatchSize),
            new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, clientFailureCheckPeriod),
            new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, connectionTTL),
            new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, callTimeout),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, consumerWindowSize),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, confirmationWindowSize),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, producerMaxRate),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, producerWindowSize),
            new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, cacheLargeMessageClient),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, minLargeMessageSize),
            new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, blockOnNonDurableSend),
            new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, blockOnAcknowledge),
            new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, blockOnDurableSend),
            new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, autoGroup),
            new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, preAcknowledge),
            new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, maxRetryInterval),
            new SimpleValueSupport(SimpleMetaType.DOUBLE_PRIMITIVE, retryIntervalMultiplier),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, reconnectAttempts),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, scheduledThreadPoolMaxSize),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, threadPoolMaxSize),
            new SimpleValueSupport(SimpleMetaType.STRING, groupId),
            new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, initialMessagePacketSize),
            new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, useGlobalPools),
            new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, retryInterval),
            new SimpleValueSupport(SimpleMetaType.STRING, connectionLoadBalancingPolicyClassName));

      createResourceReport.setStatus(CreateResourceStatus.SUCCESS);
      createResourceReport.setResourceKey(name);
      createResourceReport.setResourceName(name);
   }
View Full Code Here

TOP

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

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.