public interface ClientSessionFactory extends AutoCloseable
Modifier and Type | Method and Description |
---|---|
ClientSessionFactory |
addFailoverListener(FailoverEventListener listener)
Adds a FailoverEventListener to the session which is notified if a failover event occurs on the session.
|
void |
cleanup()
Opposed to close, will call cleanup only on every created session and children objects.
|
void |
close()
Closes this factory and any session created by it.
|
ClientSession |
createSession()
Creates a non-transacted session.
|
ClientSession |
createSession(boolean autoCommitSends,
boolean autoCommitAcks)
Creates a session.
|
ClientSession |
createSession(boolean xa,
boolean autoCommitSends,
boolean autoCommitAcks)
Creates a session.
|
ClientSession |
createSession(boolean xa,
boolean autoCommitSends,
boolean autoCommitAcks,
boolean preAcknowledge)
Creates a session.
|
ClientSession |
createSession(boolean autoCommitSends,
boolean autoCommitAcks,
int ackBatchSize)
Creates a session.
|
ClientSession |
createSession(String username,
String password,
boolean xa,
boolean autoCommitSends,
boolean autoCommitAcks,
boolean preAcknowledge,
int ackBatchSize)
Creates an authenticated session.
|
ClientSession |
createTransactedSession()
Creates a transacted session.
|
ClientSession |
createXASession()
Creates a session with XA transaction semantics.
|
RemotingConnection |
getConnection()
Returns the code connection used by this session factory.
|
TransportConfiguration |
getConnectorConfiguration()
Return the configuration used
|
ServerLocator |
getServerLocator() |
boolean |
isClosed() |
boolean |
removeFailoverListener(FailoverEventListener listener)
Removes a FailoverEventListener to the session.
|
ClientSession createXASession() throws ActiveMQException
ActiveMQException
- if an exception occurs while creating the sessionClientSession createTransactedSession() throws ActiveMQException
It is up to the client to commit when sending and acknowledging messages.
ActiveMQException
- if an exception occurs while creating the sessionClientSession.commit()
ClientSession createSession() throws ActiveMQException
ActiveMQException
- if an exception occurs while creating the sessionClientSession createSession(boolean autoCommitSends, boolean autoCommitAcks) throws ActiveMQException
autoCommitSends
- true
to automatically commit message sends, false
to commit manuallyautoCommitAcks
- true
to automatically commit message acknowledgement, false
to commit manuallyActiveMQException
- if an exception occurs while creating the sessionClientSession createSession(boolean autoCommitSends, boolean autoCommitAcks, int ackBatchSize) throws ActiveMQException
autoCommitSends
- true
to automatically commit message sends, false
to commit manuallyautoCommitAcks
- true
to automatically commit message acknowledgement, false
to commit manuallyackBatchSize
- the batch size of the acknowledgementsActiveMQException
- if an exception occurs while creating the sessionClientSession createSession(boolean xa, boolean autoCommitSends, boolean autoCommitAcks) throws ActiveMQException
xa
- whether the session support XA transaction semantic or notautoCommitSends
- true
to automatically commit message sends, false
to commit manuallyautoCommitAcks
- true
to automatically commit message acknowledgement, false
to commit manuallyActiveMQException
- if an exception occurs while creating the sessionClientSession createSession(boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge) throws ActiveMQException
It is possible to pre-acknowledge messages on the server so that the client can avoid additional network trip to the server to acknowledge messages. While this increase performance, this does not guarantee delivery (as messages can be lost after being pre-acknowledged on the server). Use with caution if your application design permits it.
xa
- whether the session support XA transaction semantic or notautoCommitSends
- true
to automatically commit message sends, false
to commit manuallyautoCommitAcks
- true
to automatically commit message acknowledgement, false
to commit manuallypreAcknowledge
- true
to pre-acknowledge messages on the server, false
to let the client acknowledge the messagesActiveMQException
- if an exception occurs while creating the sessionClientSession createSession(String username, String password, boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge, int ackBatchSize) throws ActiveMQException
It is possible to pre-acknowledge messages on the server so that the client can avoid additional network trip to the server to acknowledge messages. While this increase performance, this does not guarantee delivery (as messages can be lost after being pre-acknowledged on the server). Use with caution if your application design permits it.
username
- the user namepassword
- the user passwordxa
- whether the session support XA transaction semantic or notautoCommitSends
- true
to automatically commit message sends, false
to commit manuallyautoCommitAcks
- true
to automatically commit message acknowledgement, false
to commit manuallypreAcknowledge
- true
to pre-acknowledge messages on the server, false
to let the client acknowledge the messagesActiveMQException
- if an exception occurs while creating the sessionvoid close()
close
in interface AutoCloseable
boolean isClosed()
true
if the factory is closed, false
otherwise.ClientSessionFactory addFailoverListener(FailoverEventListener listener)
listener
- the listener to addboolean removeFailoverListener(FailoverEventListener listener)
listener
- the listener to removetrue
if the listener was removed, false
elsevoid cleanup()
ServerLocator getServerLocator()
RemotingConnection getConnection()
TransportConfiguration getConnectorConfiguration()
Copyright © 2019 JBoss by Red Hat. All rights reserved.