|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.exolab.jms.client.JmsSession | +--org.exolab.jms.client.JmsQueueSession | +--org.exolab.jms.client.JmsXAQueueSession
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 |
public javax.jms.QueueSession getQueueSession() throws javax.jms.JMSException
getQueueSession
in interface javax.jms.XAQueueSession
public javax.transaction.xa.XAResource getXAResource()
getXAResource
in interface javax.jms.XASession
public boolean getTransacted() throws javax.jms.JMSException
org.exolab.jms.client.JmsSession
getTransacted
in interface javax.jms.XASession
getTransacted
in class org.exolab.jms.client.JmsSession
org.exolab.jms.client.JmsSession
true
if the session is transactedjavax.jms.JMSException
- if the session is closedpublic void commit() throws javax.jms.JMSException
org.exolab.jms.client.JmsSession
commit
in interface javax.jms.XASession
commit
in class org.exolab.jms.client.JmsSession
org.exolab.jms.client.JmsSession
javax.jms.JMSException
- if the transaction cannot be committedpublic void rollback() throws javax.jms.JMSException
org.exolab.jms.client.JmsSession
rollback
in interface javax.jms.XASession
rollback
in class org.exolab.jms.client.JmsSession
org.exolab.jms.client.JmsSession
javax.jms.JMSException
- if the transaction cannot be rolled backpublic void commit(javax.transaction.xa.Xid xid, boolean onePhase) throws javax.transaction.xa.XAException
commit
in interface javax.transaction.xa.XAResource
public void end(javax.transaction.xa.Xid xid, int flags) throws javax.transaction.xa.XAException
end
in interface javax.transaction.xa.XAResource
public void forget(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
forget
in interface javax.transaction.xa.XAResource
public int getTransactionTimeout() throws javax.transaction.xa.XAException
getTransactionTimeout
in interface javax.transaction.xa.XAResource
public boolean isSameRM(javax.transaction.xa.XAResource xares) throws javax.transaction.xa.XAException
isSameRM
in interface javax.transaction.xa.XAResource
public int prepare(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
prepare
in interface javax.transaction.xa.XAResource
public javax.transaction.xa.Xid[] recover(int flag) throws javax.transaction.xa.XAException
recover
in interface javax.transaction.xa.XAResource
public void rollback(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
rollback
in interface javax.transaction.xa.XAResource
public boolean setTransactionTimeout(int seconds) throws javax.transaction.xa.XAException
setTransactionTimeout
in interface javax.transaction.xa.XAResource
public void start(javax.transaction.xa.Xid xid, int flags) throws javax.transaction.xa.XAException
start
in interface javax.transaction.xa.XAResource
public long getResourceManagerId() throws javax.transaction.xa.XAException
javax.transaction.xa.XAException
- public javax.jms.Queue createQueue(java.lang.String queueName) throws javax.jms.JMSException
createQueue
in interface javax.jms.QueueSession
queueName
- the queue namejavax.jms.JMSException
- if the queue can't be createdpublic javax.jms.QueueReceiver createReceiver(javax.jms.Queue queue) throws javax.jms.JMSException
createReceiver
in interface javax.jms.QueueSession
queue
- the queue to accessjavax.jms.JMSException
- if the receiver cannot be createdpublic javax.jms.QueueReceiver createReceiver(javax.jms.Queue queue, java.lang.String selector) throws javax.jms.JMSException
createReceiver
in interface javax.jms.QueueSession
queue
- the queue to accessselector
- the message selector to filter messages.
May be null
javax.jms.JMSException
- if the receiver cannot be createdpublic javax.jms.QueueSender createSender(javax.jms.Queue queue) throws javax.jms.JMSException
createSender
in interface javax.jms.QueueSession
queue
- the queue to access, or null
if this is an
unidentified producerjavax.jms.JMSException
- if the sender can't be createdpublic javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue) throws javax.jms.JMSException
createBrowser
in interface javax.jms.QueueSession
queue
- the queue to accessjavax.jms.JMSException
- if the browser can't be createdpublic javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue, java.lang.String selector) throws javax.jms.JMSException
createBrowser
in interface javax.jms.QueueSession
queue
- the queue to accessselector
- the message selector to filter messages.
May be null
javax.jms.JMSException
- if the browser can't be createdpublic javax.jms.TemporaryQueue createTemporaryQueue() throws javax.jms.JMSException
createTemporaryQueue
in interface javax.jms.QueueSession
javax.jms.JMSException
- if the queue cannot be createdprotected void addReceiver(org.exolab.jms.client.JmsQueueReceiver receiver) throws javax.jms.JMSException
receiver
- the receiver to registerjavax.jms.JMSException
- if the receiver cannot be registered with the
serverprotected void addSender(org.exolab.jms.client.JmsQueueSender sender)
sender
- the sender to registerprotected void addBrowser(org.exolab.jms.client.JmsQueueBrowser browser) throws javax.jms.JMSException
browser
- the browser to registerjavax.jms.JMSException
- if the browser cannot be registered with the
serverprotected void removeReceiver(org.exolab.jms.client.JmsQueueReceiver receiver) throws javax.jms.JMSException
receiver
- the receiver to deregisterjavax.jms.JMSException
- if the receiver cannot be deregistered from the
serverprotected void removeSender(org.exolab.jms.client.JmsQueueSender sender)
sender
- the sender to deregisterprotected void removeBrowser(org.exolab.jms.client.JmsQueueBrowser browser) throws javax.jms.JMSException
browser
- the browser to deregisterjavax.jms.JMSException
- if the browser cannot be deregistered from the
serverpublic javax.jms.BytesMessage createBytesMessage() throws javax.jms.JMSException
BytesMessage
createBytesMessage
in interface javax.jms.Session
BytesMessage
javax.jms.JMSException
- if the message can't be createdpublic javax.jms.MapMessage createMapMessage() throws javax.jms.JMSException
MapMessage
createMapMessage
in interface javax.jms.Session
MapMessage
javax.jms.JMSException
- if the message can't be createdpublic javax.jms.Message createMessage() throws javax.jms.JMSException
Message
createMessage
in interface javax.jms.Session
Message
javax.jms.JMSException
- if the message can't be createdpublic javax.jms.ObjectMessage createObjectMessage() throws javax.jms.JMSException
ObjectMessage
createObjectMessage
in interface javax.jms.Session
ObjectMessage
javax.jms.JMSException
- if the message can't be createdpublic javax.jms.ObjectMessage createObjectMessage(java.io.Serializable object) throws javax.jms.JMSException
ObjectMessage
createObjectMessage
in interface javax.jms.Session
object
- the object to use to initialise the messageObjectMessage
javax.jms.JMSException
- if the message can't be createdpublic javax.jms.StreamMessage createStreamMessage() throws javax.jms.JMSException
StreamMessage
createStreamMessage
in interface javax.jms.Session
StreamMessage
javax.jms.JMSException
- if the message can't be createdpublic javax.jms.TextMessage createTextMessage() throws javax.jms.JMSException
TextMessage
createTextMessage
in interface javax.jms.Session
TextMessage
javax.jms.JMSException
- if the message can't be createdpublic javax.jms.TextMessage createTextMessage(java.lang.String text) throws javax.jms.JMSException
TextMessage
createTextMessage
in interface javax.jms.Session
text
- the text to use to initialise the messageTextMessage
javax.jms.JMSException
- if the message can't be createdpublic void close() throws javax.jms.JMSException
null
when this session is closed.close
in interface javax.jms.Session
javax.jms.JMSException
- if the session can't be closedpublic void recover() throws javax.jms.JMSException
recover
in interface javax.jms.Session
javax.jms.JMSException
- if the session can't be recoveredpublic javax.jms.MessageListener getMessageListener() throws javax.jms.JMSException
getMessageListener
in interface javax.jms.Session
null
if no listener is registeredjavax.jms.JMSException
- if the session is closedpublic void setMessageListener(javax.jms.MessageListener listener) throws javax.jms.JMSException
setMessageListener
in interface javax.jms.Session
listener
- the session's message listenerjavax.jms.JMSException
- if the session is closedpublic void run()
JmsConnectionConsumer
, sending them to the registered listenerrun
in interface javax.jms.Session
public void setMessageListener(org.exolab.jms.client.JmsMessageConsumer listener) throws javax.jms.JMSException
If a listener is already registered for the consumer, it will be automatically overwritten
listener
- the message listenerjavax.jms.JMSException
- if the listener can't be setpublic void removeMessageListener(org.exolab.jms.client.JmsMessageConsumer listener) throws javax.jms.JMSException
listener
- the message listener to removejavax.jms.JMSException
- if the listener can't be removedpublic void start() throws javax.jms.JMSException
javax.jms.JMSException
- if message delivery can't be startedpublic void stop() throws javax.jms.JMSException
javax.jms.JMSException
- if message delivery can't be stoppedpublic void acknowledgeMessage(javax.jms.Message message) throws javax.jms.JMSException
Acking a message automatically acks all those that have come before it.
acknowledgeMessage
in interface MessageSessionIfc
message
- the message to acknowledgejavax.jms.JMSException
- if the message can't be acknowledgedpublic void enableAsynchronousDelivery(long clientId, java.lang.String id, boolean enable) throws javax.jms.JMSException
clientId
- - the client identityid
- - the last message delivered asynchronouslyenable
- - true
to enable; false
to
disablejavax.jms.JMSException
- if message delivery cannot be enabled or disabledpublic void onMessage(javax.jms.Message message)
MessageConsumer
onMessage
in interface javax.jms.MessageListener
message
- the message to deliverpublic void onMessages(java.util.Vector messages)
MessageConsumer
onMessages
in interface JmsMessageListener
messages
- the messages to deliverpublic void onMessageAvailable(long clientId)
onMessageAvailable
in interface JmsMessageListener
clientId
- the identity of the clientpublic void execute(java.lang.Object object)
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.
object
- received messagepublic java.lang.String getSessionId()
public int getAckMode()
public javax.jms.Message retrieveMessage(long clientId, long wait) throws javax.jms.JMSException
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.null
, if no message is
availablejavax.jms.JMSException
- if an error occurs retrieving the messagepublic java.util.Vector retrieveMessages(long clientId, int count) throws javax.jms.JMSException
JmsQueueBrowser
.clientId
- scoped to the sessioncount
- the max messages to retrieve.javax.jms.JMSException
- if messages can't be retrievedpublic void destroy() throws javax.jms.JMSException
javax.jms.JMSException
- - if there is a problem completing this requestprotected void sendMessage(javax.jms.Message message) throws javax.jms.JMSException
message
- the message to sendjavax.jms.JMSException
- if the message can't be sentprotected JmsSessionStubIfc getJmsSessionStub()
protected org.exolab.jms.client.JmsConnection getConnection()
protected boolean checkForValidTemporaryDestination(JmsDestination destination)
destination
- the destination to checktrue
if the destination is validprotected java.util.Enumeration getProducers()
protected java.util.Enumeration getConsumers()
protected long getNextConsumerId()
protected void addConsumer(org.exolab.jms.client.JmsMessageConsumer consumer)
consumer
- the consumer to addprotected void removeConsumer(org.exolab.jms.client.JmsMessageConsumer consumer)
consumer
- the consumer to removeprotected void addProducer(org.exolab.jms.client.JmsMessageProducer producer)
producer
- the producer to addprotected void removeProducer(org.exolab.jms.client.JmsMessageProducer producer)
producer
- the producer to removeprotected final boolean isClosed()
true
if the session is closedprotected void addMessage(javax.jms.Message message)
message
- the message to add.protected void ensureOpen() throws javax.jms.IllegalStateException
javax.jms.IllegalStateException
- if the session is closed
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |