Save This Page
Home » apache-activemq-5.1.0-src » org.apache » activemq » [javadoc | source]
org.apache.activemq
public class: ActiveMQConnectionFactory [javadoc | source]
java.lang.Object
   org.apache.activemq.jndi.JNDIBaseStorable
      org.apache.activemq.ActiveMQConnectionFactory

All Implemented Interfaces:
    StatsCapable, javax.jms.TopicConnectionFactory, Cloneable, javax.jms.ConnectionFactory, javax.jms.QueueConnectionFactory, JNDIStorableInterface, Externalizable

Direct Known Subclasses:
    ActiveMQSslConnectionFactory, CamelConnectionFactory, ActiveMQXAConnectionFactory, ActiveMQConnectionFactory, ActiveMQXAConnectionFactory

A ConnectionFactory is an an Administered object, and is used for creating Connections.

This class also implements QueueConnectionFactory and TopicConnectionFactory. You can use this connection to create both QueueConnections and TopicConnections.

Field Summary
public static final  String DEFAULT_BROKER_BIND_URL     
public static final  String DEFAULT_BROKER_URL     
public static final  String DEFAULT_USER     
public static final  String DEFAULT_PASSWORD     
public static final  int DEFAULT_PRODUCER_WINDOW_SIZE     
protected static final  Executor DEFAULT_CONNECTION_EXECUTOR     
protected  URI brokerURL     
protected  String userName     
protected  String password     
protected  String clientID     
protected  boolean dispatchAsync     
protected  boolean alwaysSessionAsync     
 JMSStatsImpl factoryStats     
Constructor:
 public ActiveMQConnectionFactory() 
 public ActiveMQConnectionFactory(String brokerURL) 
 public ActiveMQConnectionFactory(URI brokerURL) 
 public ActiveMQConnectionFactory(String userName,
    String password,
    URI brokerURL) 
 public ActiveMQConnectionFactory(String userName,
    String password,
    String brokerURL) 
Method from org.apache.activemq.ActiveMQConnectionFactory Summary:
buildFromMap,   buildFromProperties,   configureConnection,   copy,   createActiveMQConnection,   createActiveMQConnection,   createActiveMQConnection,   createConnection,   createConnection,   createQueueConnection,   createQueueConnection,   createTopicConnection,   createTopicConnection,   createTransport,   getBlobTransferPolicy,   getBrokerURL,   getClientID,   getClientIDPrefix,   getClientIdGenerator,   getCloseTimeout,   getPassword,   getPrefetchPolicy,   getProducerWindowSize,   getRedeliveryPolicy,   getSendTimeout,   getStats,   getTransformer,   getTransportListener,   getUserName,   getWarnAboutUnstartedConnectionTimeout,   isAlwaysSessionAsync,   isAlwaysSyncSend,   isCopyMessageOnSend,   isDisableTimeStampsByDefault,   isDispatchAsync,   isExclusiveConsumer,   isNestedMapAndListEnabled,   isObjectMessageSerializationDefered,   isOptimizeAcknowledge,   isOptimizedMessageDispatch,   isStatsEnabled,   isUseAsyncSend,   isUseCompression,   isUseRetroactiveConsumer,   isWatchTopicAdvisories,   populateProperties,   setAlwaysSessionAsync,   setAlwaysSyncSend,   setBlobTransferPolicy,   setBrokerURL,   setClientID,   setClientIDPrefix,   setClientIdGenerator,   setCloseTimeout,   setCopyMessageOnSend,   setDisableTimeStampsByDefault,   setDispatchAsync,   setExclusiveConsumer,   setNestedMapAndListEnabled,   setObjectMessageSerializationDefered,   setOptimizeAcknowledge,   setOptimizedMessageDispatch,   setPassword,   setPrefetchPolicy,   setProducerWindowSize,   setRedeliveryPolicy,   setSendTimeout,   setStatsEnabled,   setTransformer,   setTransportListener,   setUseAsyncSend,   setUseCompression,   setUseRetroactiveConsumer,   setUserName,   setWarnAboutUnstartedConnectionTimeout,   setWatchTopicAdvisories
Methods from org.apache.activemq.jndi.JNDIBaseStorable:
buildFromProperties,   getProperties,   getReference,   populateProperties,   readExternal,   setProperties,   writeExternal
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.activemq.ActiveMQConnectionFactory Detail:
 public boolean buildFromMap(Map properties) 
 public  void buildFromProperties(Properties properties) 
 protected  void configureConnection(ActiveMQConnection connection) 
 public ActiveMQConnectionFactory copy() 
    Returns a copy of the given connection factory
 protected ActiveMQConnection createActiveMQConnection() throws JMSException 
 protected ActiveMQConnection createActiveMQConnection(String userName,
    String password) throws JMSException 
 protected ActiveMQConnection createActiveMQConnection(Transport transport,
    JMSStatsImpl stats) throws Exception 
 public Connection createConnection() throws JMSException 
 public Connection createConnection(String userName,
    String password) throws JMSException 
 public QueueConnection createQueueConnection() throws JMSException 
 public QueueConnection createQueueConnection(String userName,
    String password) throws JMSException 
 public TopicConnection createTopicConnection() throws JMSException 
 public TopicConnection createTopicConnection(String userName,
    String password) throws JMSException 
 protected Transport createTransport() throws JMSException 
    Creates a Transport based on this object's connection settings. Separated from createActiveMQConnection to allow for subclasses to override.
 public BlobTransferPolicy getBlobTransferPolicy() 
 public String getBrokerURL() 
 public String getClientID() 
 public String getClientIDPrefix() 
 protected synchronized IdGenerator getClientIdGenerator() 
 public int getCloseTimeout() 
 public String getPassword() 
 public ActiveMQPrefetchPolicy getPrefetchPolicy() 
 public synchronized int getProducerWindowSize() 
 public RedeliveryPolicy getRedeliveryPolicy() 
 public int getSendTimeout() 
 public StatsImpl getStats() 
 public MessageTransformer getTransformer() 
 public TransportListener getTransportListener() 
 public String getUserName() 
 public long getWarnAboutUnstartedConnectionTimeout() 
 public boolean isAlwaysSessionAsync() 
 public boolean isAlwaysSyncSend() 
 public boolean isCopyMessageOnSend() 
 public boolean isDisableTimeStampsByDefault() 
 public boolean isDispatchAsync() 
 public boolean isExclusiveConsumer() 
 public boolean isNestedMapAndListEnabled() 
 public boolean isObjectMessageSerializationDefered() 
 public boolean isOptimizeAcknowledge() 
 public boolean isOptimizedMessageDispatch() 
 public boolean isStatsEnabled() 
 public boolean isUseAsyncSend() 
 public boolean isUseCompression() 
 public boolean isUseRetroactiveConsumer() 
 public synchronized boolean isWatchTopicAdvisories() 
 public  void populateProperties(Properties props) 
 public  void setAlwaysSessionAsync(boolean alwaysSessionAsync) 
    If this flag is set then a separate thread is not used for dispatching messages for each Session in the Connection. However, a separate thread is always used if there is more than one session, or the session isn't in auto acknowledge or duplicates ok mode
 public  void setAlwaysSyncSend(boolean alwaysSyncSend) 
    Set true if always require messages to be sync sent
 public  void setBlobTransferPolicy(BlobTransferPolicy blobTransferPolicy) 
    Sets the policy used to describe how out-of-band BLOBs (Binary Large OBjects) are transferred from producers to brokers to consumers
 public  void setBrokerURL(String brokerURL) 
 public  void setClientID(String clientID) 
    Sets the JMS clientID to use for the created connection. Note that this can only be used by one connection at once so generally its a better idea to set the clientID on a Connection
 public  void setClientIDPrefix(String clientIDPrefix) 
    Sets the prefix used by autogenerated JMS Client ID values which are used if the JMS client does not explicitly specify on.
 protected  void setClientIdGenerator(IdGenerator clientIdGenerator) 
 public  void setCloseTimeout(int closeTimeout) 
    Sets the timeout before a close is considered complete. Normally a close() on a connection waits for confirmation from the broker; this allows that operation to timeout to save the client hanging if there is no broker
 public  void setCopyMessageOnSend(boolean copyMessageOnSend) 
    Should a JMS message be copied to a new JMS Message object as part of the send() method in JMS. This is enabled by default to be compliant with the JMS specification. You can disable it if you do not mutate JMS messages after they are sent for a performance boost
 public  void setDisableTimeStampsByDefault(boolean disableTimeStampsByDefault) 
    Sets whether or not timestamps on messages should be disabled or not. If you disable them it adds a small performance boost.
 public  void setDispatchAsync(boolean asyncDispatch) 
    Enables or disables the default setting of whether or not consumers have their messages dispatched synchronously or asynchronously by the broker. For non-durable topics for example we typically dispatch synchronously by default to minimize context switches which boost performance. However sometimes its better to go slower to ensure that a single blocked consumer socket does not block delivery to other consumers.
 public  void setExclusiveConsumer(boolean exclusiveConsumer) 
    Enables or disables whether or not queue consumers should be exclusive or not for example to preserve ordering when not using Message Groups
 public  void setNestedMapAndListEnabled(boolean structuredMapsEnabled) 
    Enables/disables whether or not Message properties and MapMessage entries support Nested Structures of Map and List objects
 public  void setObjectMessageSerializationDefered(boolean objectMessageSerializationDefered) 
    When an object is set on an ObjectMessage, the JMS spec requires the object to be serialized by that set method. Enabling this flag causes the object to not get serialized. The object may subsequently get serialized if the message needs to be sent over a socket or stored to disk.
 public  void setOptimizeAcknowledge(boolean optimizeAcknowledge) 
 public  void setOptimizedMessageDispatch(boolean optimizedMessageDispatch) 
    If this flag is set then an larger prefetch limit is used - only applicable for durable topic subscribers.
 public  void setPassword(String password) 
    Sets the JMS password used for connections created from this factory
 public  void setPrefetchPolicy(ActiveMQPrefetchPolicy prefetchPolicy) 
 public synchronized  void setProducerWindowSize(int producerWindowSize) 
 public  void setRedeliveryPolicy(RedeliveryPolicy redeliveryPolicy) 
    Sets the global redelivery policy to be used when a message is delivered but the session is rolled back
 public  void setSendTimeout(int sendTimeout) 
 public  void setStatsEnabled(boolean statsEnabled) 
 public  void setTransformer(MessageTransformer transformer) 
    Sets the transformer used to transform messages before they are sent on to the JMS bus or when they are received from the bus but before they are delivered to the JMS client
 public  void setTransportListener(TransportListener transportListener) 
    Allows a listener to be configured on the ConnectionFactory so that when this factory is used with frameworks which don't expose the Connection such as Spring JmsTemplate, you can still register a transport listener.
 public  void setUseAsyncSend(boolean useAsyncSend) 
    Forces the use of Async Sends which adds a massive performance boost; but means that the send() method will return immediately whether the message has been sent or not which could lead to message loss.
 public  void setUseCompression(boolean useCompression) 
    Enables the use of compression of the message bodies
 public  void setUseRetroactiveConsumer(boolean useRetroactiveConsumer) 
    Sets whether or not retroactive consumers are enabled. Retroactive consumers allow non-durable topic subscribers to receive old messages that were published before the non-durable subscriber started.
 public  void setUserName(String userName) 
    Sets the JMS userName used by connections created by this factory
 public  void setWarnAboutUnstartedConnectionTimeout(long warnAboutUnstartedConnectionTimeout) 
    Enables the timeout from a connection creation to when a warning is generated if the connection is not properly started via Connection#start() and a message is received by a consumer. It is a very common gotcha to forget to start the connection so this option makes the default case to create a warning if the user forgets. To disable the warning just set the value to < 0 (say -1).
 public synchronized  void setWatchTopicAdvisories(boolean watchTopicAdvisories)