org.apache.activemq.artemis.jms.client

## Class ActiveMQConnectionFactory

- java.lang.Object
- - org.apache.activemq.artemis.jndi.JNDIStorable
  - - org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory

- All Implemented Interfaces:
    Externalizable, Serializable, AutoCloseable, javax.jms.ConnectionFactory, javax.jms.XAConnectionFactory, Referenceable, ConnectionFactoryOptions
  Direct Known Subclasses:
    ActiveMQJMSConnectionFactory, ActiveMQQueueConnectionFactory, ActiveMQTopicConnectionFactory, ActiveMQXAConnectionFactory, ActiveMQXAQueueConnectionFactory, ActiveMQXATopicConnectionFactory

      public class ActiveMQConnectionFactory
      extends JNDIStorable
      implements ConnectionFactoryOptions, Externalizable, javax.jms.ConnectionFactory, javax.jms.XAConnectionFactory, AutoCloseable

  ActiveMQ Artemis implementation of a JMS ConnectionFactory.

  This connection factory will use defaults defined by `DefaultConnectionProperties`.

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ActiveMQConnectionFactory()` This will use a default URI from `DefaultConnectionProperties`
    `ActiveMQConnectionFactory(boolean ha, DiscoveryGroupConfiguration groupConfiguration)`
    `ActiveMQConnectionFactory(boolean ha, TransportConfiguration... initialConnectors)`
    `ActiveMQConnectionFactory(ServerLocator serverLocator)`
    `ActiveMQConnectionFactory(String brokerURL)`
    `ActiveMQConnectionFactory(String url, String user, String password)` For compatibility and users used to this kind of constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `buildFromProperties(Properties props)` Set the properties that will represent the instance in JNDI
    `void` | `close()`
    `javax.jms.Connection` | `createConnection()`
    `javax.jms.Connection` | `createConnection(String username, String password)`
    `protected ActiveMQConnection` | `createConnectionInternal(String username, String password, boolean isXA, int type)`
    `javax.jms.JMSContext` | `createContext()`
    `javax.jms.JMSContext` | `createContext(int sessionMode)`
    `javax.jms.JMSContext` | `createContext(String userName, String password)`
    `javax.jms.JMSContext` | `createContext(String userName, String password, int sessionMode)`
    `javax.jms.QueueConnection` | `createQueueConnection()`
    `javax.jms.QueueConnection` | `createQueueConnection(String username, String password)`
    `javax.jms.TopicConnection` | `createTopicConnection()`
    `javax.jms.TopicConnection` | `createTopicConnection(String username, String password)`
    `javax.jms.XAConnection` | `createXAConnection()`
    `javax.jms.XAConnection` | `createXAConnection(String username, String password)`
    `javax.jms.XAJMSContext` | `createXAContext()`
    `javax.jms.XAJMSContext` | `createXAContext(String userName, String password)`
    `javax.jms.XAQueueConnection` | `createXAQueueConnection()`
    `javax.jms.XAQueueConnection` | `createXAQueueConnection(String username, String password)`
    `javax.jms.XATopicConnection` | `createXATopicConnection()`
    `javax.jms.XATopicConnection` | `createXATopicConnection(String username, String password)`
    `ActiveMQConnectionFactory` | `disableFinalizeChecks()`
    `protected void` | `finalize()`
    `long` | `getCallFailoverTimeout()`
    `long` | `getCallTimeout()`
    `long` | `getClientFailureCheckPeriod()`
    `String` | `getClientID()`
    `int` | `getConfirmationWindowSize()`
    `String` | `getConnectionLoadBalancingPolicyClassName()`
    `long` | `getConnectionTTL()`
    `int` | `getConsumerMaxRate()`
    `int` | `getConsumerWindowSize()`
    `String` | `getDeserializationBlackList()`
    `String` | `getDeserializationWhiteList()`
    `DiscoveryGroupConfiguration` | `getDiscoveryGroupConfiguration()`
    `int` | `getDupsOKBatchSize()`
    `int` | `getFactoryType()`
    `String` | `getGroupID()`
    `String` | `getIncomingInterceptorList()`
    `int` | `getInitialConnectAttempts()`
    `int` | `getInitialMessagePacketSize()`
    `long` | `getMaxRetryInterval()`
    `int` | `getMinLargeMessageSize()`
    `String` | `getOutgoingInterceptorList()`
    `String` | `getPassword()`
    `int` | `getProducerMaxRate()`
    `int` | `getProducerWindowSize()`
    `String` | `getProtocolManagerFactoryStr()`
    `int` | `getReconnectAttempts()`
    `long` | `getRetryInterval()`
    `double` | `getRetryIntervalMultiplier()`
    `int` | `getScheduledThreadPoolMaxSize()`
    `ServerLocator` | `getServerLocator()`
    `TransportConfiguration[]` | `getStaticConnectors()`
    `int` | `getThreadPoolMaxSize()`
    `int` | `getTransactionBatchSize()`
    `String` | `getUser()`
    `boolean` | `isAutoGroup()`
    `boolean` | `isBlockOnAcknowledge()`
    `boolean` | `isBlockOnDurableSend()`
    `boolean` | `isBlockOnNonDurableSend()`
    `boolean` | `isCacheDestinations()`
    `boolean` | `isCacheLargeMessagesClient()`
    `boolean` | `isCompressLargeMessage()`
    `boolean` | `isFailoverOnInitialConnection()`
    `boolean` | `isFinalizeChecks()`
    `boolean` | `isHA()`
    `boolean` | `isIgnoreJTA()`
    `boolean` | `isPreAcknowledge()`
    `boolean` | `isUseGlobalPools()`
    `protected void` | `populateProperties(Properties props)` Initialize the instance from properties stored in JNDI
    `void` | `readExternal(ObjectInput in)`
    `void` | `setAutoGroup(boolean autoGroup)`
    `void` | `setBlockOnAcknowledge(boolean blockOnAcknowledge)`
    `void` | `setBlockOnDurableSend(boolean blockOnDurableSend)`
    `void` | `setBlockOnNonDurableSend(boolean blockOnNonDurableSend)`
    `void` | `setCacheDestinations(boolean cacheDestinations)`
    `void` | `setCacheLargeMessagesClient(boolean cacheLargeMessagesClient)`
    `void` | `setCallFailoverTimeout(long callTimeout)`
    `void` | `setCallTimeout(long callTimeout)`
    `void` | `setClientFailureCheckPeriod(long clientFailureCheckPeriod)`
    `void` | `setClientID(String clientID)`
    `void` | `setCompressLargeMessage(boolean avoidLargeMessages)`
    `void` | `setConfirmationWindowSize(int confirmationWindowSize)`
    `void` | `setConnectionLoadBalancingPolicyClassName(String connectionLoadBalancingPolicyClassName)`
    `void` | `setConnectionTTL(long connectionTTL)`
    `void` | `setConsumerMaxRate(int consumerMaxRate)`
    `void` | `setConsumerWindowSize(int consumerWindowSize)`
    `void` | `setDeserializationBlackList(String blackList)`
    `void` | `setDeserializationWhiteList(String whiteList)`
    `void` | `setDupsOKBatchSize(int dupsOKBatchSize)`
    `void` | `setFailoverOnInitialConnection(boolean failover)`
    `void` | `setGroupID(String groupID)`
    `void` | `setIgnoreJTA(boolean ignoreJTA)`
    `void` | `setIncomingInterceptorList(String interceptorList)`
    `void` | `setInitialConnectAttempts(int reconnectAttempts)`
    `void` | `setInitialMessagePacketSize(int size)`
    `void` | `setMaxRetryInterval(long retryInterval)`
    `void` | `setMinLargeMessageSize(int minLargeMessageSize)`
    `void` | `setOutgoingInterceptorList(String interceptorList)`
    `ActiveMQConnectionFactory` | `setPassword(String password)`
    `void` | `setPreAcknowledge(boolean preAcknowledge)`
    `void` | `setProducerMaxRate(int producerMaxRate)`
    `void` | `setProducerWindowSize(int producerWindowSize)`
    `void` | `setProtocolManagerFactoryStr(String protocolManagerFactoryStr)`
    `void` | `setReconnectAttempts(int reconnectAttempts)`
    `void` | `setRetryInterval(long retryInterval)`
    `void` | `setRetryIntervalMultiplier(double retryIntervalMultiplier)`
    `void` | `setScheduledThreadPoolMaxSize(int scheduledThreadPoolMaxSize)`
    `void` | `setThreadPoolMaxSize(int threadPoolMaxSize)`
    `void` | `setTransactionBatchSize(int transactionBatchSize)`
    `void` | `setUseGlobalPools(boolean useGlobalPools)`
    `ActiveMQConnectionFactory` | `setUser(String user)`
    `String` | `toString()`
    `URI` | `toURI()`
    `void` | `writeExternal(ObjectOutput out)`

    - ### Methods inherited from class org.apache.activemq.artemis.jndi.JNDIStorable

      `getReference, readObject, writeObject`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ActiveMQConnectionFactory

          public ActiveMQConnectionFactory()

      This will use a default URI from `DefaultConnectionProperties`

    - #### ActiveMQConnectionFactory

          public ActiveMQConnectionFactory(String brokerURL)

    - #### ActiveMQConnectionFactory

          public ActiveMQConnectionFactory(String url,
                                           String user,
                                           String password)

      For compatibility and users used to this kind of constructor

    - #### ActiveMQConnectionFactory

          public ActiveMQConnectionFactory(ServerLocator serverLocator)

    - #### ActiveMQConnectionFactory

          public ActiveMQConnectionFactory(boolean ha,
                                           DiscoveryGroupConfiguration groupConfiguration)

    - #### ActiveMQConnectionFactory

          public ActiveMQConnectionFactory(boolean ha,
                                           TransportConfiguration... initialConnectors)

  - ### Method Detail

    - #### writeExternal

          public void writeExternal(ObjectOutput out)
                             throws IOException

      Specified by:
        `writeExternal` in interface `Externalizable`
      Throws:
        `IOException`

    - #### toURI

          public URI toURI()
                    throws IOException

      Throws:
        `IOException`

    - #### getProtocolManagerFactoryStr

          public String getProtocolManagerFactoryStr()

    - #### setProtocolManagerFactoryStr

          public void setProtocolManagerFactoryStr(String protocolManagerFactoryStr)

    - #### disableFinalizeChecks

          public ActiveMQConnectionFactory disableFinalizeChecks()

    - #### isFinalizeChecks

          public boolean isFinalizeChecks()

    - #### getDeserializationBlackList

          public String getDeserializationBlackList()

      Specified by:
        `getDeserializationBlackList` in interface `ConnectionFactoryOptions`

    - #### setDeserializationBlackList

          public void setDeserializationBlackList(String blackList)

      Specified by:
        `setDeserializationBlackList` in interface `ConnectionFactoryOptions`

    - #### getDeserializationWhiteList

          public String getDeserializationWhiteList()

      Specified by:
        `getDeserializationWhiteList` in interface `ConnectionFactoryOptions`

    - #### setDeserializationWhiteList

          public void setDeserializationWhiteList(String whiteList)

      Specified by:
        `setDeserializationWhiteList` in interface `ConnectionFactoryOptions`

    - #### readExternal

          public void readExternal(ObjectInput in)
                            throws IOException,
                                   ClassNotFoundException

      Specified by:
        `readExternal` in interface `Externalizable`
      Throws:
        `IOException`
        `ClassNotFoundException`

    - #### createConnection

          public javax.jms.Connection createConnection()
                                                throws javax.jms.JMSException

      Specified by:
        `createConnection` in interface `javax.jms.ConnectionFactory`
      Throws:
        `javax.jms.JMSException`

    - #### createConnection

          public javax.jms.Connection createConnection(String username,
                                                       String password)
                                                throws javax.jms.JMSException

      Specified by:
        `createConnection` in interface `javax.jms.ConnectionFactory`
      Throws:
        `javax.jms.JMSException`

    - #### createContext

          public javax.jms.JMSContext createContext()

      Specified by:
        `createContext` in interface `javax.jms.ConnectionFactory`

    - #### createContext

          public javax.jms.JMSContext createContext(int sessionMode)

      Specified by:
        `createContext` in interface `javax.jms.ConnectionFactory`

    - #### createContext

          public javax.jms.JMSContext createContext(String userName,
                                                    String password)

      Specified by:
        `createContext` in interface `javax.jms.ConnectionFactory`

    - #### createContext

          public javax.jms.JMSContext createContext(String userName,
                                                    String password,
                                                    int sessionMode)

      Specified by:
        `createContext` in interface `javax.jms.ConnectionFactory`

    - #### createQueueConnection

          public javax.jms.QueueConnection createQueueConnection()
                                                          throws javax.jms.JMSException

      Throws:
        `javax.jms.JMSException`

    - #### createQueueConnection

          public javax.jms.QueueConnection createQueueConnection(String username,
                                                                 String password)
                                                          throws javax.jms.JMSException

      Throws:
        `javax.jms.JMSException`

    - #### createTopicConnection

          public javax.jms.TopicConnection createTopicConnection()
                                                          throws javax.jms.JMSException

      Throws:
        `javax.jms.JMSException`

    - #### createTopicConnection

          public javax.jms.TopicConnection createTopicConnection(String username,
                                                                 String password)
                                                          throws javax.jms.JMSException

      Throws:
        `javax.jms.JMSException`

    - #### createXAConnection

          public javax.jms.XAConnection createXAConnection()
                                                    throws javax.jms.JMSException

      Specified by:
        `createXAConnection` in interface `javax.jms.XAConnectionFactory`
      Throws:
        `javax.jms.JMSException`

    - #### createXAConnection

          public javax.jms.XAConnection createXAConnection(String username,
                                                           String password)
                                                    throws javax.jms.JMSException

      Specified by:
        `createXAConnection` in interface `javax.jms.XAConnectionFactory`
      Throws:
        `javax.jms.JMSException`

    - #### createXAContext

          public javax.jms.XAJMSContext createXAContext()

      Specified by:
        `createXAContext` in interface `javax.jms.XAConnectionFactory`

    - #### createXAContext

          public javax.jms.XAJMSContext createXAContext(String userName,
                                                        String password)

      Specified by:
        `createXAContext` in interface `javax.jms.XAConnectionFactory`

    - #### createXAQueueConnection

          public javax.jms.XAQueueConnection createXAQueueConnection()
                                                              throws javax.jms.JMSException

      Throws:
        `javax.jms.JMSException`

    - #### createXAQueueConnection

          public javax.jms.XAQueueConnection createXAQueueConnection(String username,
                                                                     String password)
                                                              throws javax.jms.JMSException

      Throws:
        `javax.jms.JMSException`

    - #### createXATopicConnection

          public javax.jms.XATopicConnection createXATopicConnection()
                                                              throws javax.jms.JMSException

      Throws:
        `javax.jms.JMSException`

    - #### createXATopicConnection

          public javax.jms.XATopicConnection createXATopicConnection(String username,
                                                                     String password)
                                                              throws javax.jms.JMSException

      Throws:
        `javax.jms.JMSException`

    - #### buildFromProperties

          protected void buildFromProperties(Properties props)

      Description copied from class: `JNDIStorable`
      Set the properties that will represent the instance in JNDI
      Specified by:
        `buildFromProperties` in class `JNDIStorable`
      Parameters:
        `props` - The properties to use when building the new isntance.

    - #### populateProperties

          protected void populateProperties(Properties props)

      Description copied from class: `JNDIStorable`
      Initialize the instance from properties stored in JNDI
      Specified by:
        `populateProperties` in class `JNDIStorable`
      Parameters:
        `props` - The properties to use when initializing the new instance.

    - #### isHA

          public boolean isHA()

    - #### getConnectionLoadBalancingPolicyClassName

          public String getConnectionLoadBalancingPolicyClassName()

    - #### setConnectionLoadBalancingPolicyClassName

          public void setConnectionLoadBalancingPolicyClassName(String connectionLoadBalancingPolicyClassName)

    - #### getStaticConnectors

          public TransportConfiguration[] getStaticConnectors()

    - #### getDiscoveryGroupConfiguration

          public DiscoveryGroupConfiguration getDiscoveryGroupConfiguration()

    - #### getClientID

          public String getClientID()

    - #### setClientID

          public void setClientID(String clientID)

    - #### getDupsOKBatchSize

          public int getDupsOKBatchSize()

    - #### setDupsOKBatchSize

          public void setDupsOKBatchSize(int dupsOKBatchSize)

    - #### getTransactionBatchSize

          public int getTransactionBatchSize()

    - #### setTransactionBatchSize

          public void setTransactionBatchSize(int transactionBatchSize)

    - #### isCacheDestinations

          public boolean isCacheDestinations()

    - #### setCacheDestinations

          public void setCacheDestinations(boolean cacheDestinations)

    - #### getClientFailureCheckPeriod

          public long getClientFailureCheckPeriod()

    - #### setClientFailureCheckPeriod

          public void setClientFailureCheckPeriod(long clientFailureCheckPeriod)

    - #### getConnectionTTL

          public long getConnectionTTL()

    - #### setConnectionTTL

          public void setConnectionTTL(long connectionTTL)

    - #### getCallTimeout

          public long getCallTimeout()

    - #### setCallTimeout

          public void setCallTimeout(long callTimeout)

    - #### getCallFailoverTimeout

          public long getCallFailoverTimeout()

    - #### setCallFailoverTimeout

          public void setCallFailoverTimeout(long callTimeout)

    - #### getConsumerWindowSize

          public int getConsumerWindowSize()

    - #### setConsumerWindowSize

          public void setConsumerWindowSize(int consumerWindowSize)

    - #### getConsumerMaxRate

          public int getConsumerMaxRate()

    - #### setConsumerMaxRate

          public void setConsumerMaxRate(int consumerMaxRate)

    - #### getConfirmationWindowSize

          public int getConfirmationWindowSize()

    - #### setConfirmationWindowSize

          public void setConfirmationWindowSize(int confirmationWindowSize)

    - #### getProducerMaxRate

          public int getProducerMaxRate()

    - #### setProducerMaxRate

          public void setProducerMaxRate(int producerMaxRate)

    - #### getProducerWindowSize

          public int getProducerWindowSize()

    - #### setProducerWindowSize

          public void setProducerWindowSize(int producerWindowSize)

    - #### setCacheLargeMessagesClient

          public void setCacheLargeMessagesClient(boolean cacheLargeMessagesClient)

      Parameters:
        `cacheLargeMessagesClient` -

    - #### isCacheLargeMessagesClient

          public boolean isCacheLargeMessagesClient()

    - #### getMinLargeMessageSize

          public int getMinLargeMessageSize()

    - #### setMinLargeMessageSize

          public void setMinLargeMessageSize(int minLargeMessageSize)

    - #### isBlockOnAcknowledge

          public boolean isBlockOnAcknowledge()

    - #### setBlockOnAcknowledge

          public void setBlockOnAcknowledge(boolean blockOnAcknowledge)

    - #### isBlockOnNonDurableSend

          public boolean isBlockOnNonDurableSend()

    - #### setBlockOnNonDurableSend

          public void setBlockOnNonDurableSend(boolean blockOnNonDurableSend)

    - #### isBlockOnDurableSend

          public boolean isBlockOnDurableSend()

    - #### setBlockOnDurableSend

          public void setBlockOnDurableSend(boolean blockOnDurableSend)

    - #### isAutoGroup

          public boolean isAutoGroup()

    - #### setAutoGroup

          public void setAutoGroup(boolean autoGroup)

    - #### isPreAcknowledge

          public boolean isPreAcknowledge()

    - #### setPreAcknowledge

          public void setPreAcknowledge(boolean preAcknowledge)

    - #### getRetryInterval

          public long getRetryInterval()

    - #### setRetryInterval

          public void setRetryInterval(long retryInterval)

    - #### getMaxRetryInterval

          public long getMaxRetryInterval()

    - #### setMaxRetryInterval

          public void setMaxRetryInterval(long retryInterval)

    - #### getRetryIntervalMultiplier

          public double getRetryIntervalMultiplier()

    - #### setRetryIntervalMultiplier

          public void setRetryIntervalMultiplier(double retryIntervalMultiplier)

    - #### getReconnectAttempts

          public int getReconnectAttempts()

    - #### setReconnectAttempts

          public void setReconnectAttempts(int reconnectAttempts)

    - #### setInitialConnectAttempts

          public void setInitialConnectAttempts(int reconnectAttempts)

    - #### getInitialConnectAttempts

          public int getInitialConnectAttempts()

    - #### isFailoverOnInitialConnection

          public boolean isFailoverOnInitialConnection()

    - #### setFailoverOnInitialConnection

          public void setFailoverOnInitialConnection(boolean failover)

    - #### isUseGlobalPools

          public boolean isUseGlobalPools()

    - #### setUseGlobalPools

          public void setUseGlobalPools(boolean useGlobalPools)

    - #### getScheduledThreadPoolMaxSize

          public int getScheduledThreadPoolMaxSize()

    - #### setScheduledThreadPoolMaxSize

          public void setScheduledThreadPoolMaxSize(int scheduledThreadPoolMaxSize)

    - #### getThreadPoolMaxSize

          public int getThreadPoolMaxSize()

    - #### setThreadPoolMaxSize

          public void setThreadPoolMaxSize(int threadPoolMaxSize)

    - #### getInitialMessagePacketSize

          public int getInitialMessagePacketSize()

    - #### setInitialMessagePacketSize

          public void setInitialMessagePacketSize(int size)

    - #### isIgnoreJTA

          public boolean isIgnoreJTA()

    - #### setIgnoreJTA

          public void setIgnoreJTA(boolean ignoreJTA)

    - #### setIncomingInterceptorList

          public void setIncomingInterceptorList(String interceptorList)

      Parameters:
        `interceptorList` - a comma separated string of incoming interceptor class names to be used. Each interceptor needs a default Constructor to be used with this method.

    - #### getIncomingInterceptorList

          public String getIncomingInterceptorList()

    - #### setOutgoingInterceptorList

          public void setOutgoingInterceptorList(String interceptorList)

      Parameters:
        `interceptorList` - a comma separated string of incoming interceptor class names to be used. Each interceptor needs a default Constructor to be used with this method.

    - #### getOutgoingInterceptorList

          public String getOutgoingInterceptorList()

    - #### setUser

          public ActiveMQConnectionFactory setUser(String user)

    - #### getUser

          public String getUser()

    - #### getPassword

          public String getPassword()

    - #### setPassword

          public ActiveMQConnectionFactory setPassword(String password)

    - #### setGroupID

          public void setGroupID(String groupID)

    - #### getGroupID

          public String getGroupID()

    - #### isCompressLargeMessage

          public boolean isCompressLargeMessage()

    - #### setCompressLargeMessage

          public void setCompressLargeMessage(boolean avoidLargeMessages)

    - #### close

          public void close()

      Specified by:
        `close` in interface `AutoCloseable`

    - #### getServerLocator

          public ServerLocator getServerLocator()

    - #### getFactoryType

          public int getFactoryType()

    - #### createConnectionInternal

          protected ActiveMQConnection createConnectionInternal(String username,
                                                                String password,
                                                                boolean isXA,
                                                                int type)
                                                         throws javax.jms.JMSException

      Throws:
        `javax.jms.JMSException`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### finalize

          protected void finalize()
                           throws Throwable

      Overrides:
        `finalize` in class `Object`
      Throws:
        `Throwable`

Copyright © 2018 The Apache Software Foundation. All rights reserved.