Package org.hornetq.api.jms.management

Examples of org.hornetq.api.jms.management.ConnectionFactoryControl


       params = {
           @ManagementParameter(name = "name", description = "the queue name"),
           @ManagementParameter(name = "names", description = "the measurement names")})
   public String[] getMeasurements(String name, String[] names) throws Exception
   {
      ConnectionFactoryControl control = (ConnectionFactoryControl) managementService.getResource("jms.connectionfactory." + name);
      String[] val = new String[names.length];
      for (int i = 0, valLength = val.length; i < valLength; i++)
      {
         Object o = control.getClass().getMethod(names[i]).invoke(control);
         if(o instanceof Object[])
         {
            val[i] = coomaSeparatedString((Object[]) o);
         }
         else
View Full Code Here


      }
      else
      {
         jmsServerControl.createConnectionFactory(name, discoveryAddress, discoveryPort, bindings);
      }
      ConnectionFactoryControl control = (ConnectionFactoryControl) managementService.getResource("jms.connectionfactory." + name);
      control.setDiscoveryRefreshTimeout(discoveryRefreshTimeout);
      control.setClientID(clientId);
      control.setDupsOKBatchSize(dupsOkBatchSize);
      control.setTransactionBatchSize(transactionBatchSize);
      control.setClientFailureCheckPeriod(clientFailureCheckPeriod);
      control.setConnectionTTL(connectionTTL);
      control.setCallTimeout(callTimeout);
      control.setConsumerWindowSize(consumerWindowSize);
      control.setConfirmationWindowSize(confirmationWindowSize);
      control.setProducerMaxRate(producerMaxRate);
      control.setProducerWindowSize(producerWindowSize);
      control.setCacheLargeMessagesClient(cacheLargeMessageClient);
      control.setMinLargeMessageSize(minLargeMessageSize);
      control.setBlockOnDurableSend(blockOnNonDurableSend);
      control.setBlockOnAcknowledge(blockOnAcknowledge);
      control.setBlockOnDurableSend(blockOnDurableSend);
      control.setAutoGroup(autoGroup);
      control.setPreAcknowledge(preAcknowledge);
      control.setMaxRetryInterval(maxRetryInterval);
      control.setRetryIntervalMultiplier(retryIntervalMultiplier);
      control.setReconnectAttempts(reconnectAttempts);
      control.setFailoverOnServerShutdown(failoverOnShutdown);
      control.setScheduledThreadPoolMaxSize(scheduledThreadPoolMaxSize);
      control.setThreadPoolMaxSize(threadPoolMaxSize);
      control.setGroupID(groupId);
      control.setInitialMessagePacketSize(initialMessagePacketSize);
      control.setUseGlobalPools(useGlobalPools);
      control.setRetryInterval(retryInterval);
      control.setConnectionLoadBalancingPolicyClassName(connectionLoadBalancingPolicyClassName);
   }
View Full Code Here

                                        boolean useGlobalPools,
                                        long retryInterval,
                                        String connectionLoadBalancingPolicyClassName)
         throws Exception
   {
      ConnectionFactoryControl control = (ConnectionFactoryControl) managementService.getResource("jms.connectionfactory." + name);
      control.setDiscoveryRefreshTimeout(discoveryRefreshTimeout);
      control.setClientID(clientId);
      control.setDupsOKBatchSize(dupsOkBatchSize);
      control.setTransactionBatchSize(transactionBatchSize);
      control.setClientFailureCheckPeriod(clientFailureCheckPeriod);
      control.setConnectionTTL(connectionTTL);
      control.setCallTimeout(callTimeout);
      control.setConsumerWindowSize(consumerWindowSize);
      control.setConfirmationWindowSize(confirmationWindowSize);
      control.setProducerMaxRate(producerMaxRate);
      control.setProducerWindowSize(producerWindowSize);
      control.setCacheLargeMessagesClient(cacheLargeMessageClient);
      control.setMinLargeMessageSize(minLargeMessageSize);
      control.setBlockOnDurableSend(blockOnNonDurableSend);
      control.setBlockOnAcknowledge(blockOnAcknowledge);
      control.setBlockOnDurableSend(blockOnDurableSend);
      control.setAutoGroup(autoGroup);
      control.setPreAcknowledge(preAcknowledge);
      control.setMaxRetryInterval(maxRetryInterval);
      control.setRetryIntervalMultiplier(retryIntervalMultiplier);
      control.setReconnectAttempts(reconnectAttempts);
      control.setFailoverOnServerShutdown(failoverOnShutdown);
      control.setScheduledThreadPoolMaxSize(scheduledThreadPoolMaxSize);
      control.setThreadPoolMaxSize(threadPoolMaxSize);
      control.setGroupID(groupId);
      control.setInitialMessagePacketSize(initialMessagePacketSize);
      control.setUseGlobalPools(useGlobalPools);
      control.setRetryInterval(retryInterval);
      control.setConnectionLoadBalancingPolicyClassName(connectionLoadBalancingPolicyClassName);
   }
View Full Code Here

            .getManagementService()
            .getResources(ConnectionFactoryControl.class);
         String[] names = new String[cfControls.length];
         for (int i = 0; i < cfControls.length; i++)
         {
            ConnectionFactoryControl cfControl = (ConnectionFactoryControl) cfControls[i];
            names[i] = cfControl.getName();
         }
         return names;
      }
      finally
      {
View Full Code Here

        String factoryName = PathAddress.pathAddress(operation.require(ModelDescriptionConstants.OP_ADDR)).getLastElement().getValue();

        final ServiceName hqServiceName = MessagingServices.getHornetQServiceName(PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR)));
        ServiceController<?> hqService = context.getServiceRegistry(false).getService(hqServiceName);
        HornetQServer hqServer = HornetQServer.class.cast(hqService.getValue());
        ConnectionFactoryControl control = ConnectionFactoryControl.class.cast(hqServer.getManagementService().getResource(ResourceNames.JMS_CONNECTION_FACTORY + factoryName));

        if (HA.getName().equals(attributeName)) {
            context.getResult().set(control.isHA());
        } else if (FACTORY_TYPE.equals(attributeName)) {
            context.getResult().set(control.getFactoryType());
        } else if (INITIAL_MESSAGE_PACKET_SIZE.equals(attributeName)) {
            context.getResult().set(control.getInitialMessagePacketSize());
        } else if (READ_ATTRIBUTES.contains(attributeName)) {
            // Bug
            throw MESSAGES.unsupportedAttribute(attributeName);
        }
        context.completeStep();
