org.exolab.jms.client
Class JmsXATopicSession

java.lang.Object
  |
  +--org.exolab.jms.client.JmsSession
        |
        +--org.exolab.jms.client.JmsTopicSession
              |
              +--org.exolab.jms.client.JmsXATopicSession
All Implemented Interfaces:
JmsMessageListener, javax.jms.MessageListener, MessageSessionIfc, java.lang.Runnable, javax.jms.Session, javax.jms.TopicSession, javax.transaction.xa.XAResource, javax.jms.XASession, javax.jms.XATopicSession

public class JmsXATopicSession
extends org.exolab.jms.client.JmsTopicSession
implements javax.jms.XATopicSession, javax.transaction.xa.XAResource

Version:
$Revision: 1.4 $ $Date: 2003/08/07 13:32:51 $
Author:
Jim Alateras
See Also:
XATopicSession

Fields inherited from interface javax.jms.Session
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE
 
Fields inherited from interface javax.transaction.xa.XAResource
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
 
Method Summary
 void acknowledgeMessage(javax.jms.Message message)
          Acknowledge the specified message.
protected  void addConsumer(org.exolab.jms.client.JmsMessageConsumer consumer)
          Add a consumer to the list of consumers managed by this session
protected  void addMessage(javax.jms.Message message)
          Add a message to the message cache.
protected  void addProducer(org.exolab.jms.client.JmsMessageProducer producer)
          Add a producer to the list of producers managed by this session
protected  void addPublisher(org.exolab.jms.client.JmsTopicPublisher publisher)
          Register a publisher
protected  void addSubscriber(org.exolab.jms.client.JmsTopicSubscriber subscriber, java.lang.String name)
          Register a subscriber
protected  boolean checkForValidTemporaryDestination(JmsDestination destination)
          This method checks the destination.
 void close()
          Close the session.
 void commit()
          Commit all messages done in this transaction
 void commit(javax.transaction.xa.Xid xid, boolean onePhase)
           
 javax.jms.BytesMessage createBytesMessage()
          Create a BytesMessage
 javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, java.lang.String name)
          Create a durable subscriber for the specified topic
 javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, java.lang.String name, java.lang.String selector, boolean noLocal)
          Create a durable subscriber for the specified topic
 javax.jms.MapMessage createMapMessage()
          Create a MapMessage
 javax.jms.Message createMessage()
          Create a Message
 javax.jms.ObjectMessage createObjectMessage()
          Create an ObjectMessage
 javax.jms.ObjectMessage createObjectMessage(java.io.Serializable object)
          Create an ObjectMessage
 javax.jms.TopicPublisher createPublisher(javax.jms.Topic topic)
          Create a publisher for the specified topic.
 javax.jms.StreamMessage createStreamMessage()
          Create a StreamMessage
 javax.jms.TopicSubscriber createSubscriber(javax.jms.Topic topic)
          Create a non-durable subscriber for the specified topic
 javax.jms.TopicSubscriber createSubscriber(javax.jms.Topic topic, java.lang.String selector, boolean noLocal)
          Create a non-durable subscriber for the specified topic
 javax.jms.TemporaryTopic createTemporaryTopic()
          Create a temporary topic.
 javax.jms.TextMessage createTextMessage()
          Create a TextMessage
 javax.jms.TextMessage createTextMessage(java.lang.String text)
          Create a TextMessage
 javax.jms.Topic createTopic(java.lang.String topicName)
          Create a topic identity given its name
 void destroy()
          Release local resources used by this session object
 void enableAsynchronousDelivery(long clientId, java.lang.String id, boolean enable)
          Enable or disable asynchronous message delivery for the specified client.
 void end(javax.transaction.xa.Xid xid, int flags)
           
protected  void ensureOpen()
          Verifies that the session isn't closed
 void execute(java.lang.Object object)
          This is the called to process messages asynchronously delivered by the server.
 void forget(javax.transaction.xa.Xid xid)
           
 int getAckMode()
          Return the acknowledgement mode for the session
protected  org.exolab.jms.client.JmsConnection getConnection()
          Return a reference to the connection that created this session
protected  java.util.Enumeration getConsumers()
          Returns a list of registered consumers for the session
protected  JmsSessionStubIfc getJmsSessionStub()
          Return an instance of the remote stub.
 javax.jms.MessageListener getMessageListener()
          Returns the message listener associated with the session
