|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.exolab.jms.client.JmsConnection | +--org.exolab.jms.client.JmsTopicConnection | +--org.exolab.jms.client.JmsXATopicConnection
Client implementation of the javax.jms.XATopicConnection
interface.
Constructor Summary | |
JmsXATopicConnection(JmsXAConnectionFactory factory,
java.lang.String id,
java.lang.String username,
java.lang.String password)
Construct a new JmsXATopicConnection . |
Method Summary | |
protected void |
addSession(org.exolab.jms.client.JmsSession session)
Add the specified session to the list of managed sessions. |
void |
close()
Closes the connection. |
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.Topic topic,
java.lang.String selector,
javax.jms.ServerSessionPool pool,
int maxMessages)
Create a connection consumer for this connection. |
javax.jms.ConnectionConsumer |
createDurableConnectionConsumer(javax.jms.Topic topic,
java.lang.String subscriptionName,
java.lang.String selector,
javax.jms.ServerSessionPool pool,
int maxMessages)
Create a durable connection consumer for this connection. |
javax.jms.Session |
createSession(boolean transacted,
int acknowledgeMode)
Creates a Session object. |
javax.jms.TopicSession |
createTopicSession(boolean transacted,
int acknowledgeMode)
Creates an XATopicSession object. |
javax.jms.XASession |
createXASession()
Creates an XASession object. |
javax.jms.XATopicSession |
createXATopicSession()
Creates an XATopicSession object. |
protected void |
deleteTemporaryDestination(JmsDestination destination)
Delete the temporary destination and all the registered sessions consumers waiting to receive messages from this destination will be stopped. |
protected void |
ensureOpen()
Verifies that the connection is open. |
java.lang.String |
getClientID()
Gets the client identifier for this connection. |
long |
getConnectionId()
Returns the connection identifier. |
javax.jms.ExceptionListener |
getExceptionListener()
Returns the ExceptionListener for this connection. |
javax.jms.ConnectionMetaData |
getMetaData()
Returns the metadata for this connection. |
protected ServerConnection |
getServerConnection()
Returns the server connection. |
protected boolean |
isStopped()
Returns the running state of the connection. |
void |
notifyExceptionListener(javax.jms.JMSException message)
Notify the exception listener of a JMSException. |
protected void |
removeSession(org.exolab.jms.client.JmsSession session)
Remove the specified session from the list of managed sessions. |
void |
setClientID(java.lang.String clientID)
Sets the client identifier for this connection. |
void |
setExceptionListener(javax.jms.ExceptionListener listener)
Sets an exception listener for this connection. |
protected void |
setModified()
Flags this connection as being modified. |
void |
start()
Starts (or restarts) a connection's delivery of incoming messages. |
void |
stop()
Temporarily stops a connection's delivery of incoming messages. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.jms.XAConnection |
createSession |
Methods inherited from interface javax.jms.Connection |
close, createConnectionConsumer, createDurableConnectionConsumer, getClientID, getExceptionListener, getMetaData, setClientID, setExceptionListener, start, stop |
Methods inherited from interface javax.jms.TopicConnection |
createConnectionConsumer, createDurableConnectionConsumer |
Constructor Detail |
public JmsXATopicConnection(JmsXAConnectionFactory factory, java.lang.String id, java.lang.String username, java.lang.String password) throws javax.jms.JMSException
JmsXATopicConnection
.factory
- factory creating this objectid
- the connection identifierusername
- client usernamepassword
- client passwordjavax.jms.JMSException
- if there is any problem creating this objectMethod Detail |
public javax.jms.XASession createXASession() throws javax.jms.JMSException
XASession
object.createXASession
in interface javax.jms.XAConnection
XASession
javax.jms.JMSException
- if the XAConnection
object fails to
create an XASession
due to some
internal error.public javax.jms.XATopicSession createXATopicSession() throws javax.jms.JMSException
XATopicSession
object.createXATopicSession
in interface javax.jms.XATopicConnection
XATopicSession
javax.jms.JMSException
- if the XATopicConnection
object fails
to create an XA queue session due to some internal
error.public javax.jms.TopicSession createTopicSession(boolean transacted, int acknowledgeMode) throws javax.jms.JMSException
XATopicSession
object.createTopicSession
in interface javax.jms.XATopicConnection
createTopicSession
in class org.exolab.jms.client.JmsTopicConnection
transacted
- usage undefinedacknowledgeMode
- usage undefinedXATopicSession
javax.jms.JMSException
- if the XATopicConnection
object fails
to create an XA queue session due to some internal
error.public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Topic topic, java.lang.String selector, javax.jms.ServerSessionPool pool, int maxMessages) throws javax.jms.JMSException
createConnectionConsumer
in interface javax.jms.TopicConnection
topic
- the topic to accessselector
- the message selector. May be null
pool
- the server session pool to associate with the
consumermaxMessages
- the maximum number of messages that can be assigned to
a server session at one timejavax.jms.InvalidSelectorException
- if the message selector is invalidjavax.jms.JMSException
- if the connection consumer cannot be
createdpublic javax.jms.ConnectionConsumer createDurableConnectionConsumer(javax.jms.Topic topic, java.lang.String subscriptionName, java.lang.String selector, javax.jms.ServerSessionPool pool, int maxMessages) throws javax.jms.JMSException
createDurableConnectionConsumer
in interface javax.jms.TopicConnection
createDurableConnectionConsumer
in class org.exolab.jms.client.JmsConnection
topic
- the topic to accesssubscriptionName
- the durable subscription nameselector
- the message selector. May be null
pool
- the server session pool to associate with the
consumermaxMessages
- the maximum number of messages that can be
assigned to a server session at one timejavax.jms.InvalidSelectorException
- if the message selector is invalidjavax.jms.JMSException
- if the connection consumer cannot be
createdpublic long getConnectionId()
public java.lang.String getClientID() throws javax.jms.JMSException
getClientID
in interface javax.jms.Connection
javax.jms.JMSException
- if the JMS provider fails to return the client ID
for this connection due to some internal error.public void setClientID(java.lang.String clientID) throws javax.jms.JMSException
setClientID
in interface javax.jms.Connection
clientID
- the unique client identifierjavax.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.public javax.jms.ConnectionMetaData getMetaData() throws javax.jms.JMSException
getMetaData
in interface javax.jms.Connection
javax.jms.JMSException
- if the JMS provider fails to get the connection
metadata for this connection.public javax.jms.ExceptionListener getExceptionListener() throws javax.jms.JMSException
ExceptionListener
for this connection.getExceptionListener
in interface javax.jms.Connection
ExceptionListener
for this connection, or
null
if none is associated with this connection.javax.jms.JMSException
- if the JMS provider fails to get the
ExceptionListener
for this connection.public void setExceptionListener(javax.jms.ExceptionListener listener) throws javax.jms.JMSException
setExceptionListener
in interface javax.jms.Connection
listener
- the exception listenerjavax.jms.JMSException
- if the JMS provider fails to set the exception
listener for this connection.public void notifyExceptionListener(javax.jms.JMSException message)
message
- message to deliverpublic void start() throws javax.jms.JMSException
start
on a connection that has already been started is
ignored.start
in interface javax.jms.Connection
javax.jms.JMSException
- if the JMS provider fails to start message delivery
due to some internal error.public void stop() throws javax.jms.JMSException
start
method. When
the connection is stopped, delivery to all the connection's message
consumers is inhibited: synchronous receives block, and messages are not
delivered to message listeners.
This call blocks until receives and/or message listeners in progress have completed.
Stopping a connection has no effect on its ability to send messages. A
call to stop
on a connection that has already been stopped
is ignored.
stop
in interface javax.jms.Connection
javax.jms.JMSException
- if the JMS provider fails to stop message delivery
due to some internal error.public void close() throws javax.jms.JMSException
When this method is invoked, it should not return until message
processing has been shut down in an orderly fashion. This means that all
message listeners that may have been running have returned, and that all
pending receives have returned. A close terminates all pending message
receives on the connection's sessions' consumers. The receives may return
with a message or with null, depending on whether there was a message
available at the time of the close. If one or more of the connection's
sessions' message listeners is processing a message at the time when
connection close
is invoked, all the facilities of the
connection and its sessions must remain available to those listeners
until they return control to the JMS provider.
Closing a connection causes any of its sessions' transactions in
progress to be rolled back. In the case where a session's work is
coordinated by an external transaction manager, a session's
commit
and rollback
methods are not used and
the result of a closed session's work is determined later by the
transaction manager.
Invoking the acknowledge
method of a received message
from a closed connection's session must throw an
IllegalStateException
.
Closing a closed connection must NOT throw an exception.
close
in interface javax.jms.Connection
javax.jms.JMSException
- if the JMS provider fails to close the connection
due to some internal error.public javax.jms.Session createSession(boolean transacted, int acknowledgeMode) throws javax.jms.JMSException
Session
object.createSession
in interface javax.jms.Connection
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 are
Session.AUTO_ACKNOWLEDGE
,
Session.CLIENT_ACKNOWLEDGE
, and
Session.DUPS_OK_ACKNOWLEDGE
.javax.jms.JMSException
- if the Connection
object fails to
create a session due to some internal error or lack
of support for the specific transaction and
acknowledgement mode.Session.AUTO_ACKNOWLEDGE
,
Session.CLIENT_ACKNOWLEDGE
,
Session.DUPS_OK_ACKNOWLEDGE
public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Destination destination, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages) throws javax.jms.JMSException
createConnectionConsumer
in interface javax.jms.Connection
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 timejavax.jms.JMSException
- if the Connection
object fails to
create a connection consumer due to some internal
error or invalid arguments for
sessionPool
and
messageSelector
.javax.jms.InvalidDestinationException
- if an invalid destination is
specified.javax.jms.InvalidSelectorException
- if the message selector is invalid.protected ServerConnection getServerConnection() throws javax.jms.JMSException
javax.jms.JMSException
- if the connection is null
protected void addSession(org.exolab.jms.client.JmsSession session)
session
- session to registerprotected void removeSession(org.exolab.jms.client.JmsSession session)
session
- session to removeprotected boolean isStopped()
true
if stoppedprotected void setModified()
JmsConnection.setClientID(java.lang.String)
will result in an IllegalStateException
being thrown.protected void deleteTemporaryDestination(JmsDestination destination) throws javax.jms.JMSException
destination
- temporary destination to deletejavax.jms.JMSException
- protected void ensureOpen() throws javax.jms.IllegalStateException
javax.jms.IllegalStateException
- if the connection is closed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |