|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exolab.jms.client.JmsXAQueueSession
public class JmsXAQueueSession
XAQueueSession| Field Summary |
|---|
| 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.XAQueueSessionjavax.jms.JMSExceptionpublic javax.transaction.xa.XAResource getXAResource()
getXAResource in interface javax.jms.XASession
public boolean getTransacted()
throws javax.jms.JMSException
getTransacted in interface javax.jms.SessiongetTransacted in interface javax.jms.XASessiontrue if the session is transacted
javax.jms.JMSException - if the session is closed
public void commit()
throws javax.jms.JMSException
commit in interface javax.jms.Sessioncommit in interface javax.jms.XASessionjavax.jms.JMSException - if the transaction cannot be committed
public void rollback()
throws javax.jms.JMSException
rollback in interface javax.jms.Sessionrollback in interface javax.jms.XASessionjavax.jms.JMSException - if the transaction cannot be rolled back
public void commit(javax.transaction.xa.Xid xid,
boolean onePhase)
throws javax.transaction.xa.XAException
commit in interface javax.transaction.xa.XAResourcejavax.transaction.xa.XAException
public void end(javax.transaction.xa.Xid xid,
int flags)
throws javax.transaction.xa.XAException
end in interface javax.transaction.xa.XAResourcejavax.transaction.xa.XAException
public void forget(javax.transaction.xa.Xid xid)
throws javax.transaction.xa.XAException
forget in interface javax.transaction.xa.XAResourcejavax.transaction.xa.XAException
public int getTransactionTimeout()
throws javax.transaction.xa.XAException
getTransactionTimeout in interface javax.transaction.xa.XAResourcejavax.transaction.xa.XAException
public boolean isSameRM(javax.transaction.xa.XAResource xares)
throws javax.transaction.xa.XAException
isSameRM in interface javax.transaction.xa.XAResourcejavax.transaction.xa.XAException
public int prepare(javax.transaction.xa.Xid xid)
throws javax.transaction.xa.XAException
prepare in interface javax.transaction.xa.XAResourcejavax.transaction.xa.XAException
public javax.transaction.xa.Xid[] recover(int flag)
throws javax.transaction.xa.XAException
recover in interface javax.transaction.xa.XAResourcejavax.transaction.xa.XAException
public void rollback(javax.transaction.xa.Xid xid)
throws javax.transaction.xa.XAException
rollback in interface javax.transaction.xa.XAResourcejavax.transaction.xa.XAException
public boolean setTransactionTimeout(int seconds)
throws javax.transaction.xa.XAException
setTransactionTimeout in interface javax.transaction.xa.XAResourcejavax.transaction.xa.XAException
public void start(javax.transaction.xa.Xid xid,
int flags)
throws javax.transaction.xa.XAException
start in interface javax.transaction.xa.XAResourcejavax.transaction.xa.XAException
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.QueueSessionqueueName - the queue name
javax.jms.JMSException - if the queue can't be created
public javax.jms.QueueReceiver createReceiver(javax.jms.Queue queue)
throws javax.jms.JMSException
createReceiver in interface javax.jms.QueueSessionqueue - the queue to access
javax.jms.JMSException - if the receiver cannot be created
public javax.jms.QueueReceiver createReceiver(javax.jms.Queue queue,
java.lang.String selector)
throws javax.jms.JMSException
createReceiver in interface javax.jms.QueueSessionqueue - the queue to accessselector - the message selector to filter messages.
May be null
javax.jms.JMSException - if the receiver cannot be created
public javax.jms.QueueSender createSender(javax.jms.Queue queue)
throws javax.jms.JMSException
createSender in interface javax.jms.QueueSessionqueue - the queue to access, or null if this is an
unidentified producer
javax.jms.JMSException - if the sender can't be created
public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue)
throws javax.jms.JMSException
createBrowser in interface javax.jms.QueueSessionqueue - the queue to access
javax.jms.JMSException - if the browser can't be created
public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue,
java.lang.String selector)
throws javax.jms.JMSException
createBrowser in interface javax.jms.QueueSessionqueue - the queue to accessselector - the message selector to filter messages.
May be null
javax.jms.JMSException - if the browser can't be created
public javax.jms.TemporaryQueue createTemporaryQueue()
throws javax.jms.JMSException
createTemporaryQueue in interface javax.jms.QueueSessionjavax.jms.JMSException - if the queue cannot be created
protected void addReceiver(org.exolab.jms.client.JmsQueueReceiver receiver)
throws javax.jms.JMSException
receiver - the receiver to register
javax.jms.JMSException - if the receiver cannot be registered with the
serverprotected void addSender(org.exolab.jms.client.JmsQueueSender sender)
sender - the sender to register
protected void addBrowser(org.exolab.jms.client.JmsQueueBrowser browser)
throws javax.jms.JMSException
browser - the browser to register
javax.jms.JMSException - if the browser cannot be registered with the
server
protected void removeReceiver(org.exolab.jms.client.JmsQueueReceiver receiver)
throws javax.jms.JMSException
receiver - the receiver to deregister
javax.jms.JMSException - if the receiver cannot be deregistered from the
serverprotected void removeSender(org.exolab.jms.client.JmsQueueSender sender)
sender - the sender to deregister
protected void removeBrowser(org.exolab.jms.client.JmsQueueBrowser browser)
throws javax.jms.JMSException
browser - the browser to deregister
javax.jms.JMSException - if the browser cannot be deregistered from the
server
public javax.jms.BytesMessage createBytesMessage()
throws javax.jms.JMSException
BytesMessage
createBytesMessage in interface javax.jms.SessionBytesMessage
javax.jms.JMSException - if the message can't be created
public javax.jms.MapMessage createMapMessage()
throws javax.jms.JMSException
MapMessage
createMapMessage in interface javax.jms.SessionMapMessage
javax.jms.JMSException - if the message can't be created
public javax.jms.Message createMessage()
throws javax.jms.JMSException
Message
createMessage in interface javax.jms.SessionMessage
javax.jms.JMSException - if the message can't be created
public javax.jms.ObjectMessage createObjectMessage()
throws javax.jms.JMSException
ObjectMessage
createObjectMessage in interface javax.jms.SessionObjectMessage
javax.jms.JMSException - if the message can't be created
public javax.jms.ObjectMessage createObjectMessage(java.io.Serializable object)
throws javax.jms.JMSException
ObjectMessage
createObjectMessage in interface javax.jms.Sessionobject - the object to use to initialise the message
ObjectMessage
javax.jms.JMSException - if the message can't be created
public javax.jms.StreamMessage createStreamMessage()
throws javax.jms.JMSException
StreamMessage
createStreamMessage in interface javax.jms.SessionStreamMessage
javax.jms.JMSException - if the message can't be created
public javax.jms.TextMessage createTextMessage()
throws javax.jms.JMSException
TextMessage
createTextMessage in interface javax.jms.SessionTextMessage
javax.jms.JMSException - if the message can't be created
public javax.jms.TextMessage createTextMessage(java.lang.String text)
throws javax.jms.JMSException
TextMessage
createTextMessage in interface javax.jms.Sessiontext - the text to use to initialise the message
TextMessage
javax.jms.JMSException - if the message can't be created
public void close()
throws javax.jms.JMSException
null when this session is closed.
close in interface javax.jms.Sessionjavax.jms.JMSException - if the session can't be closed
public void recover()
throws javax.jms.JMSException
recover in interface javax.jms.Sessionjavax.jms.JMSException - if the session can't be recovered
public javax.jms.MessageListener getMessageListener()
throws javax.jms.JMSException
getMessageListener in interface javax.jms.Sessionnull if no listener is registered
javax.jms.JMSException - if the session is closed
public void setMessageListener(javax.jms.MessageListener listener)
throws javax.jms.JMSException
setMessageListener in interface javax.jms.Sessionlistener - the session's message listener
javax.jms.JMSException - if the session is closedpublic void run()
JmsConnectionConsumer, sending them to the registered listener
run in interface java.lang.Runnablerun 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 listener
javax.jms.JMSException - if the listener can't be set
public void removeMessageListener(org.exolab.jms.client.JmsMessageConsumer listener)
throws javax.jms.JMSException
listener - the message listener to remove
javax.jms.JMSException - if the listener can't be removed
public void start()
throws javax.jms.JMSException
javax.jms.JMSException - if message delivery can't be started
public void stop()
throws javax.jms.JMSException
javax.jms.JMSException - if message delivery can't be stopped
public 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 MessageSessionIfcmessage - the message to acknowledge
javax.jms.JMSException - if the message can't be acknowledged
public 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
disable
javax.jms.JMSException - if message delivery cannot be enabled or disabledpublic void onMessage(javax.jms.Message message)
MessageConsumer
onMessage in interface javax.jms.MessageListenermessage - the message to deliverpublic void onMessages(java.util.Vector messages)
MessageConsumer
onMessages in interface JmsMessageListenermessages - the messages to deliverpublic void onMessageAvailable(long clientId)
onMessageAvailable in interface JmsMessageListenerclientId - 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
available
javax.jms.JMSException - if an error occurs retrieving the message
public 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 retrieved
public void destroy()
throws javax.jms.JMSException
javax.jms.JMSException - - if there is a problem completing this request
protected void sendMessage(javax.jms.Message message)
throws javax.jms.JMSException
message - the message to send
javax.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 check
true 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: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||