protected  long getNextConsumerId()
          Returns the next seed value to be allocated to a new consumer
protected  java.util.Enumeration getProducers()
          Returns a list of registered producers for the session
 long getResourceManagerId()
          Return the identity of the associated resource manager.
 java.lang.String getSessionId()
          Returns the session identifier
 javax.jms.TopicSession getTopicSession()
           
 boolean getTransacted()
          Determines if the session is transacted
 int getTransactionTimeout()
           
 javax.transaction.xa.XAResource getXAResource()
           
protected  boolean isClosed()
          Check if the session is closed
 boolean isSameRM(javax.transaction.xa.XAResource xares)
           
 void onMessage(javax.jms.Message message)
          Asynchronously deliver a message to a MessageConsumer
 void onMessageAvailable(long clientId)
          Inform the session that there is a message available for the message consumer with the specified identity
 void onMessages(java.util.Vector messages)
          Asynchronously deliver a set of message to a MessageConsumer
 int prepare(javax.transaction.xa.Xid xid)
           
 void recover()
          Stop message delivery in this session, and restart sending messages with the oldest unacknowledged message
 javax.transaction.xa.Xid[] recover(int flag)
           
protected  void removeConsumer(org.exolab.jms.client.JmsMessageConsumer consumer)
          Remove the consumer with the specified id from the list of managed consumers
 void removeMessageListener(org.exolab.jms.client.JmsMessageConsumer listener)
          Remove a message listener
protected  void removeProducer(org.exolab.jms.client.JmsMessageProducer producer)
          Remove the producer from the list of managed producers
protected  void removePublisher(org.exolab.jms.client.JmsTopicPublisher publisher)
          Deregister a publisher
protected  void removeSubscriber(org.exolab.jms.client.JmsTopicSubscriber subscriber)
          Deregister azsubscriber
 javax.jms.Message retrieveMessage(long clientId, long wait)
          Fetch the next message for this client.
 java.util.Vector retrieveMessages(long clientId, int count)
          Fetch up to count messages from the endpoint.
 void rollback()
          Rollback any messages done in this transaction
 void rollback(javax.transaction.xa.Xid xid)
           
 void run()
          Iterates through the list of messages added by an JmsConnectionConsumer, sending them to the registered listener
protected  void sendMessage(javax.jms.Message message)
          Send the specified message to the server.
 void setMessageListener(org.exolab.jms.client.JmsMessageConsumer listener)
          Set the message listener for a particular consumer.
 void setMessageListener(javax.jms.MessageListener listener)
          Sets the session's message listener.
 boolean setTransactionTimeout(int seconds)
           
 void start()
          This will start message delivery to this session.
 void start(javax.transaction.xa.Xid xid, int flags)
           
 void stop()
          This will stop message delivery to this session.
 void unsubscribe(java.lang.String name)
          Unsubscribe a durable subscription.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jms.Session
close, createBytesMessage, createMapMessage, createMessage, createObjectMessage, createObjectMessage, createStreamMessage, createTextMessage, createTextMessage, getMessageListener, recover, run, setMessageListener
 

Method Detail

getTopicSession

public javax.jms.TopicSession getTopicSession()
                                       throws javax.jms.JMSException
Specified by:
getTopicSession in interface javax.jms.XATopicSession

getXAResource

public javax.transaction.xa.XAResource getXAResource()
Specified by:
getXAResource in interface javax.jms.XASession

getTransacted

public boolean getTransacted()
                      throws javax.jms.JMSException
Description copied from class: org.exolab.jms.client.JmsSession
Determines if the session is transacted
Specified by:
getTransacted in interface javax.jms.XASession
Overrides:
getTransacted in class org.exolab.jms.client.JmsSession
Following copied from class: org.exolab.jms.client.JmsSession
Returns:
true if the session is transacted
Throws:
javax.jms.JMSException - if the session is closed

commit

public void commit()
            throws javax.jms.JMSException
Description copied from class: org.exolab.jms.client.JmsSession
Commit all messages done in this transaction
Specified by:
commit in interface javax.jms.XASession
Overrides:
commit in class org.exolab.jms.client.JmsSession
Following copied from class: org.exolab.jms.client.JmsSession
Throws:
javax.jms.JMSException - if the transaction cannot be committed

rollback

public void rollback()
              throws javax.jms.JMSException
