|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.activemq.jndi.JNDIBaseStorable
org.apache.activemq.ActiveMQConnectionFactory
public class ActiveMQConnectionFactory
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.
ConnectionFactory
,
Serialized FormField Summary | |
---|---|
protected boolean |
alwaysSessionAsync
|
protected java.net.URI |
brokerURL
|
protected java.lang.String |
clientID
|
static java.lang.String |
DEFAULT_BROKER_URL
|
protected static edu.emory.mathcs.backport.java.util.concurrent.Executor |
DEFAULT_CONNECTION_EXECUTOR
|
static java.lang.String |
DEFAULT_PASSWORD
|
static java.lang.String |
DEFAULT_USER
|
protected boolean |
dispatchAsync
|
protected java.lang.String |
password
|
protected java.lang.String |
userName
|
Constructor Summary | |
---|---|
ActiveMQConnectionFactory()
|
|
ActiveMQConnectionFactory(java.lang.String brokerURL)
|
|
ActiveMQConnectionFactory(java.lang.String userName,
java.lang.String password,
java.lang.String brokerURL)
|
|
ActiveMQConnectionFactory(java.lang.String userName,
java.lang.String password,
java.net.URI brokerURL)
|
|
ActiveMQConnectionFactory(java.net.URI brokerURL)
|
Method Summary | |
---|---|
boolean |
buildFromMap(java.util.Map properties)
|
void |
buildFromProperties(java.util.Properties properties)
Set the properties that will represent the instance in JNDI |
ActiveMQConnectionFactory |
copy()
Returns a copy of the given connection factory |
protected ActiveMQConnection |
createActiveMQConnection()
|
protected ActiveMQConnection |
createActiveMQConnection(java.lang.String userName,
java.lang.String password)
|
protected ActiveMQConnection |
createActiveMQConnection(Transport transport,
JMSStatsImpl stats)
|
javax.jms.Connection |
createConnection()
|
javax.jms.Connection |
createConnection(java.lang.String userName,
java.lang.String password)
|
javax.jms.QueueConnection |
createQueueConnection()
|
javax.jms.QueueConnection |
createQueueConnection(java.lang.String userName,
java.lang.String password)
|
javax.jms.TopicConnection |
createTopicConnection()
|
javax.jms.TopicConnection |
createTopicConnection(java.lang.String userName,
java.lang.String password)
|
protected Transport |
createTransport()
Creates a Transport based on this object's connection settings. |
java.lang.String |
getBrokerURL()
|
java.lang.String |
getClientID()
|
protected IdGenerator |
getClientIdGenerator()
|
java.lang.String |
getClientIDPrefix()
|
int |
getCloseTimeout()
|
java.lang.String |
getPassword()
|
ActiveMQPrefetchPolicy |
getPrefetchPolicy()
|
RedeliveryPolicy |
getRedeliveryPolicy()
|
StatsImpl |
getStats()
|
java.lang.String |
getUserName()
|
boolean |
isAlwaysSessionAsync()
|
boolean |
isCopyMessageOnSend()
|
boolean |
isDisableTimeStampsByDefault()
|
boolean |
isDispatchAsync()
|
boolean |
isNestedMapAndListEnabled()
|
boolean |
isObjectMessageSerializationDefered()
|
boolean |
isOptimizeAcknowledge()
|
boolean |
isOptimizedMessageDispatch()
|
boolean |
isStatsEnabled()
|
boolean |
isUseAsyncSend()
|
boolean |
isUseCompression()
|
boolean |
isUseRetroactiveConsumer()
|
boolean |
isUseSyncSend()
|
boolean |
isWatchTopicAdvisories()
|
void |
populateProperties(java.util.Properties props)
Initialize the instance from properties stored in JNDI |
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. |
void |
setBrokerURL(java.lang.String brokerURL)
Sets the connection URL used to connect to the ActiveMQ broker. |
void |
setClientID(java.lang.String clientID)
Sets the JMS clientID to use for the created connection. |
protected void |
setClientIdGenerator(IdGenerator clientIdGenerator)
|
void |
setClientIDPrefix(java.lang.String clientIDPrefix)
Sets the prefix used by autogenerated JMS Client ID values which are used if the JMS client does not explicitly specify on. |
void |
setCloseTimeout(int closeTimeout)
Sets the timeout before a close is considered complete. |
void |
setCopyMessageOnSend(boolean copyMessageOnSend)
Should a JMS message be copied to a new JMS Message object as part of the send() method in JMS. |
void |
setDisableTimeStampsByDefault(boolean disableTimeStampsByDefault)
Sets whether or not timestamps on messages should be disabled or not. |
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. |
void |
setNestedMapAndListEnabled(boolean structuredMapsEnabled)
Enables/disables whether or not Message properties and MapMessage entries support Nested Structures of Map and List objects |
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. |
void |
setOptimizeAcknowledge(boolean optimizeAcknowledge)
|
void |
setOptimizedMessageDispatch(boolean optimizedMessageDispatch)
If this flag is set then an larger prefetch limit is used - only applicable for durable topic subscribers. |
void |
setPassword(java.lang.String password)
Sets the JMS password used for connections created from this factory |
void |
setPrefetchPolicy(ActiveMQPrefetchPolicy prefetchPolicy)
Sets the prefetch policy for consumers created by this connection. |
void |
setRedeliveryPolicy(RedeliveryPolicy redeliveryPolicy)
Sets the global redelivery policy to be used when a message is delivered but the session is rolled back |
void |
setStatsEnabled(boolean statsEnabled)
|
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. |
void |
setUseCompression(boolean useCompression)
Enables the use of compression of the message bodies |
void |
setUseRetroactiveConsumer(boolean useRetroactiveConsumer)
Sets whether or not retroactive consumers are enabled. |
void |
setUserName(java.lang.String userName)
Sets the JMS userName used by connections created by this factory |
void |
setUseSyncSend(boolean forceSyncSend)
|
void |
setWatchTopicAdvisories(boolean watchTopicAdvisories)
|
Methods inherited from class org.apache.activemq.jndi.JNDIBaseStorable |
---|
getProperties, getReference, readExternal, setProperties, writeExternal |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_BROKER_URL
public static final java.lang.String DEFAULT_USER
public static final java.lang.String DEFAULT_PASSWORD
protected java.net.URI brokerURL
protected java.lang.String userName
protected java.lang.String password
protected java.lang.String clientID
protected boolean dispatchAsync
protected boolean alwaysSessionAsync
protected static final edu.emory.mathcs.backport.java.util.concurrent.Executor DEFAULT_CONNECTION_EXECUTOR
Constructor Detail |
---|
public ActiveMQConnectionFactory()
public ActiveMQConnectionFactory(java.lang.String brokerURL)
public ActiveMQConnectionFactory(java.net.URI brokerURL)
public ActiveMQConnectionFactory(java.lang.String userName, java.lang.String password, java.net.URI brokerURL)
public ActiveMQConnectionFactory(java.lang.String userName, java.lang.String password, java.lang.String brokerURL)
Method Detail |
---|
public ActiveMQConnectionFactory copy()
public javax.jms.Connection createConnection() throws javax.jms.JMSException
createConnection
in interface javax.jms.ConnectionFactory
javax.jms.JMSException
public javax.jms.Connection createConnection(java.lang.String userName, java.lang.String password) throws javax.jms.JMSException
createConnection
in interface javax.jms.ConnectionFactory
javax.jms.JMSException
public javax.jms.QueueConnection createQueueConnection() throws javax.jms.JMSException
createQueueConnection
in interface javax.jms.QueueConnectionFactory
javax.jms.JMSException
public javax.jms.QueueConnection createQueueConnection(java.lang.String userName, java.lang.String password) throws javax.jms.JMSException
createQueueConnection
in interface javax.jms.QueueConnectionFactory
javax.jms.JMSException
public javax.jms.TopicConnection createTopicConnection() throws javax.jms.JMSException
createTopicConnection
in interface javax.jms.TopicConnectionFactory
javax.jms.JMSException
public javax.jms.TopicConnection createTopicConnection(java.lang.String userName, java.lang.String password) throws javax.jms.JMSException
createTopicConnection
in interface javax.jms.TopicConnectionFactory
javax.jms.JMSException
public StatsImpl getStats()
getStats
in interface StatsCapable
protected ActiveMQConnection createActiveMQConnection() throws javax.jms.JMSException
javax.jms.JMSException
protected Transport createTransport() throws javax.jms.JMSException
javax.jms.JMSException
- If unable to create trasnport.protected ActiveMQConnection createActiveMQConnection(java.lang.String userName, java.lang.String password) throws javax.jms.JMSException
javax.jms.JMSException
protected ActiveMQConnection createActiveMQConnection(Transport transport, JMSStatsImpl stats) throws java.lang.Exception
java.lang.Exception
public java.lang.String getBrokerURL()
public void setBrokerURL(java.lang.String brokerURL)
public java.lang.String getClientID()
public void setClientID(java.lang.String clientID)
public boolean isCopyMessageOnSend()
public void setCopyMessageOnSend(boolean copyMessageOnSend)
public boolean isDisableTimeStampsByDefault()
public void setDisableTimeStampsByDefault(boolean disableTimeStampsByDefault)
public boolean isOptimizedMessageDispatch()
public void setOptimizedMessageDispatch(boolean optimizedMessageDispatch)
public java.lang.String getPassword()
public void setPassword(java.lang.String password)
public ActiveMQPrefetchPolicy getPrefetchPolicy()
public void setPrefetchPolicy(ActiveMQPrefetchPolicy prefetchPolicy)
public boolean isUseAsyncSend()
public void setUseAsyncSend(boolean useAsyncSend)
public java.lang.String getUserName()
public void setUserName(java.lang.String userName)
public boolean isUseRetroactiveConsumer()
public void setUseRetroactiveConsumer(boolean useRetroactiveConsumer)
public RedeliveryPolicy getRedeliveryPolicy()
public void setRedeliveryPolicy(RedeliveryPolicy redeliveryPolicy)
public void buildFromProperties(java.util.Properties properties)
JNDIBaseStorable
buildFromProperties
in class JNDIBaseStorable
public boolean buildFromMap(java.util.Map properties)
public void populateProperties(java.util.Properties props)
JNDIBaseStorable
populateProperties
in class JNDIBaseStorable
public boolean isUseCompression()
public void setUseCompression(boolean useCompression)
public boolean isObjectMessageSerializationDefered()
public void setObjectMessageSerializationDefered(boolean objectMessageSerializationDefered)
public boolean isDispatchAsync()
public void setDispatchAsync(boolean asyncDispatch)
asyncDispatch
- If true then consumers created on this connection will default
to having their messages dispatched asynchronously. The
default value is false.public int getCloseTimeout()
public void setCloseTimeout(int closeTimeout)
public boolean isAlwaysSessionAsync()
public void setAlwaysSessionAsync(boolean alwaysSessionAsync)
public boolean isOptimizeAcknowledge()
public void setOptimizeAcknowledge(boolean optimizeAcknowledge)
optimizeAcknowledge
- The optimizeAcknowledge to set.public boolean isNestedMapAndListEnabled()
public void setNestedMapAndListEnabled(boolean structuredMapsEnabled)
public java.lang.String getClientIDPrefix()
public void setClientIDPrefix(java.lang.String clientIDPrefix)
clientIDPrefix
- protected IdGenerator getClientIdGenerator()
protected void setClientIdGenerator(IdGenerator clientIdGenerator)
public boolean isStatsEnabled()
public void setStatsEnabled(boolean statsEnabled)
statsEnabled
- the statsEnabled to setpublic boolean isUseSyncSend()
public void setUseSyncSend(boolean forceSyncSend)
public boolean isWatchTopicAdvisories()
public void setWatchTopicAdvisories(boolean watchTopicAdvisories)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |