public class JmsConnectionFactory extends JNDIStorable implements javax.jms.ConnectionFactory, javax.jms.QueueConnectionFactory, javax.jms.TopicConnectionFactory
Modifier and Type | Field and Description |
---|---|
static String |
REMOTE_URI_PROP |
Constructor and Description |
---|
JmsConnectionFactory() |
JmsConnectionFactory(String remoteURI) |
JmsConnectionFactory(String username,
String password) |
JmsConnectionFactory(String userName,
String password,
String remoteURI) |
JmsConnectionFactory(String userName,
String password,
URI remoteURI) |
JmsConnectionFactory(URI remoteURI) |
Modifier and Type | Method and Description |
---|---|
protected Map<String,String> |
buildFromProperties(Map<String,String> props)
Set the properties that will represent the instance in JNDI
|
protected <T extends JmsConnection> |
configureConnection(T connection,
String username,
String password) |
javax.jms.Connection |
createConnection() |
javax.jms.Connection |
createConnection(String username,
String password) |
protected Provider |
createProvider(URI remoteURI) |
javax.jms.QueueConnection |
createQueueConnection() |
javax.jms.QueueConnection |
createQueueConnection(String username,
String password) |
javax.jms.TopicConnection |
createTopicConnection() |
javax.jms.TopicConnection |
createTopicConnection(String username,
String password) |
protected static URI |
createURI(String name) |
String |
getClientID() |
protected IdGenerator |
getClientIdGenerator() |
String |
getClientIDPrefix() |
long |
getCloseTimeout()
Gets the currently set close timeout.
|
protected IdGenerator |
getConnectionIdGenerator() |
long |
getConnectTimeout()
Returns the currently configured wire level connect timeout.
|
javax.jms.ExceptionListener |
getExceptionListener()
Gets the currently configured JMS ExceptionListener that will be set on all
new Connection objects created from this factory.
|
JmsMessageIDBuilder |
getMessageIDBuilder() |
String |
getMessageIDType() |
String |
getPassword() |
JmsPrefetchPolicy |
getPrefetchPolicy() |
String |
getQueuePrefix()
Returns the prefix applied to Queues that are created by the client.
|
JmsRedeliveryPolicy |
getRedeliveryPolicy()
Returns the JmsRedeliveryPolicy that is applied when a new connection is created.
|
String |
getRemoteURI() |
long |
getRequestTimeout() |
long |
getSendTimeout() |
String |
getTopicPrefix()
Returns the prefix applied to Topics that are created by the client.
|
String |
getUsername() |
boolean |
isAlwaysSyncSend()
Returns true if the client should always send messages using a synchronous
send operation regardless of persistence mode, or inside a transaction.
|
boolean |
isForceAsyncSend() |
boolean |
isLocalMessageExpiry() |
boolean |
isLocalMessagePriority() |
boolean |
isReceiveLocalOnly() |
boolean |
isReceiveNoWaitLocalOnly() |
boolean |
isSendAcksAsync() |
boolean |
isValidatePropertyNames() |
protected void |
populateProperties(Map<String,String> props)
Initialize the instance from properties stored in JNDI
|
void |
setAlwaysSyncSend(boolean alwaysSyncSend)
Configures whether or not the client will always send messages synchronously or not
regardless of other factors that might result in an asynchronous send.
|
void |
setClientID(String clientID)
Sets the JMS clientID to use for connections created by this factory.
|
protected void |
setClientIdGenerator(IdGenerator clientIdGenerator) |
void |
setClientIDPrefix(String clientIDPrefix)
Sets the prefix used by auto-generated JMS Client ID values which are used if the JMS
client does not explicitly specify one.
|
void |
setCloseTimeout(long closeTimeout)
Sets the close timeout used to control how long a Connection close will wait for
clean shutdown of the connection before giving up.
|
protected void |
setConnectionIdGenerator(IdGenerator connectionIdGenerator) |
void |
setConnectionIDPrefix(String connectionIDPrefix)
Sets the prefix used by connection id generator.
|
void |
setConnectTimeout(long connectTimeout)
Sets the timeout value used to control how long a client will wait for a successful
connection to the remote peer to be established before considering the attempt to
have failed.
|
void |
setExceptionListener(javax.jms.ExceptionListener exceptionListener)
Sets the JMS ExceptionListener that will be set on all new Connection objects
created from this factory.
|
void |
setForceAsyncSend(boolean forceAsyncSend) |
void |
setLocalMessageExpiry(boolean localMessageExpiry)
Controls whether message expiration checking is done locally (in addition to any broker
side checks) in each MessageConsumer prior to dispatching a message.
|
void |
setLocalMessagePriority(boolean localMessagePriority)
Enables client-side message priority support in MessageConsumer instances.
|
void |
setMessageIDBuilder(JmsMessageIDBuilder messageIDBuilder)
Allows the owner of this factory to configure a custom Message ID Builder
instance that will be used to create the Message ID values set in outgoing
Messages sent from MessageProducer instances.
|
void |
setMessageIDType(String type)
Sets the type of the Message IDs used to populate the outgoing Messages
|
void |
setPassword(String password) |
void |
setPrefetchPolicy(JmsPrefetchPolicy prefetchPolicy) |
void |
setQueuePrefix(String queuePrefix) |
void |
setReceiveLocalOnly(boolean receiveLocalOnly)
Controls whether the client only checks its local message buffer when using
receive calls with a timeout, or will instead drain remaining credit from the
remote peer to ensure there are really no messages available if the
timeout expires before a message arrives in the consumers local buffer.
|
void |
setReceiveNoWaitLocalOnly(boolean receiveNoWaitLocalOnly)
Controls whether the client only checks its local message buffer when using
receiveNoWait calls, or will instead drain remaining credit from the
remote peer synchronously to ensure there are really no messages available
that have yet to arrive in the consumers local buffer.
|
void |
setRedeliveryPolicy(JmsRedeliveryPolicy redeliveryPolicy)
Sets the JmsRedeliveryPolicy that is applied when a new connection is created.
|
void |
setRemoteURI(String remoteURI) |
void |
setRequestTimeout(long requestTimeout) |
void |
setSendAcksAsync(boolean sendAcksAsync)
Should the message acknowledgments from a consumer be sent synchronously or
asynchronously.
|
void |
setSendTimeout(long sendTimeout) |
void |
setTopicPrefix(String topicPrefix) |
void |
setUsername(String username) |
void |
setValidatePropertyNames(boolean validatePropertyNames) |
getProperties, getProperty, getReference, readExternal, setProperties, writeExternal
public static final String REMOTE_URI_PROP
public JmsConnectionFactory()
public JmsConnectionFactory(String remoteURI)
public JmsConnectionFactory(URI remoteURI)
protected Map<String,String> buildFromProperties(Map<String,String> props)
JNDIStorable
buildFromProperties
in class JNDIStorable
protected void populateProperties(Map<String,String> props)
JNDIStorable
populateProperties
in class JNDIStorable
public javax.jms.TopicConnection createTopicConnection() throws javax.jms.JMSException
createTopicConnection
in interface javax.jms.TopicConnectionFactory
javax.jms.JMSException
public javax.jms.TopicConnection createTopicConnection(String username, String password) throws javax.jms.JMSException
createTopicConnection
in interface javax.jms.TopicConnectionFactory
javax.jms.JMSException
public javax.jms.Connection createConnection() throws javax.jms.JMSException
createConnection
in interface javax.jms.ConnectionFactory
javax.jms.JMSException
public javax.jms.Connection createConnection(String username, 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(String username, String password) throws javax.jms.JMSException
createQueueConnection
in interface javax.jms.QueueConnectionFactory
javax.jms.JMSException
protected <T extends JmsConnection> T configureConnection(T connection, String username, String password) throws javax.jms.JMSException
javax.jms.JMSException
protected IdGenerator getConnectionIdGenerator()
protected void setConnectionIdGenerator(IdGenerator connectionIdGenerator)
public String getRemoteURI()
public void setRemoteURI(String remoteURI)
remoteURI
- the remoteURI to setpublic String getUsername()
public void setUsername(String username)
username
- the user name to setpublic String getPassword()
public void setPassword(String password)
password
- the password to setpublic boolean isForceAsyncSend()
public void setForceAsyncSend(boolean forceAsyncSend)
public boolean isLocalMessagePriority()
public void setLocalMessagePriority(boolean localMessagePriority)
localMessagePriority
- the messagePrioritySupported to setpublic String getQueuePrefix()
public void setQueuePrefix(String queuePrefix)
public String getTopicPrefix()
public void setTopicPrefix(String topicPrefix)
public boolean isValidatePropertyNames()
public void setValidatePropertyNames(boolean validatePropertyNames)
public long getCloseTimeout()
public void setCloseTimeout(long closeTimeout)
closeTimeout
- time in milliseconds to wait for a clean connection close.public long getConnectTimeout()
public void setConnectTimeout(long connectTimeout)
connectTimeout
- the time in milliseconds to wait for the protocol connection handshake to complete.public long getSendTimeout()
public void setSendTimeout(long sendTimeout)
public long getRequestTimeout()
public void setRequestTimeout(long requestTimeout)
public JmsPrefetchPolicy getPrefetchPolicy()
public void setPrefetchPolicy(JmsPrefetchPolicy prefetchPolicy)
public JmsRedeliveryPolicy getRedeliveryPolicy()
public void setRedeliveryPolicy(JmsRedeliveryPolicy redeliveryPolicy)
redeliveryPolicy
- The new redeliveryPolicy to setpublic String getClientIDPrefix()
public void setClientIDPrefix(String clientIDPrefix)
clientIDPrefix
- the value to use as a prefix on auto-generated client IDs.protected IdGenerator getClientIdGenerator()
protected void setClientIdGenerator(IdGenerator clientIdGenerator)
public String getClientID()
public void setClientID(String clientID)
clientID
- The clientID to assign when creating a new connection.public void setConnectionIDPrefix(String connectionIDPrefix)
connectionIDPrefix
- The string prefix used on all connection Id's created by this factory.public javax.jms.ExceptionListener getExceptionListener()
public void setExceptionListener(javax.jms.ExceptionListener exceptionListener)
exceptionListener
- the JMS ExceptionListener to apply to new Connection's or null to clear.public boolean isAlwaysSyncSend()
public void setAlwaysSyncSend(boolean alwaysSyncSend)
alwaysSyncSend
- if true sends are always done synchronously.public boolean isSendAcksAsync()
public void setSendAcksAsync(boolean sendAcksAsync)
sendAcksAsync
- true to have the client send all message acknowledgments asynchronously.public boolean isLocalMessageExpiry()
public void setLocalMessageExpiry(boolean localMessageExpiry)
localMessageExpiry
- controls whether expiration checking is done prior to dispatch.public void setMessageIDType(String type)
type
- The name of the Message type to use when sending a message.public String getMessageIDType()
public JmsMessageIDBuilder getMessageIDBuilder()
public void setMessageIDBuilder(JmsMessageIDBuilder messageIDBuilder)
messageIDBuilder
- The custom JmsMessageIDBuilder to use to create outgoing Message IDs.public boolean isReceiveLocalOnly()
public void setReceiveLocalOnly(boolean receiveLocalOnly)
receiveLocalOnly
- true if receive calls with a timeout should only check the local message buffer.public boolean isReceiveNoWaitLocalOnly()
public void setReceiveNoWaitLocalOnly(boolean receiveNoWaitLocalOnly)
receiveNoWaitLocalOnly
- true if receiveNoWait calls should only check the local message buffer.Copyright © 2013–2015 The Apache Software Foundation. All rights reserved.