Description copied from class: org.exolab.jms.client.JmsSession
Rollback any messages done in this transaction
Specified by:
rollback in interface javax.jms.XASession
Overrides:
rollback in class org.exolab.jms.client.JmsSession
Following copied from class: org.exolab.jms.client.JmsSession
Throws:
javax.jms.JMSException - if the transaction cannot be rolled back

commit

public void commit(javax.transaction.xa.Xid xid,
                   boolean onePhase)
            throws javax.transaction.xa.XAException
Specified by:
commit in interface javax.transaction.xa.XAResource

end

public void end(javax.transaction.xa.Xid xid,
                int flags)
         throws javax.transaction.xa.XAException
Specified by:
end in interface javax.transaction.xa.XAResource

forget

public void forget(javax.transaction.xa.Xid xid)
            throws javax.transaction.xa.XAException
Specified by:
forget in interface javax.transaction.xa.XAResource

getTransactionTimeout

public int getTransactionTimeout()
                          throws javax.transaction.xa.XAException
Specified by:
getTransactionTimeout in interface javax.transaction.xa.XAResource

isSameRM

public boolean isSameRM(javax.transaction.xa.XAResource xares)
                 throws javax.transaction.xa.XAException
Specified by:
isSameRM in interface javax.transaction.xa.XAResource

prepare

public int prepare(javax.transaction.xa.Xid xid)
            throws javax.transaction.xa.XAException
Specified by:
prepare in interface javax.transaction.xa.XAResource

recover

public javax.transaction.xa.Xid[] recover(int flag)
                                   throws javax.transaction.xa.XAException
Specified by:
recover in interface javax.transaction.xa.XAResource

rollback

public void rollback(javax.transaction.xa.Xid xid)
              throws javax.transaction.xa.XAException
Specified by:
rollback in interface javax.transaction.xa.XAResource

setTransactionTimeout

public boolean setTransactionTimeout(int seconds)
                              throws javax.transaction.xa.XAException
Specified by:
setTransactionTimeout in interface javax.transaction.xa.XAResource

start

public void start(javax.transaction.xa.Xid xid,
                  int flags)
           throws javax.transaction.xa.XAException
Specified by:
start in interface javax.transaction.xa.XAResource

getResourceManagerId

public long getResourceManagerId()
                          throws javax.transaction.xa.XAException
Return the identity of the associated resource manager. If the value is not cached locally then grab it from the server
Returns:
long - the identity of the resource
Throws:
javax.transaction.xa.XAException -  

createTopic

public javax.jms.Topic createTopic(java.lang.String topicName)
                            throws javax.jms.JMSException
Create a topic identity given its name
Specified by:
createTopic in interface javax.jms.TopicSession
Parameters:
topicName - the topic name
Returns:
a topic with the given name.
Throws:
javax.jms.JMSException - if the topic can't be created

createSubscriber

public javax.jms.TopicSubscriber createSubscriber(javax.jms.Topic topic)
                                           throws javax.jms.JMSException
Create a non-durable subscriber for the specified topic
Specified by:
createSubscriber in interface javax.jms.TopicSession
Parameters:
topic - the topic to subscriber to
Returns:
the new subscriber
Throws:
javax.jms.JMSException - if the subscriber cannot be created

createSubscriber

public javax.jms.TopicSubscriber createSubscriber(javax.jms.Topic topic,
                                                  java.lang.String selector,
                                                  boolean noLocal)
                                           throws javax.jms.JMSException
Create a non-durable subscriber for the specified topic
Specified by:
createSubscriber in interface javax.jms.TopicSession
Parameters:
topic - the topic to subscriber to
selector - the message selector to filter messages. May be null
noLocal - if true, inhibits the delivery of messages published by its own connection
Returns:
the new subscriber
Throws:
javax.jms.JMSException - if the subscriber cannot be created

createDurableSubscriber

public javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic,
                                                         java.lang.String name)
                                                  throws javax.jms.JMSException
Create a durable subscriber for the specified topic
Specified by:
createDurableSubscriber in interface javax.jms.TopicSession
Parameters:
topic - the topic to subscribe to
name - the durable subscription name
Returns:
a new durable subscriber
Throws:
javax.jms.JMSException - if the subscriber can't be created

createDurableSubscriber

public javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic,
                                                         java.lang.String name,
                                                         java.lang.String selector,
                                                         boolean noLocal)
                                                  throws javax.jms.JMSException