View Full Code Here

    }

    @Override
    protected void addJndiNameToControl(String toAdd, String resourceName, HornetQServer server, OperationContext context) {
        ManagementService mgmt = server.getManagementService();
        ConnectionFactoryControl control = ConnectionFactoryControl.class.cast(mgmt.getResource(ResourceNames.JMS_CONNECTION_FACTORY + resourceName));
        try {
            control.addJNDI(toAdd);
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception e) {
            context.getFailureDescription().set(e.getLocalizedMessage());
        }
View Full Code Here

    private void applyOperationToHornetQService(final OperationContext context, ModelNode operation, String attributeName, ServiceController<?> hqService) {

        final String name = PathAddress.pathAddress(operation.require(ModelDescriptionConstants.OP_ADDR)).getLastElement().getValue();
        HornetQServer server =  HornetQServer.class.cast(hqService.getValue());
        ConnectionFactoryControl control = ConnectionFactoryControl.class.cast(server.getManagementService().getResource(ResourceNames.JMS_CONNECTION_FACTORY + name));
        try {
            if (attributeName.equals(CommonAttributes.CLIENT_ID.getName()))  {
                final ModelNode node = CommonAttributes.CLIENT_ID.resolveModelAttribute(context, operation);
                control.setClientID(node.isDefined() ? node.asString() : null);
            } else if (attributeName.equals(CommonAttributes.COMPRESS_LARGE_MESSAGES.getName())) {
                control.setCompressLargeMessages(CommonAttributes.COMPRESS_LARGE_MESSAGES.resolveModelAttribute(context, operation).asBoolean());
            } else if (attributeName.equals(CommonAttributes.CLIENT_FAILURE_CHECK_PERIOD.getName())) {
                control.setClientFailureCheckPeriod(CommonAttributes.CLIENT_FAILURE_CHECK_PERIOD.resolveModelAttribute(context, operation).asLong());
            } else if (attributeName.equals(CommonAttributes.CALL_TIMEOUT.getName())) {
                control.setCallTimeout(CommonAttributes.CALL_TIMEOUT.resolveModelAttribute(context, operation).asLong());
            } else if (attributeName.equals(CommonAttributes.DUPS_OK_BATCH_SIZE.getName())) {
                control.setDupsOKBatchSize(CommonAttributes.DUPS_OK_BATCH_SIZE.resolveModelAttribute(context, operation).asInt());
            } else if (attributeName.equals(CommonAttributes.CONSUMER_MAX_RATE.getName())) {
                control.setConsumerMaxRate(CommonAttributes.CONSUMER_MAX_RATE.resolveModelAttribute(context, operation).asInt());
            } else if (attributeName.equals(CommonAttributes.CONSUMER_WINDOW_SIZE.getName())) {
                control.setConsumerWindowSize(CommonAttributes.CONSUMER_WINDOW_SIZE.resolveModelAttribute(context, operation).asInt());
            } else if (attributeName.equals(CommonAttributes.PRODUCER_MAX_RATE.getName())) {
                control.setProducerMaxRate(CommonAttributes.PRODUCER_MAX_RATE.resolveModelAttribute(context, operation).asInt());
            } else if (attributeName.equals(CommonAttributes.CONFIRMATION_WINDOW_SIZE.getName())) {
                control.setConfirmationWindowSize(CommonAttributes.CONFIRMATION_WINDOW_SIZE.resolveModelAttribute(context, operation).asInt());
            } else if (attributeName.equals(CommonAttributes.BLOCK_ON_ACK.getName())) {
                control.setBlockOnAcknowledge(CommonAttributes.BLOCK_ON_ACK.resolveModelAttribute(context, operation).asBoolean());
            } else if (attributeName.equals(CommonAttributes.BLOCK_ON_DURABLE_SEND.getName())) {
                control.setBlockOnDurableSend(CommonAttributes.BLOCK_ON_DURABLE_SEND.resolveModelAttribute(context, operation).asBoolean());
            } else if (attributeName.equals(CommonAttributes.BLOCK_ON_NON_DURABLE_SEND.getName())) {
                control.setBlockOnNonDurableSend(CommonAttributes.BLOCK_ON_NON_DURABLE_SEND.resolveModelAttribute(context, operation).asBoolean());
            } else if (attributeName.equals(CommonAttributes.PRE_ACK.getName())) {
                control.setPreAcknowledge(CommonAttributes.PRE_ACK.resolveModelAttribute(context, operation).asBoolean());
            } else if (attributeName.equals(CommonAttributes.CONNECTION_TTL.getName())) {
                control.setConnectionTTL(CommonAttributes.CONNECTION_TTL.resolveModelAttribute(context, operation).asLong());
            } else if (attributeName.equals(CommonAttributes.TRANSACTION_BATCH_SIZE.getName())) {
                control.setTransactionBatchSize(CommonAttributes.TRANSACTION_BATCH_SIZE.resolveModelAttribute(context, operation).asInt());
            } else if (attributeName.equals(CommonAttributes.MIN_LARGE_MESSAGE_SIZE.getName())) {
                control.setMinLargeMessageSize(CommonAttributes.MIN_LARGE_MESSAGE_SIZE.resolveModelAttribute(context, operation).asInt());
            } else if (attributeName.equals(CommonAttributes.AUTO_GROUP.getName())) {
                control.setAutoGroup(CommonAttributes.AUTO_GROUP.resolveModelAttribute(context, operation).asBoolean());
            } else if (attributeName.equals(CommonAttributes.RETRY_INTERVAL.getName())) {
                control.setRetryInterval(CommonAttributes.RETRY_INTERVAL.resolveModelAttribute(context, operation).asLong());
            } else if (attributeName.equals(CommonAttributes.RETRY_INTERVAL_MULTIPLIER.getName())) {
                control.setRetryIntervalMultiplier(CommonAttributes.RETRY_INTERVAL_MULTIPLIER.resolveModelAttribute(context, operation).asDouble());
            } else if (attributeName.equals(CommonAttributes.CONNECTION_FACTORY_RECONNECT_ATTEMPTS.getName())) {
                control.setReconnectAttempts(CommonAttributes.CONNECTION_FACTORY_RECONNECT_ATTEMPTS.resolveModelAttribute(context, operation).asInt());
            } else if (attributeName.equals(CommonAttributes.FAILOVER_ON_INITIAL_CONNECTION.getName())) {
                control.setFailoverOnInitialConnection(CommonAttributes.FAILOVER_ON_INITIAL_CONNECTION.resolveModelAttribute(context, operation).asBoolean());
            } else if (attributeName.equals(CommonAttributes.PRODUCER_WINDOW_SIZE.getName())) {
                control.setProducerWindowSize(CommonAttributes.PRODUCER_WINDOW_SIZE.resolveModelAttribute(context, operation).asInt());
            } else if (attributeName.equals(CommonAttributes.CACHE_LARGE_MESSAGE_CLIENT.getName())) {
                control.setCacheLargeMessagesClient(CommonAttributes.CACHE_LARGE_MESSAGE_CLIENT.resolveModelAttribute(context, operation).asBoolean());
            } else if (attributeName.equals(CommonAttributes.MAX_RETRY_INTERVAL.getName())) {
                control.setMaxRetryInterval(CommonAttributes.MAX_RETRY_INTERVAL.resolveModelAttribute(context, operation).asLong());
            } else if (attributeName.equals(CommonAttributes.CONNECTION_SCHEDULED_THREAD_POOL_MAX_SIZE.getName())) {
                control.setScheduledThreadPoolMaxSize(CommonAttributes.CONNECTION_SCHEDULED_THREAD_POOL_MAX_SIZE.resolveModelAttribute(context, operation).asInt());
            } else if (attributeName.equals(CommonAttributes.CONNECTION_THREAD_POOL_MAX_SIZE.getName())) {
                control.setThreadPoolMaxSize(CommonAttributes.CONNECTION_THREAD_POOL_MAX_SIZE.resolveModelAttribute(context, operation).asInt());
            } else if (attributeName.equals(CommonAttributes.GROUP_ID.getName())) {
                final ModelNode node = CommonAttributes.GROUP_ID.resolveModelAttribute(context, operation);
                control.setGroupID(node.isDefined() ? node.asString() : null);
            } else if (attributeName.equals(CommonAttributes.USE_GLOBAL_POOLS.getName())) {
                control.setUseGlobalPools(CommonAttributes.USE_GLOBAL_POOLS.resolveModelAttribute(context, operation).asBoolean());
            } else if (attributeName.equals(CommonAttributes.LOAD_BALANCING_CLASS_NAME.getName())) {
                control.setConnectionLoadBalancingPolicyClassName(CommonAttributes.LOAD_BALANCING_CLASS_NAME.resolveModelAttribute(context, operation).asString());
            } else {
                // Bug! Someone added the attribute to the set but did not implement
                throw MESSAGES.unsupportedRuntimeAttribute(attributeName);
            }
View Full Code Here

        String factoryName = PathAddress.pathAddress(operation.require(ModelDescriptionConstants.OP_ADDR)).getLastElement().getValue();

        final ServiceName hqServiceName = MessagingServices.getHornetQServiceName(PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR)));
        ServiceController<?> hqService = context.getServiceRegistry(false).getService(hqServiceName);
        HornetQServer hqServer = HornetQServer.class.cast(hqService.getValue());
        ConnectionFactoryControl control = ConnectionFactoryControl.class.cast(hqServer.getManagementService().getResource(ResourceNames.JMS_CONNECTION_FACTORY + factoryName));

        if (HA.getName().equals(attributeName)) {
            context.getResult().set(control.isHA());
        } else if (CONNECTION_FACTORY_TYPE.getName().equals(attributeName)) {
            context.getResult().set(control.getFactoryType());
        } else if (INITIAL_MESSAGE_PACKET_SIZE.equals(attributeName)) {
            context.getResult().set(control.getInitialMessagePacketSize());
        } else if (READ_ATTRIBUTES.contains(attributeName)) {
            // Bug
            throw MESSAGES.unsupportedAttribute(attributeName);
        }
        context.completeStep();
View Full Code Here

                                     .getManagementService()
                                     .getResources(ConnectionFactoryControl.class);
         String[] names = new String[cfControls.length];
         for (int i = 0; i < cfControls.length; i++)
         {
            ConnectionFactoryControl cfControl = (ConnectionFactoryControl)cfControls[i];
            names[i] = cfControl.getName();
         }
         return names;
      }
      finally
      {
View Full Code Here

                                     .getManagementService()
                                     .getResources(ConnectionFactoryControl.class);
         String[] names = new String[cfControls.length];
         for (int i = 0; i < cfControls.length; i++)
         {
            ConnectionFactoryControl cfControl = (ConnectionFactoryControl)cfControls[i];
            names[i] = cfControl.getName();
         }
         return names;
      }
      finally
      {
View Full Code Here

TOP

Related Classes of org.hornetq.api.jms.management.ConnectionFactoryControl

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.