org.exolab.jms.client
Class JmsXAQueueSession

java.lang.Object
  |
  +--org.exolab.jms.client.JmsSession
        |
        +--org.exolab.jms.client.JmsQueueSession
              |
              +--org.exolab.jms.client.JmsXAQueueSession
All Implemented Interfaces:
JmsMessageListener, javax.jms.MessageListener, MessageSessionIfc, javax.jms.QueueSession, java.lang.Runnable, javax.jms.Session, javax.jms.XAQueueSession, javax.transaction.xa.XAResource, javax.jms.XASession

public class JmsXAQueueSession
extends org.exolab.jms.client.JmsQueueSession
implements javax.jms.XAQueueSession, javax.transaction.xa.XAResource

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

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 addBrowser(org.exolab.jms.client.JmsQueueBrowser browser)
          Register a browser
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 addReceiver(org.exolab.jms.client.JmsQueueReceiver receiver)
          Register a receiver
protected  void addSender(org.exolab.jms.client.JmsQueueSender sender)
          Register a sender
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.QueueBrowser createBrowser(javax.jms.Queue queue)
          Create a new queue browser
 javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue, java.lang.String selector)
          Create a new queue browser
 javax.jms.BytesMessage createBytesMessage()
          Create a BytesMessage
 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.Queue createQueue(java.lang.String queueName)
          Create a queue identity given its name
 javax.jms.QueueReceiver createReceiver(javax.jms.Queue queue)
          Create a receiver to receive messages from the specified queue
 javax.jms.QueueReceiver createReceiver(javax.jms.Queue queue, java.lang.String selector)
          Create a receiver to receive messages from the specified queue
 javax.jms.QueueSender createSender(javax.jms.Queue queue)
          Create a sender to send messages to the specified queue.
 javax.jms.StreamMessage createStreamMessage()
          Create a StreamMessage
 javax.jms.TemporaryQueue createTemporaryQueue()
          Create a temporary queue.
 javax.jms.TextMessage createTextMessage()
          Create a TextMessage
 javax.jms.TextMessage createTextMessage(java.lang.String text)
          Create a TextMessage
 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
 javax.jms.QueueSession getQueueSession()
           
 long getResourceManagerId()
          Return the identity of the associated resource manager.
 java.lang.String getSessionId()
          Returns the session identifier
 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 removeBrowser(org.exolab.jms.client.JmsQueueBrowser browser)
          Deregister a queue browser
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 removeReceiver(org.exolab.jms.client.JmsQueueReceiver receiver)
          Deregister a receiver
protected  void removeSender(org.exolab.jms.client.JmsQueueSender sender)
          Deregister a sender
 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.
 
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

getQueueSession

public javax.jms.QueueSession getQueueSession()
                                       throws javax.jms.JMSException
Specified by:
getQueueSession in interface javax.jms.XAQueueSession

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 -  

createQueue

public javax.jms.Queue createQueue(java.lang.String queueName)
                            throws javax.jms.JMSException
Create a queue identity given its name
Specified by:
createQueue in interface javax.jms.QueueSession
Parameters:
queueName - the queue name
Returns:
a queue with the given name.
Throws:
javax.jms.JMSException - if the queue can't be created

createReceiver

public javax.jms.QueueReceiver createReceiver(javax.jms.Queue queue)
                                       throws javax.jms.JMSException
Create a receiver to receive messages from the specified queue
Specified by:
createReceiver in interface javax.jms.QueueSession
Parameters:
queue - the queue to access
Returns:
the new receiver
Throws:
javax.jms.JMSException - if the receiver cannot be created

createReceiver

public javax.jms.QueueReceiver createReceiver(javax.jms.Queue queue,
                                              java.lang.String selector)
                                       throws javax.jms.JMSException
Create a receiver to receive messages from the specified queue
Specified by:
createReceiver in interface javax.jms.QueueSession
Parameters:
queue - the queue to access
selector - the message selector to filter messages. May be null
Returns:
the new receiver
Throws:
javax.jms.JMSException - if the receiver cannot be created

createSender

public javax.jms.QueueSender createSender(javax.jms.Queue queue)
                                   throws javax.jms.JMSException
Create a sender to send messages to the specified queue.
Specified by:
createSender in interface javax.jms.QueueSession
Parameters:
queue - the queue to access, or null if this is an unidentified producer
Returns:
the new sender
Throws:
javax.jms.JMSException - if the sender can't be created

createBrowser

public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue)
                                     throws javax.jms.JMSException
Create a new queue browser
Specified by:
createBrowser in interface javax.jms.QueueSession
Parameters:
queue - the queue to access
Returns:
the new queue browser
Throws:
javax.jms.JMSException - if the browser can't be created

createBrowser

public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue,
                                            java.lang.String selector)
                                     throws javax.jms.JMSException
Create a new queue browser
Specified by:
createBrowser in interface javax.jms.QueueSession
Parameters:
queue - the queue to access
selector - the message selector to filter messages. May be null
Returns:
the new queue browser
Throws:
javax.jms.JMSException - if the browser can't be created

createTemporaryQueue

public javax.jms.TemporaryQueue createTemporaryQueue()
                                              throws javax.jms.JMSException
Create a temporary queue. It's lifetime is that of the QueueConnection, unless deleted earlier.
Specified by:
createTemporaryQueue in interface javax.jms.QueueSession
Returns:
a new temporary queue
Throws:
javax.jms.JMSException - if the queue cannot be created

addReceiver

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

addSender

protected void addSender(org.exolab.jms.client.JmsQueueSender sender)
Register a sender
Parameters:
sender - the sender to register

addBrowser

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

removeReceiver

protected void removeReceiver(org.exolab.jms.client.JmsQueueReceiver receiver)
                       throws javax.jms.JMSException
Deregister a receiver
Parameters:
receiver - the receiver to deregister
Throws:
javax.jms.JMSException - if the receiver cannot be deregistered from the server

removeSender

protected void removeSender(org.exolab.jms.client.JmsQueueSender sender)
Deregister a sender
Parameters:
sender - the sender to deregister

removeBrowser

protected void removeBrowser(org.exolab.jms.client.JmsQueueBrowser browser)
                      throws javax.jms.JMSException
Deregister a queue browser
Parameters:
browser - the browser to deregister
Throws:
javax.jms.JMSException - if the browser cannot be deregistered from the server

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.