Create a durable subscriber for the specified topic
Specified by:
createDurableSubscriber in interface javax.jms.TopicSession
Parameters:
topic - the topic to subscribe to
name - the durable subscription name
selector - the message selector to filter messages. May be null
noLocal - if true, inhibits the delivery of messages published by its own connection
Returns:
a new durable subscriber
Throws:
javax.jms.JMSException - if the subscriber can't be created

createPublisher

public javax.jms.TopicPublisher createPublisher(javax.jms.Topic topic)
                                         throws javax.jms.JMSException
Create a publisher for the specified topic.
Specified by:
createPublisher in interface javax.jms.TopicSession
Parameters:
topic - the topic to publish to, or null if this is an unidentified producer
Returns:
the new publisher
Throws:
javax.jms.JMSException - if the publisher can't be created

createTemporaryTopic

public javax.jms.TemporaryTopic createTemporaryTopic()
                                              throws javax.jms.JMSException
Create a temporary topic. It's lifetime is that of the TopicConnection, unless deleted earlier.
Specified by:
createTemporaryTopic in interface javax.jms.TopicSession
Returns:
a new temporary topic
Throws:
javax.jms.JMSException - if the topic cannot be created

unsubscribe

public void unsubscribe(java.lang.String name)
                 throws javax.jms.JMSException
Unsubscribe a durable subscription.
Specified by:
unsubscribe in interface javax.jms.TopicSession
Parameters:
name - the durable subscription name
Throws:
javax.jms.JMSException - if the durable subscription can't be removed

addSubscriber

protected void addSubscriber(org.exolab.jms.client.JmsTopicSubscriber subscriber,
                             java.lang.String name)
                      throws javax.jms.JMSException
Register a subscriber
Parameters:
subscriber - the subscriber to register
name - durable subscription name, for durable subscribers, null otherwise.
Throws:
javax.jms.JMSException - if the subscriber cannot be registered with the server

addPublisher

protected void addPublisher(org.exolab.jms.client.JmsTopicPublisher publisher)
                     throws javax.jms.JMSException
Register a publisher
Parameters:
publisher - the publisher to register
Throws:
javax.jms.JMSException - if the publisher cannot be registered with the server

removeSubscriber

protected void removeSubscriber(org.exolab.jms.client.JmsTopicSubscriber subscriber)
                         throws javax.jms.JMSException
Deregister azsubscriber
Parameters:
subscriber - the subscriber to deregister
Throws:
javax.jms.JMSException - if the subscriber cannot be deregistered from the server

removePublisher

protected void removePublisher(org.exolab.jms.client.JmsTopicPublisher publisher)
Deregister a publisher
Parameters:
publisher - the publisher to deregister

createBytesMessage

public javax.jms.BytesMessage createBytesMessage()
                                          throws javax.jms.JMSException
Create a BytesMessage
Specified by:
createBytesMessage in interface javax.jms.Session
Returns:
a new BytesMessage
Throws:
javax.jms.JMSException - if the message can't be created

createMapMessage

public javax.jms.MapMessage createMapMessage()
                                      throws javax.jms.JMSException
Create a MapMessage
Specified by:
createMapMessage in interface javax.jms.Session
Returns:
a new MapMessage
Throws:
javax.jms.JMSException - if the message can't be created

createMessage

public javax.jms.Message createMessage()
                                throws javax.jms.JMSException
Create a Message
Specified by:
createMessage in interface javax.jms.Session
Returns:
a new Message
Throws:
javax.jms.JMSException - if the message can't be created

createObjectMessage

public javax.jms.ObjectMessage createObjectMessage()
                                            throws javax.jms.JMSException
Create an ObjectMessage
Specified by:
createObjectMessage in interface javax.jms.Session
Returns:
a new ObjectMessage
Throws:
javax.jms.JMSException - if the message can't be created

createObjectMessage

public javax.jms.ObjectMessage createObjectMessage(java.io.Serializable object)
                                            throws javax.jms.JMSException
Create an ObjectMessage
Specified by:
createObjectMessage in interface javax.jms.Session
Parameters:
object - the object to use to initialise the message
Returns:
a new ObjectMessage
Throws:
javax.jms.JMSException - if the message can't be created

createStreamMessage

public javax.jms.StreamMessage createStreamMessage()
                                            throws javax.jms.JMSException
Create a StreamMessage
Specified by:
createStreamMessage in interface javax.jms.Session
Returns:
a new StreamMessage
Throws:
javax.jms.JMSException - if the message can't be created

createTextMessage

public javax.jms.TextMessage createTextMessage()
                                        throws javax.jms.JMSException
Create a TextMessage
Specified by:
createTextMessage in interface javax.jms.Session
Returns:
a new TextMessage
Throws:
javax.jms.JMSException - if the message can't be created

createTextMessage

public javax.jms.TextMessage createTextMessage(java.lang.String text)
                                        throws javax.jms.JMSException
Create a TextMessage
Specified by:
createTextMessage in interface javax.jms.Session
Parameters:
text - the text to use to initialise the message
Returns:
a new TextMessage
Throws:
javax.jms.JMSException - if the message can't be created

close

public void close()
           throws javax.jms.JMSException
Close the session. This call will block until a receive or message listener in progress has completed. A blocked message consumer receive call returns null when this session is closed.
Specified by:
close in interface javax.jms.Session
Throws:
javax.jms.JMSException - if the session can't be closed

recover

public void recover()
             throws javax.jms.JMSException
Stop message delivery in this session, and restart sending messages with the oldest unacknowledged message
Specified by:
recover in interface javax.jms.Session
Throws:
javax.jms.JMSException - if the session can't be recovered

getMessageListener

public javax.jms.MessageListener getMessageListener()
                                             throws javax.jms.JMSException
Returns the message listener associated with the session
Specified by:
getMessageListener in interface javax.jms.Session
Returns:
the message listener associated with the session, or null if no listener is registered
Throws:
javax.jms.JMSException - if the session is closed

setMessageListener

public void setMessageListener(javax.jms.MessageListener listener)
                        throws javax.jms.JMSException
Sets the session's message listener.
Specified by:
setMessageListener in interface javax.jms.Session
Parameters:
listener - the session's message listener
Throws:
javax.jms.JMSException - if the session is closed

run

public void run()
Iterates through the list of messages added by an JmsConnectionConsumer, sending them to the registered listener
Specified by:
run in interface javax.jms.Session

setMessageListener

public void setMessageListener(org.exolab.jms.client.JmsMessageConsumer listener)
                        throws javax.jms.JMSException
Set the message listener for a particular consumer.

If a listener is already registered for the consumer, it will be automatically overwritten

Parameters:
listener - the message listener
Throws:
javax.jms.JMSException - if the listener can't be set

removeMessageListener

public void removeMessageListener(org.exolab.jms.client.JmsMessageConsumer listener)
                           throws javax.jms.JMSException
Remove a message listener
Parameters:
listener - the message listener to remove
Throws:
javax.jms.JMSException - if the listener can't be removed

start

public void start()
           throws javax.jms.JMSException
This will start message delivery to this session. If message delivery has already started then this is a no-op.
Throws:
javax.jms.JMSException - if message delivery can't be started

stop

public void stop()
          throws javax.jms.JMSException
This will stop message delivery to this session. If message delivery has already stoped then this is a no-op.
Throws:
javax.jms.JMSException - if message delivery can't be stopped

acknowledgeMessage

public void acknowledgeMessage(javax.jms.Message message)
                        throws javax.jms.JMSException
Acknowledge the specified message. This is only applicable for CLIENT_ACKNOWLEDGE sessions. For other session types, the request is ignored.

Acking a message automatically acks all those that have come before it.

Specified by:
acknowledgeMessage in interface MessageSessionIfc
Parameters:
message - the message to acknowledge
Throws:
javax.jms.JMSException - if the message can't be acknowledged

enableAsynchronousDelivery

public void enableAsynchronousDelivery(long clientId,
                                       java.lang.String id,
                                       boolean enable)
                                throws javax.jms.JMSException
Enable or disable asynchronous message delivery for the specified client.
Parameters:
clientId - - the client identity
id - - the last message delivered asynchronously
enable - - true to enable; false to disable
Throws:
javax.jms.JMSException - if message delivery cannot be enabled or disabled

onMessage

public void onMessage(javax.jms.Message message)
Asynchronously deliver a message to a MessageConsumer
Specified by:
onMessage in interface javax.jms.MessageListener
Parameters:
message - the message to deliver

onMessages

public void onMessages(java.util.Vector messages)
Asynchronously deliver a set of message to a MessageConsumer
Specified by:
onMessages in interface JmsMessageListener
Parameters:
messages - the messages to deliver

onMessageAvailable

public void onMessageAvailable(long clientId)
Inform the session that there is a message available for the message consumer with the specified identity
Specified by:
onMessageAvailable in interface JmsMessageListener
Parameters:
clientId - the identity of the client

