public class ClientSessionFactoryImpl extends Object implements ClientSessionFactoryInternal, ConnectionLifeCycleListener
Constructor and Description |
---|
ClientSessionFactoryImpl(ServerLocatorInternal serverLocator,
TransportConfiguration connectorConfig,
long callTimeout,
long clientFailureCheckPeriod,
long connectionTTL,
long retryInterval,
double retryIntervalMultiplier,
long maxRetryInterval,
int reconnectAttempts,
Executor threadPool,
ScheduledExecutorService scheduledThreadPool,
List<Interceptor> interceptors) |
Modifier and Type | Method and Description |
---|---|
void |
addFailureListener(SessionFailureListener listener) |
void |
causeExit() |
void |
cleanup()
Opposed to close, will call cleanup only on every created session and children objects.
|
void |
close() |
void |
connect(int initialConnectAttempts,
boolean failoverOnInitialConnection) |
void |
connectionCreated(Acceptor acceptor,
Connection connection,
ProtocolType protocol)
This method is used both by client connector creation and server connection creation through acceptors.
|
void |
connectionDestroyed(Object connectionID)
called when a connection is destroyed.
|
void |
connectionException(Object connectionID,
HornetQException me)
called when an error occurs on the connection.
|
void |
connectionReadyForWrites(Object connectionID,
boolean ready) |
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.
|
void |
disableFinalizeCheck() |
void |
finalize() |
Object |
getBackupConnector() |
CoreRemotingConnection |
getConnection() |
TransportConfiguration |
getConnectorConfiguration() |
ServerLocator |
getServerLocator() |
boolean |
isClosed() |
int |
numConnections() |
int |
numSessions() |
boolean |
removeFailureListener(SessionFailureListener listener) |
void |
removeSession(ClientSessionInternal session,
boolean failingOver) |
void |
resumePinging() |
void |
sendNodeAnnounce(long currentEventID,
String nodeID,
boolean isBackup,
TransportConfiguration config,
TransportConfiguration backupConfig) |
void |
setBackupConnector(TransportConfiguration live,
TransportConfiguration backUp) |
void |
setReconnectAttempts(int attempts) |
void |
stopPingingAfterOne() |
String |
toString() |
public final Exception e
public ClientSessionFactoryImpl(ServerLocatorInternal serverLocator, TransportConfiguration connectorConfig, long callTimeout, long clientFailureCheckPeriod, long connectionTTL, long retryInterval, double retryIntervalMultiplier, long maxRetryInterval, int reconnectAttempts, Executor threadPool, ScheduledExecutorService scheduledThreadPool, List<Interceptor> interceptors)
public void disableFinalizeCheck()
disableFinalizeCheck
in interface ClientSessionFactoryInternal
public void connect(int initialConnectAttempts, boolean failoverOnInitialConnection) throws HornetQException
connect
in interface ClientSessionFactoryInternal
HornetQException
public TransportConfiguration getConnectorConfiguration()
getConnectorConfiguration
in interface ClientSessionFactoryInternal
public void setBackupConnector(TransportConfiguration live, TransportConfiguration backUp)
setBackupConnector
in interface ClientSessionFactoryInternal
public Object getBackupConnector()
getBackupConnector
in interface ClientSessionFactoryInternal
public ClientSession createSession(String username, String password, boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge, int ackBatchSize) throws HornetQException
ClientSessionFactory
createSession
in interface ClientSessionFactory
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 messagesHornetQException
- if an exception occurs while creating the sessionpublic ClientSession createSession(boolean autoCommitSends, boolean autoCommitAcks, int ackBatchSize) throws HornetQException
ClientSessionFactory
createSession
in interface ClientSessionFactory
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 acknowledgementsHornetQException
- if an exception occurs while creating the sessionpublic ClientSession createXASession() throws HornetQException
ClientSessionFactory
createXASession
in interface ClientSessionFactory
HornetQException
- if an exception occurs while creating the sessionpublic ClientSession createTransactedSession() throws HornetQException
ClientSessionFactory
createTransactedSession
in interface ClientSessionFactory
HornetQException
- if an exception occurs while creating the sessionClientSession.commit()
public ClientSession createSession() throws HornetQException
ClientSessionFactory
createSession
in interface ClientSessionFactory
HornetQException
- if an exception occurs while creating the sessionpublic ClientSession createSession(boolean autoCommitSends, boolean autoCommitAcks) throws HornetQException
ClientSessionFactory
createSession
in interface ClientSessionFactory
autoCommitSends
- true
to automatically commit message sends, false
to commit manuallyautoCommitAcks
- true
to automatically commit message acknowledgement, false
to commit manuallyHornetQException
- if an exception occurs while creating the sessionpublic ClientSession createSession(boolean xa, boolean autoCommitSends, boolean autoCommitAcks) throws HornetQException
ClientSessionFactory
createSession
in interface ClientSessionFactory
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 manuallyHornetQException
- if an exception occurs while creating the sessionpublic ClientSession createSession(boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge) throws HornetQException
ClientSessionFactory
createSession
in interface ClientSessionFactory
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 messagesHornetQException
- if an exception occurs while creating the sessionpublic void connectionCreated(Acceptor acceptor, Connection connection, ProtocolType protocol)
ConnectionLifeCycleListener
connectionCreated
in interface ConnectionLifeCycleListener
connection
- the connection that has been createdpublic void connectionDestroyed(Object connectionID)
ConnectionLifeCycleListener
connectionDestroyed
in interface ConnectionLifeCycleListener
connectionID
- the connection being destroyed.public void connectionException(Object connectionID, HornetQException me)
ConnectionLifeCycleListener
connectionException
in interface ConnectionLifeCycleListener
connectionID
- the id of the connection.me
- the exception.public void removeSession(ClientSessionInternal session, boolean failingOver)
removeSession
in interface ClientSessionFactoryInternal
public void connectionReadyForWrites(Object connectionID, boolean ready)
connectionReadyForWrites
in interface ConnectionLifeCycleListener
public int numConnections()
numConnections
in interface ClientSessionFactoryInternal
public int numSessions()
numSessions
in interface ClientSessionFactoryInternal
public void addFailureListener(SessionFailureListener listener)
addFailureListener
in interface ClientSessionFactoryInternal
public boolean removeFailureListener(SessionFailureListener listener)
removeFailureListener
in interface ClientSessionFactoryInternal
public void causeExit()
causeExit
in interface ClientSessionFactoryInternal
public void close()
close
in interface ClientSessionFactory
public void cleanup()
ClientSessionFactory
cleanup
in interface ClientSessionFactory
public boolean isClosed()
isClosed
in interface ClientSessionFactory
public ServerLocator getServerLocator()
getServerLocator
in interface ClientSessionFactory
public void stopPingingAfterOne()
public void resumePinging()
public CoreRemotingConnection getConnection()
getConnection
in interface ClientSessionFactory
public void sendNodeAnnounce(long currentEventID, String nodeID, boolean isBackup, TransportConfiguration config, TransportConfiguration backupConfig)
sendNodeAnnounce
in interface ClientSessionFactoryInternal
channel0
- public void finalize() throws Throwable
public void setReconnectAttempts(int attempts)
setReconnectAttempts
in interface ClientSessionFactoryInternal
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.