Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   /*
    * Copyright 2009 Red Hat, Inc.
    *  Red Hat licenses this file to you under the Apache License, version
    *  2.0 (the "License"); you may not use this file except in compliance
    *  with the License.  You may obtain a copy of the License at
    *     http://www.apache.org/licenses/LICENSE-2.0
    *  Unless required by applicable law or agreed to in writing, software
    *  distributed under the License is distributed on an "AS IS" BASIS,
    *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
   *  implied.  See the License for the specific language governing
   *  permissions and limitations under the License.
   */
  
  package org.hornetq.jms.server.impl;
  
  import java.util.HashMap;
  import java.util.HashSet;
  import java.util.List;
  import java.util.Map;
  import java.util.Set;
  
  
A Deployer used to create and add to JNDI queues, topics and connection factories. Typically this would only be used in an app server env.

JMS Connection Factories & Destinations can be configured either using configuration files or using a JMSConfiguration object.

If configuration files are used, JMS resources are redeployed if the files content is changed. If a JMSConfiguration object is used, the JMS resources can not be redeployed.

Author(s):
Andy Taylor
Jeff Mesnil
Tim Fox
 
 {
    private static final String REJECT_FILTER = .;
 
    private BindingRegistry registry;
 
    private final Map<StringHornetQQueuequeues = new HashMap<StringHornetQQueue>();
 
    private final Map<StringHornetQTopictopics = new HashMap<StringHornetQTopic>();
 
 
    private final Map<StringList<String>> queueJNDI = new HashMap<StringList<String>>();
 
    private final Map<StringList<String>> topicJNDI = new HashMap<StringList<String>>();
 
    private final Map<StringList<String>> connectionFactoryJNDI = new HashMap<StringList<String>>();
 
    // We keep things cached if objects are created while the JMS is not active
    private final List<RunnablecachedCommands = new ArrayList<Runnable>();
 
    private final HornetQServer server;
 
 
    private XmlDeployer jmsDeployer;
 
    private boolean started;
 
    private boolean active;
 
 
    private final String configFileName;
 
    private boolean contextSet;
 
    private JMSConfiguration config;
 
    private Configuration coreConfig;
 
    private JMSStorageManager storage;
 
    private final Map<StringList<String>> unRecoveredJndi = new HashMap<StringList<String>>();
 
    public JMSServerManagerImpl(final HornetQServer serverthrows Exception
    {
       this. = server;
 
       this. = server.getConfiguration();
 
        = null;
    }

   
Unused
 
    @Deprecated
    public JMSServerManagerImpl(final HornetQServer serverfinal BindingRegistry registrythrows Exception
    {
       this. = server;
 
       this. = server.getConfiguration();
 
        = null;
 
       this. = registry;
    }
 
    public JMSServerManagerImpl(final HornetQServer serverfinal String configFileNamethrows Exception
    {
       this. = server;
 
       this. = server.getConfiguration();
 
       this. = configFileName;
    }
 
    public JMSServerManagerImpl(final HornetQServer serverfinal JMSConfiguration configurationthrows Exception
    {
       this. = server;
 
       this. = server.getConfiguration();
 
        = null;
 
        = configuration;
    }

   
Unused
 
    @Deprecated
    public JMSServerManagerImpl(HornetQServer serverString configFilenameJMSStorageManager storageManager)
    {
       this. = server;
 
        = null;
 
        = storageManager;
    }
 
    // ActivateCallback implementation -------------------------------------
 
    public void preActivate()
    {
 
    }
 
    public synchronized void activated()
    {
       if (!)
       {
          return;
       }
 
        = true;
 
 
       try
       {
          .registerJMSServer(this);
 
          initJournal();
 
          // start the JMS deployer only if the configuration is not done using the JMSConfiguration object
          if ( == null)
          {
             if (.getConfiguration().isFileDeploymentEnabled())
             {
                 = new JMSServerDeployer(this);
 
                if ( != null)
                {
                   .setConfigFileNames(new String[] {  });
                }
 
                .start();
 
                .start();
             }
          }
          else
          {
             deploy();
          }
 
          for (Runnable run : )
          {
             ..serverRunningCachedCommand(run);
             run.run();
          }
 
          .clear();
 
          recoverJndiBindings();
 
       }
       catch (Exception e)
       {
       }
    }
 
    public void recoverJndiBindings(String namePersistedType type)
          throws NamingException
    {
       List<Stringbindings = .get(name);
       if ((bindings != null) && (bindings.size() > 0))
       {
          Map<StringList<String>> mapJNDI;
          Map<String, ?> objects;
 
          switch (type)
          {
          case :
             mapJNDI = ;
             objects = ;
             break;
          case :
             mapJNDI = ;
             objects = ;
             break;
          default:
          case :
             mapJNDI = ;
             objects = ;
             break;
          }
 
          Object objectToBind = objects.get(name);
 
          List<StringjndiList = mapJNDI.get(name);
 
          if (objectToBind == null)
          {
             return;
          }
 
          if (jndiList == null)
          {
             jndiList = new ArrayList<String>();
             mapJNDI.put(namejndiList);
          }
 
          for (String jndi : bindings)
          {
             jndiList.add(jndi);
             bindToJndi(jndiobjectToBind);
          }
 
          .remove(name);
       }
    }
 
    private void recoverJndiBindings() throws Exception
    {
       //now its time to add journal recovered stuff
       List<PersistedJNDIjndiSpace = .recoverPersistedJNDI();
 
       for (PersistedJNDI record : jndiSpace)
       {
          Map<StringList<String>> mapJNDI;
          Map<String, ?> objects;
 
          switch (record.getType())
          {
             case :
                mapJNDI = ;
                objects = ;
                break;
             case :
                mapJNDI = ;
                objects = ;
                break;
             default:
             case :
                mapJNDI = ;
                objects = ;
                break;
          }
 
          Object objectToBind = objects.get(record.getName());
          List<StringjndiList = mapJNDI.get(record.getName());
 
          if (objectToBind == null)
          {
             .put(record.getName(), record.getJndi());
             continue;
          }
 
          if (jndiList == null)
          {
             jndiList = new ArrayList<String>();
             mapJNDI.put(record.getName(), jndiList);
          }
 
          for (String jndi : record.getJndi())
          {
             jndiList.add(jndi);
             bindToJndi(jndiobjectToBind);
          }
       }
 
 
    }
 
    // HornetQComponent implementation -----------------------------------
 
    public synchronized void start() throws Exception
    {
       if ()
       {
          return;
       }
 
       if ( == null)
       {
          if (!)
          {
              = new JndiBindingRegistry(new InitialContext());
          }
       }
 
        = true;
 
 
       .registerActivateCallback(this);
 
       .start();
    }
 
    public void stop() throws Exception
    {
       synchronized (this)
       {
          if (!)
          {
             return;
          }
 
          if ( != null)
          {
             .stop();
          }
 
          if ( != null)
          {
             .stop();
          }
 
          // Storage could be null on a shared store backup server before initialization
          if ( != null)
          {
             .stop();
          }
 
          unbindJNDI();
 
          unbindJNDI();
 
          unbindJNDI();
 
          for (String connectionFactory : new HashSet<String>(.keySet()))
          {
             shutdownConnectionFactory(connectionFactory);
          }
 
          .clear();
          .clear();
 
          .clear();
          .clear();
 
          .clear();
          .clear();
 
          if ( != null)
          {
             .close();
          }
 
          // it could be null if a backup
          if ( != null)
          {
             .unregisterJMSServer();
 
             .stop();
          }
 
           = false;
       }
 
       .stop();
    }
 
    public boolean isStarted()
    {
       return .isStarted();
    }
 
    // JMSServerManager implementation -------------------------------
 
    public BindingRegistry getRegistry()
    {
       return ;
    }
 
    public void setRegistry(BindingRegistry registry)
    {
       this. = registry;
    }
 
    {
       return ;
    }
 
    public void addAddressSettings(final String addressfinal AddressSettings addressSettings)
    {
       .getAddressSettingsRepository().addMatch(addressaddressSettings);
    }
 
    public AddressSettings getAddressSettings(final String address)
    {
       return .getAddressSettingsRepository().getMatch(address);
    }
 
    public void addSecurity(final String addressMatchfinal Set<Roleroles)
    {
       .getSecurityRepository().addMatch(addressMatchroles);
    }
 
    public Set<RolegetSecurity(final String addressMatch)
    {
       return .getSecurityRepository().getMatch(addressMatch);
    }
 
    public synchronized void setContext(final Context context)
    {
       if ( == null ||  instanceof JndiBindingRegistry)
       {
           = new JndiBindingRegistry(context);
          .setContext(context);
       }
 
        = true;
    }
 
    public synchronized String getVersion()
    {
       checkInitialised();
 
       return .getVersion().getFullVersion();
    }
 
    public synchronized boolean createQueue(final boolean storeConfig,
                                            final String queueName,
                                            final String selectorString,
                                            final boolean durable,
                                            final String... jndithrows Exception
    {
 
       if ( && .get(queueName) != null)
       {
          return false;
       }
 
       runAfterActive(new WrappedRunnable()
       {
          @Override
          public String toString()
          {
             return "createQueue for " + queueName;
          }
 
          @Override
          public void runException() throws Exception
          {
             checkJNDI(jndi);
 
             if (internalCreateQueue(queueNameselectorStringdurable))
             {
 
                HornetQDestination destination = .get(queueName);
                if (destination == null)
                {
                   // sanity check. internalCreateQueue should already have done this check
                   throw new IllegalArgumentException("Queue does not exist");
                }
 
                ArrayList<Stringbindings = new ArrayList<String>();
 
                for (String jndiItem : jndi)
                {
                   if (bindToJndi(jndiItemdestination))
                   {
                      bindings.add(jndiItem);
                   }
                }
 
                String[] usedJNDI = bindings.toArray(new String[bindings.size()]);
                addToBindings(queueNameusedJNDI);
 
                if (storeConfig && durable)
                {
                   .storeDestination(new PersistedDestination(.,
                                                                     queueName,
                                                                     selectorString,
                                                                     durable));
                   .addJNDI(.queueNameusedJNDI);
                }
             }
          }
       });
 
       return true;
    }
 
    public synchronized boolean createTopic(final boolean storeConfigfinal String topicNamefinal String... jndithrows Exception
    {
       if ( && .get(topicName) != null)
       {
          return false;
       }
 
       runAfterActive(new WrappedRunnable()
       {
          @Override
          public String toString()
          {
             return "createTopic for " + topicName;
          }
 
          @Override
          public void runException() throws Exception
          {
             checkJNDI(jndi);
 
             if (internalCreateTopic(topicName))
             {
                HornetQDestination destination = .get(topicName);
 
                if (destination == null)
                {
                   // sanity check. internalCreateQueue should already have done this check
                   throw new IllegalArgumentException("Queue does not exist");
                }
 
                ArrayList<Stringbindings = new ArrayList<String>();
 
                for (String jndiItem : jndi)
                {
                   if (bindToJndi(jndiItemdestination))
                   {
                      bindings.add(jndiItem);
                   }
                }
 
                String[] usedJNDI = bindings.toArray(new String[bindings.size()]);
                addToBindings(topicNameusedJNDI);
 
                if (storeConfig)
                {
                   .storeDestination(new PersistedDestination(.topicName));
                   .addJNDI(.topicNameusedJNDI);
                }
             }
          }
       });
 
       return true;
 
    }
 
    public boolean addTopicToJndi(final String topicNamefinal String jndiBindingthrows Exception
    {
       checkInitialised();
 
       checkJNDI(jndiBinding);
 
       HornetQTopic destination = .get(topicName);
       if (destination == null)
       {
          throw new IllegalArgumentException("Topic does not exist");
       }
       if (destination.getTopicName() == null)
       {
          throw new IllegalArgumentException(topicName + " is not a topic");
       }
       boolean added = bindToJndi(jndiBindingdestination);
 
       if (added)
       {
          addToBindings(topicNamejndiBinding);
          .addJNDI(.topicNamejndiBinding);
       }
       return added;
    }
 
    public String[] getJNDIOnQueue(String queue)
    {
       return getJNDIList(queue);
    }
 
    public String[] getJNDIOnTopic(String topic)
    {
       return getJNDIList(topic);
    }
 
    public String[] getJNDIOnConnectionFactory(String factoryName)
    {
       return getJNDIList(factoryName);
    }
 
    public boolean addQueueToJndi(final String queueNamefinal String jndiBindingthrows Exception
    {
       checkInitialised();
 
       checkJNDI(jndiBinding);
 
       HornetQQueue destination = .get(queueName);
       if (destination == null)
       {
          throw new IllegalArgumentException("Queue does not exist");
       }
       if (destination.getQueueName() == null)
       {
          throw new IllegalArgumentException(queueName + " is not a queue");
       }
       boolean added = bindToJndi(jndiBindingdestination);
       if (added)
       {
          addToBindings(queueNamejndiBinding);
          .addJNDI(.queueNamejndiBinding);
       }
       return added;
    }
 
    public boolean addConnectionFactoryToJNDI(final String namefinal String jndiBindingthrows Exception
    {
       checkInitialised();
 
       checkJNDI(jndiBinding);
 
       HornetQConnectionFactory factory = .get(name);
       if (factory == null)
       {
          throw new IllegalArgumentException("Factory does not exist");
       }
       if (.lookup(jndiBinding) != null)
       {
          throw ..cfJndiExists(name);
       }
       boolean added = bindToJndi(jndiBindingfactory);
       if (added)
       {
          addToBindings(namejndiBinding);
          .addJNDI(.namejndiBinding);
       }
       return added;
    }
 
    /* (non-Javadoc)
     * @see org.hornetq.jms.server.JMSServerManager#removeQueueFromJNDI(java.lang.String, java.lang.String)
     */
 
    public boolean removeQueueFromJNDI(String nameString jndithrows Exception
    {
       checkInitialised();
 
       boolean removed = removeFromJNDI(namejndi);
 
       if (removed)
       {
          .deleteJNDI(.namejndi);
       }
 
       return removed;
    }
 
    /* (non-Javadoc)
     * @see org.hornetq.jms.server.JMSServerManager#removeQueueFromJNDI(java.lang.String, java.lang.String)
     */
    public boolean removeQueueFromJNDI(final String namethrows Exception
    {
       final AtomicBoolean valueReturn = new AtomicBoolean(false);
 
       // HORNETQ-911 - make this runAfterActive to prevent WARN messages on shutdown/undeployment when the backup was never activated
       runAfterActive(new WrappedRunnable()
       {
          @Override
          public String toString()
          {
             return "removeQueueFromJNDI for " + name;
          }
 
          @Override
          public void runException() throws Exception
          {
             checkInitialised();
 
             if (removeFromJNDI(name))
             {
                .deleteDestination(.name);
                valueReturn.set(true);
             }
          }
       });
 
       return valueReturn.get();
    }
 
    /* (non-Javadoc)
     * @see org.hornetq.jms.server.JMSServerManager#removeTopicFromJNDI(java.lang.String, java.lang.String)
     */
 
    public boolean removeTopicFromJNDI(String nameString jndithrows Exception
    {
       checkInitialised();
 
       if (removeFromJNDI(namejndi))
       {
          .deleteJNDI(.namejndi);
          return true;
       }
       else
       {
          return false;
       }
    }
 
    /* (non-Javadoc)
    * @see org.hornetq.jms.server.JMSServerManager#removeTopicFromJNDI(java.lang.String, java.lang.String)
    */
    public boolean removeTopicFromJNDI(final String namethrows Exception
    {
       final AtomicBoolean valueReturn = new AtomicBoolean(false);
 
       // HORNETQ-911 - make this runAfterActive to prevent WARN messages on shutdown/undeployment when the backup was never activated
       runAfterActive(new WrappedRunnable()
       {
          @Override
          public String toString()
          {
             return "removeTopicFromJNDI for " + name;
          }
 
          @Override
          public void runException() throws Exception
          {
             checkInitialised();
 
             if (removeFromJNDI(name))
             {
                .deleteDestination(.name);
                valueReturn.set(true);
             }
          }
       });
 
       return valueReturn.get();
    }
 
    /* (non-Javadoc)
     * @see org.hornetq.jms.server.JMSServerManager#removeConnectionFactoryFromJNDI(java.lang.String, java.lang.String)
     */
 
    public boolean removeConnectionFactoryFromJNDI(String nameString jndithrows Exception
    {
       checkInitialised();
 
       removeFromJNDI(namejndi);
 
 
       return true;
    }
 
    /* (non-Javadoc)
     * @see org.hornetq.jms.server.JMSServerManager#removeConnectionFactoryFromJNDI(java.lang.String, java.lang.String)
     */
 
    public boolean removeConnectionFactoryFromJNDI(String namethrows Exception
    {
       checkInitialised();
 
 
       .deleteConnectionFactory(name);
 
       return true;
    }
 
    public synchronized boolean destroyQueue(final String namethrows Exception
    {
       checkInitialised();
 
       removeFromJNDI(name);
 
       .remove(name);
       .remove(name);
 
 
       .destroyQueue(HornetQDestination.createQueueAddressFromName(name), null);
 
 
       return true;
    }
 
    public synchronized boolean destroyTopic(final String namethrows Exception
    {
       checkInitialised();
 
       removeFromJNDI(name);
 
       .remove(name);
       .remove(name);
 
 
       AddressControl addressControl = (AddressControl).getManagementService()
                                                             .getResource(. + HornetQDestination.createTopicAddressFromName(name));
       if (addressControl != null)
       {
          for (String queueName : addressControl.getQueueNames())
          {
             Binding binding = .getPostOffice().getBinding(new SimpleString(queueName));
             if (binding == null)
             {
                ..noQueueOnTopic(queueNamename);
                continue;
             }
 
             // We can't remove the remote binding. As this would be the bridge associated with the topic on this case
             if (binding.getType() != .)
             {
                .destroyQueue(SimpleString.toSimpleString(queueName), null);
             }
          }
       }
       return true;
    }
 
    public synchronized void createConnectionFactory(final String name,
                                                     final boolean ha,
                                                     final JMSFactoryType cfType,
                                                     final List<StringconnectorNames,
                                                     String... jndiBindingsthrows Exception
    {
       checkInitialised();
       if (cf == null)
       {
          ConnectionFactoryConfiguration configuration = new ConnectionFactoryConfigurationImpl(namehaconnectorNames);
          configuration.setFactoryType(cfType);
          createConnectionFactory(trueconfigurationjndiBindings);
       }
    }
 
    public synchronized void createConnectionFactory(final String name,
                                                     final boolean ha,
                                                     JMSFactoryType cfType,
                                                     final List<StringconnectorNames,
                                                     final String clientID,
                                                     final long clientFailureCheckPeriod,
                                                     final long connectionTTL,
                                                     final long callTimeout,
                                                     final long callFailoverTimeout,
                                                     final boolean cacheLargeMessagesClient,
                                                     final int minLargeMessageSize,
                                                     final boolean compressLargeMessage,
                                                     final int consumerWindowSize,
                                                     final int consumerMaxRate,
                                                     final int confirmationWindowSize,
                                                     final int producerWindowSize,
                                                     final int producerMaxRate,
                                                     final boolean blockOnAcknowledge,
                                                     final boolean blockOnDurableSend,
                                                     final boolean blockOnNonDurableSend,
                                                     final boolean autoGroup,
                                                     final boolean preAcknowledge,
                                                     final String loadBalancingPolicyClassName,
                                                     final int transactionBatchSize,
                                                     final int dupsOKBatchSize,
                                                     final boolean useGlobalPools,
                                                     final int scheduledThreadPoolMaxSize,
                                                     final int threadPoolMaxSize,
                                                     final long retryInterval,
                                                     final double retryIntervalMultiplier,
                                                     final long maxRetryInterval,
                                                     final int reconnectAttempts,
                                                     final boolean failoverOnInitialConnection,
                                                     final String groupId,
                                                     String... jndiBindingsthrows Exception
    {
       checkInitialised();
       if (cf == null)
       {
          ConnectionFactoryConfiguration configuration = new ConnectionFactoryConfigurationImpl(namehaconnectorNames);
          configuration.setClientID(clientID);
          configuration.setClientFailureCheckPeriod(clientFailureCheckPeriod);
          configuration.setConnectionTTL(connectionTTL);
          configuration.setFactoryType(cfType);
          configuration.setCallTimeout(callTimeout);
          configuration.setCallFailoverTimeout(callFailoverTimeout);
          configuration.setCacheLargeMessagesClient(cacheLargeMessagesClient);
          configuration.setMinLargeMessageSize(minLargeMessageSize);
          configuration.setCompressLargeMessages(compressLargeMessage);
          configuration.setConsumerWindowSize(consumerWindowSize);
          configuration.setConsumerMaxRate(consumerMaxRate);
          configuration.setConfirmationWindowSize(confirmationWindowSize);
          configuration.setProducerWindowSize(producerWindowSize);
          configuration.setProducerMaxRate(producerMaxRate);
          configuration.setBlockOnAcknowledge(blockOnAcknowledge);
          configuration.setBlockOnDurableSend(blockOnDurableSend);
          configuration.setBlockOnNonDurableSend(blockOnNonDurableSend);
          configuration.setAutoGroup(autoGroup);
          configuration.setPreAcknowledge(preAcknowledge);
          configuration.setLoadBalancingPolicyClassName(loadBalancingPolicyClassName);
          configuration.setTransactionBatchSize(transactionBatchSize);
          configuration.setDupsOKBatchSize(dupsOKBatchSize);
          configuration.setUseGlobalPools(useGlobalPools);
          configuration.setScheduledThreadPoolMaxSize(scheduledThreadPoolMaxSize);
          configuration.setThreadPoolMaxSize(threadPoolMaxSize);
          configuration.setRetryInterval(retryInterval);
          configuration.setRetryIntervalMultiplier(retryIntervalMultiplier);
          configuration.setMaxRetryInterval(maxRetryInterval);
          configuration.setReconnectAttempts(reconnectAttempts);
          configuration.setFailoverOnInitialConnection(failoverOnInitialConnection);
          configuration.setGroupID(groupId);
          createConnectionFactory(trueconfigurationjndiBindings);
       }
   }
   public synchronized void createConnectionFactory(final String name,
                                                    final boolean ha,
                                                    final JMSFactoryType cfType,
                                                    final String discoveryGroupName,
                                                    final String clientID,
                                                    final long clientFailureCheckPeriod,
                                                    final long connectionTTL,
                                                    final long callTimeout,
                                                    final long callFailoverTimeout,
                                                    final boolean cacheLargeMessagesClient,
                                                    final int minLargeMessageSize,
                                                    final boolean compressLargeMessages,
                                                    final int consumerWindowSize,
                                                    final int consumerMaxRate,
                                                    final int confirmationWindowSize,
                                                    final int producerWindowSize,
                                                    final int producerMaxRate,
                                                    final boolean blockOnAcknowledge,
                                                    final boolean blockOnDurableSend,
                                                    final boolean blockOnNonDurableSend,
                                                    final boolean autoGroup,
                                                    final boolean preAcknowledge,
                                                    final String loadBalancingPolicyClassName,
                                                    final int transactionBatchSize,
                                                    final int dupsOKBatchSize,
                                                    final boolean useGlobalPools,
                                                    final int scheduledThreadPoolMaxSize,
                                                    final int threadPoolMaxSize,
                                                    final long retryInterval,
                                                    final double retryIntervalMultiplier,
                                                    final long maxRetryInterval,
                                                    final int reconnectAttempts,
                                                    final boolean failoverOnInitialConnection,
                                                    final String groupId,
                                                    final String... jndiBindingsthrows Exception
   {
      checkInitialised();
      if (cf == null)
      {
         ConnectionFactoryConfiguration configuration = new ConnectionFactoryConfigurationImpl(namehajndiBindings);
         configuration.setDiscoveryGroupName(discoveryGroupName);
         configuration.setFactoryType(cfType);
         configuration.setClientID(clientID);
         configuration.setClientFailureCheckPeriod(clientFailureCheckPeriod);
         configuration.setConnectionTTL(connectionTTL);
         configuration.setCallTimeout(callTimeout);
         configuration.setCallFailoverTimeout(callFailoverTimeout);
         configuration.setCacheLargeMessagesClient(cacheLargeMessagesClient);
         configuration.setMinLargeMessageSize(minLargeMessageSize);
         configuration.setCompressLargeMessages(compressLargeMessages);
         configuration.setConsumerWindowSize(consumerWindowSize);
         configuration.setConsumerMaxRate(consumerMaxRate);
         configuration.setConfirmationWindowSize(confirmationWindowSize);
         configuration.setProducerWindowSize(producerWindowSize);
         configuration.setProducerMaxRate(producerMaxRate);
         configuration.setBlockOnAcknowledge(blockOnAcknowledge);
         configuration.setBlockOnDurableSend(blockOnDurableSend);
         configuration.setBlockOnNonDurableSend(blockOnNonDurableSend);
         configuration.setAutoGroup(autoGroup);
         configuration.setPreAcknowledge(preAcknowledge);
         configuration.setLoadBalancingPolicyClassName(loadBalancingPolicyClassName);
         configuration.setTransactionBatchSize(transactionBatchSize);
         configuration.setDupsOKBatchSize(dupsOKBatchSize);
         configuration.setUseGlobalPools(useGlobalPools);
         configuration.setScheduledThreadPoolMaxSize(scheduledThreadPoolMaxSize);
         configuration.