execute

public void execute(java.lang.Object object)
This is the called to process messages asynchronously delivered by the server. The session is then responsible for delivering it to the appropriate registered consumer. If it cannot resolve the consumer then it must log an exception

If the session has a registered listener then all messages will be delivered to the session's listener instead of the individual consumer message listeners.

Parameters:
object - received message

getSessionId

public java.lang.String getSessionId()
Returns the session identifier
Returns:
the session identifier

getAckMode

public int getAckMode()
Return the acknowledgement mode for the session
Returns:
the acknowledgement mode for the session

retrieveMessage

public javax.jms.Message retrieveMessage(long clientId,
                                         long wait)
                                  throws javax.jms.JMSException
Fetch the next message for this client. If the session's ackMode is client acknowledge then set the session for the message, othwerwise ack the message before returning it.
Parameters:
clientId - the consumer identififer.
wait - the maximum time to wait for a message, in milliseconds. If -1, don't wait, if 0 wait indefinitely, otherwise wait the specified time.
Returns:
the received message, or null, if no message is available
Throws:
javax.jms.JMSException - if an error occurs retrieving the message

retrieveMessages

public java.util.Vector retrieveMessages(long clientId,
                                         int count)
                                  throws javax.jms.JMSException
Fetch up to count messages from the endpoint. This should only be called via a JmsQueueBrowser.
Parameters:
clientId - scoped to the session
count - the max messages to retrieve.
Returns:
the set of retrieve messages
Throws:
javax.jms.JMSException - if messages can't be retrieved

destroy

public void destroy()
             throws javax.jms.JMSException
Release local resources used by this session object
Throws:
javax.jms.JMSException - - if there is a problem completing this request

sendMessage

protected void sendMessage(javax.jms.Message message)
                    throws javax.jms.JMSException
Send the specified message to the server.
Parameters:
message - the message to send
Throws:
javax.jms.JMSException - if the message can't be sent

getJmsSessionStub

protected JmsSessionStubIfc getJmsSessionStub()
Return an instance of the remote stub. This is set during object creation time
Returns:
the remote stub

getConnection

protected org.exolab.jms.client.JmsConnection getConnection()
Return a reference to the connection that created this session
Returns:
the owning connection

checkForValidTemporaryDestination

protected boolean checkForValidTemporaryDestination(JmsDestination destination)
This method checks the destination. If the destination is not temporary then return true. If it is a temporary destination and it is owned by this session's connection then it returns true. If it is a tmeporary destination and it is owned by another connection then it returns false
Parameters:
destination - the destination to check
Returns:
true if the destination is valid

getProducers

protected java.util.Enumeration getProducers()
Returns a list of registered producers for the session
Returns:
an enumeration of the producers managed by the session

getConsumers

protected java.util.Enumeration getConsumers()
Returns a list of registered consumers for the session
Returns:
an enumeration of the consumers managed by the session

getNextConsumerId

protected long getNextConsumerId()
Returns the next seed value to be allocated to a new consumer
Returns:
a unique identifier for a consumer for this session

addConsumer

protected void addConsumer(org.exolab.jms.client.JmsMessageConsumer consumer)
Add a consumer to the list of consumers managed by this session
Parameters:
consumer - the consumer to add

removeConsumer

protected void removeConsumer(org.exolab.jms.client.JmsMessageConsumer consumer)
Remove the consumer with the specified id from the list of managed consumers
Parameters:
consumer - the consumer to remove

addProducer

protected void addProducer(org.exolab.jms.client.JmsMessageProducer producer)
Add a producer to the list of producers managed by this session
Parameters:
producer - the producer to add

removeProducer

protected void removeProducer(org.exolab.jms.client.JmsMessageProducer producer)
Remove the producer from the list of managed producers
Parameters:
producer - the producer to remove

isClosed

protected final boolean isClosed()
Check if the session is closed
Returns:
true if the session is closed

addMessage

protected void addMessage(javax.jms.Message message)
Add a message to the message cache. This message will be processed when the run() method is called.
Parameters:
message - the message to add.

ensureOpen

protected void ensureOpen()
                   throws javax.jms.IllegalStateException
Verifies that the session isn't closed
Throws:
javax.jms.IllegalStateException - if the session is closed


Copyright © 1999-2004 The OpenJMS Group. All Rights Reserved.