Class WmClusterConnectionImpl
- java.lang.Object
-
- com.webmethods.locks.Node
-
- com.webmethods.jms.impl.WmConnectionImpl
-
- com.webmethods.jms.loadbalance.connection.WmClusterConnectionImpl
-
- All Implemented Interfaces:
WmClusterTrackable
,WmConnection
,javax.jms.Connection
- Direct Known Subclasses:
WmClusterQueueConnectionImpl
,WmClusterTopicConnectionImpl
,WmClusterXAConnectionImpl
,WmCompositeClusterConnectionImpl
public class WmClusterConnectionImpl extends WmConnectionImpl implements WmClusterTrackable
WmClusterConnectionImpl implements the logic of a cluster connection, which is an aggregation of a set of JMS connections. Each of this JMS connection is encapsulated in a WmClusterConnectionWorker class.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.concurrent.ConcurrentHashMap<java.lang.String,WmConnectionImpl>
connections
static java.lang.String
DATE_FORMAT_NOW
protected WmClusterPolicy
policy
-
Fields inherited from class com.webmethods.jms.impl.WmConnectionImpl
_accessLabelHint, _brokerURLs, _clientID, _closeClusterConnection, _closed, _closeInProgress, _exceptionListener, _exceptionListenerCalledOnce, _factory, _isXA, _isXACloseCalled, _logApi, _password, _protocolHandler, _sessions, _setClientIDProhibited, _started, _uniqueID, _username, AUTO_RECONNECT, connectionStatus, isSSLEnabled, NO_RECONNECT, RECONNECT
-
Fields inherited from class com.webmethods.locks.Node
_lockManager
-
Fields inherited from interface com.webmethods.jms.WmConnection
ENCRYPT_LEVEL_ENCRYPTION, ENCRYPT_LEVEL_NO_ENCRYPTION, ENCRYPT_LEVEL_US_DOMESTIC, ENCRYPT_LEVEL_US_EXPORT
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
WmClusterConnectionImpl()
WmClusterConnectionImpl(WmConnectionFactoryImpl factory, java.lang.String username, java.lang.String password, boolean isXA)
Protected constructor.WmClusterConnectionImpl(WmConnectionFactoryImpl factory, java.lang.String username, java.lang.String password, java.lang.String accessLabelHint, boolean isXA)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
canPublish(javax.jms.Destination destination)
void
close()
Closes the connection.void
close1PCLog()
Close the 1PC transaction log...javax.jms.ConnectionConsumer
createConnectionConsumer(javax.jms.Destination destination, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages)
Creates a connection consumer for this connection (optional operation).javax.jms.ConnectionConsumer
createConnectionConsumer(javax.jms.Queue queue, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages)
Creates a connection consumer for this connection (optional operation).javax.jms.ConnectionConsumer
createConnectionConsumer(javax.jms.Topic topic, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages)
Creates a connection consumer for this connection (optional operation).javax.jms.ConnectionConsumer
createDurableConnectionConsumer(javax.jms.Topic topic, java.lang.String subscriptionName, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages)
Create a durable connection consumer for this connection (optional operation).javax.jms.QueueSession
createQueueSession(boolean transacted, int acknowledgeMode)
Creates aQueueSession
object.javax.jms.Session
createSession(boolean transacted, int acknowledgeMode)
Overwrites the WmConnectionImpl behavior to create a cluster session.javax.jms.TopicSession
createTopicSession(boolean transacted, int acknowledgeMode)
Creates aTopicSession
object.void
createWeightedRRList()
javax.jms.XAQueueSession
createXAQueueSession()
Creates anXAQueueSession
object.javax.jms.XAQueueSession
createXAQueueSession(java.lang.String brokerURL)
Creates anXAQueueSession
object.javax.jms.XASession
createXASession()
Creates anXASession
object.javax.jms.XASession
createXASession(java.lang.String brokerURL)
Creates anXASession
object.javax.jms.XATopicSession
createXATopicSession()
Creates anXATopicSession
object.javax.jms.XATopicSession
createXATopicSession(java.lang.String brokerURL)
Creates anXATopicSession
object.java.util.concurrent.CopyOnWriteArrayList<java.lang.String>
getAllBrokersInCluster()
java.lang.String
getBroker()
Get the Broker to which this connection is currently connected.java.util.concurrent.CopyOnWriteArrayList<java.lang.String>
getBrokerCluster()
java.lang.String
getClusterConnectionId()
WmConnectionFactoryImpl
getConnectionFactory()
java.util.Iterator<WmConnectionImpl>
getConnectionList()
int
getCurrentBrokerIndex()
javax.jms.ExceptionListener
getExceptionListener()
Gets theExceptionListener
object for this connection.javax.jms.ConnectionMetaData
getMetaData()
Gets the metadata for this connection.int
getMultiSendBEIndex()
int[]
getMultiSendBESeeder()
java.lang.String
getNextBrokerToPublish()
protected WmClusterConnectionWorker
getNextWorker()
WmNotificationListener
getNotificationListener()
Gets theNotificationListener
object for this connection.protected WmClusterPolicy
getPolicy()
int
getPublishProcessState()
java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.Integer>
getWeightedMap()
java.util.concurrent.CopyOnWriteArrayList<java.lang.String>
getWeigthRRBrokers()
WmClusterConnectionWorker
getWorker(java.lang.String brokerUrl)
java.io.Writer
getWriter()
void
invokeExceptionListener(java.lang.Exception exception)
void
markForClosure(boolean exceptionOccurred)
Marks the connection for closure.void
open1PCLog()
Open a writer to the 1PC log.void
ping()
Pings the brokers in the cluster to determine if there is network connectivity.protected void
removeSession(WmSessionImpl session)
void
setClientID(java.lang.String clientID)
Sets the client identifier for this connection.void
setClusterConnectionId(java.lang.String clusterConnectionId)
void
setExceptionListener(javax.jms.ExceptionListener listener)
Sets an exception listener for this cluster connection.void
setMultiSendBEIndex(int index)
void
setMultiSendBESeeder(int[] seeder)
void
setNotificationListener(WmNotificationListener listener)
Sets an notification listener for this connection.void
setParentConnection(WmCompositeClusterConnectionImpl parentConnection)
void
setTracker(WmClusterTracker tracker)
Assign a tracking tool or database application to store track records.void
setTrackerCategories(java.lang.String[] enabledCategories)
Configure a set of tracking types.void
start()
Starts (or restarts) this cluster connection's delivery of incoming messages.void
stop()
Temporarily stops a connection's delivery of incoming messages.void
write1PCLog(java.lang.String message)
Write the 1pC transaction log message to the file.-
Methods inherited from class com.webmethods.jms.impl.WmConnectionImpl
acknowledgeModeToString, addConnectionConsumer, addSession, addTemporaryDestination, checkLocalQueue, checkState, closeSessions, commit, commit, containsTemporaryDestination, endTransaction, forget, getAccessLabel, getBrokerName, getClientID, getClientIDUnsafe, getConnectionStatus, getDurableSubscriber, getFactory, getMarshalIn, getMarshalInUserData, getMarshalOut, getMarshalOutUserData, getMessageFactory, getSSLEncryptionLevel, getSSLServerCertificate, getTemporaryDestinations, getTerritory, getUniqueID, getUserName, initConnection, initializeConnection, initializeReceiver, initializeSubscriber, initKeepAliveThread, invokeNotificationListener, isClosed, isSSLEnabled, isStarted, isTransactionCompleted, prepare, prepare, publish, publish, publish, publish, recover, removeConnectionConsumer, removeTemporaryDestination, rollback, rollback, sendKeepAliveResponse, setConnectionStatus, setParentConnection, setSSLEnabled, startSessions, startTransaction, startTransaction, startTransaction, stopSessions, toString, unsubscribeDurableSubscriber
-
Methods inherited from class com.webmethods.locks.Node
getLockManager, getParent
-
-
-
-
Field Detail
-
connections
protected java.util.concurrent.ConcurrentHashMap<java.lang.String,WmConnectionImpl> connections
-
policy
protected WmClusterPolicy policy
-
DATE_FORMAT_NOW
public static final java.lang.String DATE_FORMAT_NOW
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WmClusterConnectionImpl
public WmClusterConnectionImpl(WmConnectionFactoryImpl factory, java.lang.String username, java.lang.String password, boolean isXA) throws javax.jms.JMSException
Protected constructor.- Parameters:
factory
- the factory that created this connectionusername
- the caller's user namepassword
- the caller's password- Throws:
javax.jms.JMSException
-
WmClusterConnectionImpl
protected WmClusterConnectionImpl()
-
WmClusterConnectionImpl
public WmClusterConnectionImpl(WmConnectionFactoryImpl factory, java.lang.String username, java.lang.String password, java.lang.String accessLabelHint, boolean isXA) throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
-
-
Method Detail
-
setParentConnection
public void setParentConnection(WmCompositeClusterConnectionImpl parentConnection)
-
getMultiSendBEIndex
public int getMultiSendBEIndex()
-
setMultiSendBEIndex
public void setMultiSendBEIndex(int index)
-
getMultiSendBESeeder
public int[] getMultiSendBESeeder()
-
setMultiSendBESeeder
public void setMultiSendBESeeder(int[] seeder)
-
getPolicy
protected WmClusterPolicy getPolicy() throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
-
setTrackerCategories
public void setTrackerCategories(java.lang.String[] enabledCategories)
Configure a set of tracking types.- Specified by:
setTrackerCategories
in interfaceWmClusterTrackable
- Parameters:
enabledCategories
- name of the action type to be tracked
-
setTracker
public void setTracker(WmClusterTracker tracker)
Assign a tracking tool or database application to store track records.- Specified by:
setTracker
in interfaceWmClusterTrackable
- Parameters:
tracker
-
-
getBrokerCluster
public java.util.concurrent.CopyOnWriteArrayList<java.lang.String> getBrokerCluster()
-
getAllBrokersInCluster
public java.util.concurrent.CopyOnWriteArrayList<java.lang.String> getAllBrokersInCluster()
-
getNextBrokerToPublish
public java.lang.String getNextBrokerToPublish() throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
-
getCurrentBrokerIndex
public int getCurrentBrokerIndex()
-
getNextWorker
protected WmClusterConnectionWorker getNextWorker() throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
-
getConnectionFactory
public WmConnectionFactoryImpl getConnectionFactory()
-
getConnectionList
public java.util.Iterator<WmConnectionImpl> getConnectionList()
-
getWorker
public WmClusterConnectionWorker getWorker(java.lang.String brokerUrl)
-
setClientID
public void setClientID(java.lang.String clientID) throws javax.jms.JMSException
Sets the client identifier for this connection.- Specified by:
setClientID
in interfacejavax.jms.Connection
- Overrides:
setClientID
in classWmConnectionImpl
- Parameters:
clientID
- the unique client identifier- Throws:
javax.jms.JMSException
- if the JMS provider fails to set the client ID for this connection due to some internal error.javax.jms.InvalidClientIDException
- if the JMS client specifies an invalid or duplicate client ID.javax.jms.IllegalStateException
- if the JMS client attempts to set a connection's client ID at the wrong time or when it has been administratively configured.
-
start
public void start() throws javax.jms.JMSException
Starts (or restarts) this cluster connection's delivery of incoming messages.- Specified by:
start
in interfacejavax.jms.Connection
- Overrides:
start
in classWmConnectionImpl
- Throws:
javax.jms.JMSException
- if the JMS provider fails to start message delivery due to some internal error.
-
stop
public void stop() throws javax.jms.JMSException
Temporarily stops a connection's delivery of incoming messages.- Specified by:
stop
in interfacejavax.jms.Connection
- Overrides:
stop
in classWmConnectionImpl
- Throws:
javax.jms.JMSException
-
invokeExceptionListener
public void invokeExceptionListener(java.lang.Exception exception)
- Overrides:
invokeExceptionListener
in classWmConnectionImpl
-
markForClosure
public void markForClosure(boolean exceptionOccurred) throws javax.jms.JMSException
Marks the connection for closure.- Overrides:
markForClosure
in classWmConnectionImpl
- Throws:
javax.jms.JMSException
-
close
public void close() throws javax.jms.JMSException
Closes the connection.- Specified by:
close
in interfacejavax.jms.Connection
- Overrides:
close
in classWmConnectionImpl
- Throws:
javax.jms.JMSException
- if the JMS provider fails to close the connection due to some internal error. For example, a failure to release resources or to close a socket connection can cause this exception to be thrown.
-
removeSession
protected void removeSession(WmSessionImpl session)
- Overrides:
removeSession
in classWmConnectionImpl
-
createSession
public javax.jms.Session createSession(boolean transacted, int acknowledgeMode) throws javax.jms.JMSException
Overwrites the WmConnectionImpl behavior to create a cluster session.- Specified by:
createSession
in interfacejavax.jms.Connection
- Overrides:
createSession
in classWmConnectionImpl
- Parameters:
transacted
- indicates whether the session is transactedacknowledgeMode
- indicates whether the consumer or the client will acknowledge any messages it receives; ignored if the session is transacted. Legal values areSession.AUTO_ACKNOWLEDGE
,Session.CLIENT_ACKNOWLEDGE
, andSession.DUPS_OK_ACKNOWLEDGE
.- Returns:
- a newly created session
- Throws:
javax.jms.JMSException
- if theConnection
object fails to create a session due to some internal error or lack of support for the specific transaction and acknowledgement mode.
-
createXASession
public javax.jms.XASession createXASession() throws javax.jms.JMSException
Creates anXASession
object.- Overrides:
createXASession
in classWmConnectionImpl
- Returns:
- a newly created
XASession
- Throws:
javax.jms.JMSException
- if theXAConnection
object fails to create anXASession
due to some internal error.
-
createXASession
public javax.jms.XASession createXASession(java.lang.String brokerURL) throws javax.jms.JMSException
Creates anXASession
object. This method is used only for recovery purposes.- Parameters:
brokerURL
- url pointing to the underlying broker.- Returns:
- a newly created
XASession
- Throws:
javax.jms.JMSException
- if theXAConnection
object fails to create anXASession
due to some internal error.
-
createTopicSession
public javax.jms.TopicSession createTopicSession(boolean transacted, int acknowledgeMode) throws javax.jms.JMSException
Creates aTopicSession
object.- Overrides:
createTopicSession
in classWmConnectionImpl
- Parameters:
transacted
- indicates whether the session is transactedacknowledgeMode
- indicates whether the consumer or the client will acknowledge any messages it receives; ignored if the session is transacted. Legal values areSession.AUTO_ACKNOWLEDGE
,Session.CLIENT_ACKNOWLEDGE
, andSession.DUPS_OK_ACKNOWLEDGE
.- Returns:
- a newly created topic session
- Throws:
javax.jms.JMSException
- if theTopicConnection
object fails to create a session due to some internal error or lack of support for the specific transaction and acknowledgement mode.
-
createXATopicSession
public javax.jms.XATopicSession createXATopicSession() throws javax.jms.JMSException
Creates anXATopicSession
object.- Overrides:
createXATopicSession
in classWmConnectionImpl
- Returns:
- a newly created XA topic session
- Throws:
javax.jms.JMSException
- if theXATopicConnection
object fails to create an XA topic session due to some internal error.
-
createXATopicSession
public javax.jms.XATopicSession createXATopicSession(java.lang.String brokerURL) throws javax.jms.JMSException
Creates anXATopicSession
object. This method is used only for the purpose of transaction recovery.- Parameters:
brokerURL
- url pointing to the underlying broker.- Returns:
- a newly created XA topic session
- Throws:
javax.jms.JMSException
- if theXATopicConnection
object fails to create an XA topic session due to some internal error.
-
createQueueSession
public javax.jms.QueueSession createQueueSession(boolean transacted, int acknowledgeMode) throws javax.jms.JMSException
Creates aQueueSession
object.- Overrides:
createQueueSession
in classWmConnectionImpl
- Parameters:
transacted
- indicates whether the session is transactedacknowledgeMode
- indicates whether the consumer or the client will acknowledge any messages it receives; ignored if the session is transacted. Legal values areSession.AUTO_ACKNOWLEDGE
,Session.CLIENT_ACKNOWLEDGE
, andSession.DUPS_OK_ACKNOWLEDGE
.- Returns:
- a newly created queue session
- Throws:
javax.jms.JMSException
- if theQueueConnection
object fails to create a session due to some internal error or lack of support for the specific transaction and acknowledgement mode.
-
createXAQueueSession
public javax.jms.XAQueueSession createXAQueueSession() throws javax.jms.JMSException
Creates anXAQueueSession
object.- Overrides:
createXAQueueSession
in classWmConnectionImpl
- Returns:
- a newly created
XAQueueSession
- Throws:
javax.jms.JMSException
- if theXAQueueConnection
object fails to create an XA queue session due to some internal error.
-
createXAQueueSession
public javax.jms.XAQueueSession createXAQueueSession(java.lang.String brokerURL) throws javax.jms.JMSException
Creates anXAQueueSession
object.- Parameters:
brokerURL
- - url pointing to the underlying broker.- Returns:
- a newly created
XAQueueSession
- Throws:
javax.jms.JMSException
- if theXAQueueConnection
object fails to create an XA queue session due to some internal error.
-
ping
public void ping() throws javax.jms.JMSException
Pings the brokers in the cluster to determine if there is network connectivity.- Specified by:
ping
in interfaceWmConnection
- Overrides:
ping
in classWmConnectionImpl
- Throws:
javax.jms.JMSException
- if the JMS provider fails to ping the Broker
-
canPublish
public void canPublish(javax.jms.Destination destination) throws javax.jms.JMSException
- Overrides:
canPublish
in classWmConnectionImpl
- Throws:
javax.jms.JMSException
-
getBroker
public java.lang.String getBroker()
Description copied from class:WmConnectionImpl
Get the Broker to which this connection is currently connected.- Specified by:
getBroker
in interfaceWmConnection
- Overrides:
getBroker
in classWmConnectionImpl
- Returns:
- the Broker name
-
createWeightedRRList
public void createWeightedRRList() throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
-
getWeigthRRBrokers
public java.util.concurrent.CopyOnWriteArrayList<java.lang.String> getWeigthRRBrokers()
-
getWeightedMap
public java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.Integer> getWeightedMap()
-
getClusterConnectionId
public java.lang.String getClusterConnectionId()
-
setClusterConnectionId
public void setClusterConnectionId(java.lang.String clusterConnectionId)
-
createDurableConnectionConsumer
public javax.jms.ConnectionConsumer createDurableConnectionConsumer(javax.jms.Topic topic, java.lang.String subscriptionName, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages) throws javax.jms.JMSException
Description copied from class:WmConnectionImpl
Create a durable connection consumer for this connection (optional operation). This is an expert facility not used by regular JMS clients.- Specified by:
createDurableConnectionConsumer
in interfacejavax.jms.Connection
- Overrides:
createDurableConnectionConsumer
in classWmConnectionImpl
- Parameters:
topic
- topic to accesssubscriptionName
- durable subscription namemessageSelector
- only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.sessionPool
- the server session pool to associate with this durable connection consumermaxMessages
- the maximum number of messages that can be assigned to a server session at one time- Returns:
- the durable connection consumer
- Throws:
javax.jms.JMSException
- if theConnection
object fails to create a connection consumer due to some internal error or invalid arguments forsessionPool
andmessageSelector
.javax.jms.InvalidDestinationException
- if an invalid destination is specified.javax.jms.InvalidSelectorException
- if the message selector is invalid.
-
createConnectionConsumer
public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Queue queue, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages) throws javax.jms.JMSException
Description copied from class:WmConnectionImpl
Creates a connection consumer for this connection (optional operation). This is an expert facility not used by regular JMS clients.- Overrides:
createConnectionConsumer
in classWmConnectionImpl
- Parameters:
queue
- the queue to accessmessageSelector
- only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.sessionPool
- the server session pool to associate with this connection consumermaxMessages
- the maximum number of messages that can be assigned to a server session at one time- Returns:
- the connection consumer
- Throws:
javax.jms.JMSException
- if theQueueConnection
object fails to create a connection consumer due to some internal error or invalid arguments forsessionPool
andmessageSelector
.javax.jms.InvalidDestinationException
- if an invalid queue is specified.javax.jms.InvalidSelectorException
- if the message selector is invalid.
-
createConnectionConsumer
public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Topic topic, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages) throws javax.jms.JMSException
Description copied from class:WmConnectionImpl
Creates a connection consumer for this connection (optional operation). This is an expert facility not used by regular JMS clients.- Overrides:
createConnectionConsumer
in classWmConnectionImpl
- Parameters:
topic
- the topic to accessmessageSelector
- only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.sessionPool
- the server session pool to associate with this connection consumermaxMessages
- the maximum number of messages that can be assigned to a server session at one time- Returns:
- the connection consumer
- Throws:
javax.jms.JMSException
- if theTopicConnection
object fails to create a connection consumer due to some internal error or invalid arguments forsessionPool
andmessageSelector
.javax.jms.InvalidDestinationException
- if an invalid topic is specified.javax.jms.InvalidSelectorException
- if the message selector is invalid.
-
createConnectionConsumer
public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Destination destination, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages) throws javax.jms.JMSException
Creates a connection consumer for this connection (optional operation). This is an expert facility not used by regular JMS clients.- Specified by:
createConnectionConsumer
in interfacejavax.jms.Connection
- Overrides:
createConnectionConsumer
in classWmConnectionImpl
- Parameters:
destination
- the destination to accessmessageSelector
- only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.sessionPool
- the server session pool to associate with this connection consumermaxMessages
- the maximum number of messages that can be assigned to a server session at one time- Returns:
- the connection consumer
- Throws:
javax.jms.JMSException
- if theConnection
object fails to create a connection consumer due to some internal error or invalid arguments forsessionPool
andmessageSelector
.javax.jms.InvalidDestinationException
- if an invalid destination is specified.javax.jms.InvalidSelectorException
- if the message selector is invalid.
-
getNotificationListener
public WmNotificationListener getNotificationListener() throws javax.jms.JMSException
Description copied from class:WmConnectionImpl
Gets theNotificationListener
object for this connection. Not everyConnection
has anNotificationListener
associated with it.- Overrides:
getNotificationListener
in classWmConnectionImpl
- Returns:
- the
NotificationListener
for this connection, or null. if noNotificationListener
is associated with this connection. - Throws:
javax.jms.JMSException
- if the JMS provider fails to get theNotificationListener
for this connection.
-
setNotificationListener
public void setNotificationListener(WmNotificationListener listener) throws javax.jms.JMSException
Sets an notification listener for this connection.An notification listener allows a client to be notified of a problem asynchronously. Some connections only consume messages, so they would have no other way to learn their connection has failed.
A connection serializes execution of its
ExceptionListener
.A JMS provider should attempt to resolve connection problems itself before it notifies the client of them.
- Overrides:
setNotificationListener
in classWmConnectionImpl
- Parameters:
listener
- the exception listener- Throws:
javax.jms.JMSException
- if the JMS provider fails to set the exception listener for this connection.
-
getMetaData
public javax.jms.ConnectionMetaData getMetaData() throws javax.jms.JMSException
Description copied from class:WmConnectionImpl
Gets the metadata for this connection.- Specified by:
getMetaData
in interfacejavax.jms.Connection
- Overrides:
getMetaData
in classWmConnectionImpl
- Returns:
- the connection metadata
- Throws:
javax.jms.JMSException
- if the JMS provider fails to get the connection metadata for this connection.
-
getExceptionListener
public javax.jms.ExceptionListener getExceptionListener() throws javax.jms.JMSException
Description copied from class:WmConnectionImpl
Gets theExceptionListener
object for this connection. Not everyConnection
has anExceptionListener
associated with it.- Specified by:
getExceptionListener
in interfacejavax.jms.Connection
- Overrides:
getExceptionListener
in classWmConnectionImpl
- Returns:
- the
ExceptionListener
for this connection, or null. if noExceptionListener
is associated with this connection. - Throws:
javax.jms.JMSException
- if the JMS provider fails to get theExceptionListener
for this connection.
-
setExceptionListener
public void setExceptionListener(javax.jms.ExceptionListener listener) throws javax.jms.JMSException
Sets an exception listener for this cluster connection.If a JMS provider detects a serious problem with a connection, it informs the connection's
ExceptionListener
, if one has been registered. It does this by calling the listener'sonException
method, passing it aJMSException
object describing the problem.An exception listener allows a client to be notified of a problem asynchronously. Some connections only consume messages, so they would have no other way to learn their connection has failed.
A connection serializes execution of its
ExceptionListener
.A JMS provider should attempt to resolve connection problems itself before it notifies the client of them.
- Specified by:
setExceptionListener
in interfacejavax.jms.Connection
- Overrides:
setExceptionListener
in classWmConnectionImpl
- Parameters:
listener
- the exception listener- Throws:
javax.jms.JMSException
- if the JMS provider fails to set the exception listener for this connection.
-
getPublishProcessState
public int getPublishProcessState() throws javax.jms.JMSException
- Overrides:
getPublishProcessState
in classWmConnectionImpl
- Throws:
javax.jms.JMSException
-
open1PCLog
public void open1PCLog()
Open a writer to the 1PC log.
-
write1PCLog
public void write1PCLog(java.lang.String message)
Write the 1pC transaction log message to the file.
-
close1PCLog
public void close1PCLog()
Close the 1PC transaction log...
-
getWriter
public java.io.Writer getWriter()
-
-