|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Indicates the methods clients can call on the server-side implementation of
the Session
interface
Method Summary | |
void |
acknowledgeMessage(long consumerId,
java.lang.String messageId)
Acknowledge that a message has been processed. |
java.util.List |
browse(long consumerId,
int count)
Browse up to count messages. |
void |
close()
Close and release any resource allocated to this session. |
void |
closeConsumer(long consumerId)
Close a message consumer. |
void |
commit()
Commit the session. |
void |
commit(javax.transaction.xa.Xid xid,
boolean onePhase)
Commits an XA transaction that is in progress. |
long |
createBrowser(JmsQueue queue,
java.lang.String selector)
Create a queue browser for this session. |
long |
createConsumer(JmsDestination destination,
java.lang.String selector,
boolean noLocal)
Create a new message consumer. |
long |
createDurableConsumer(JmsTopic topic,
java.lang.String name,
java.lang.String selector,
boolean noLocal)
Create a new durable consumer. |
void |
end(javax.transaction.xa.Xid xid,
int flags)
Ends the work performed on behalf of a transaction branch. |
void |
forget(javax.transaction.xa.Xid xid)
Tell the resource manager to forget about a heuristically completed transaction branch. |
java.lang.String |
getResourceManagerId()
Return the identity of the associated resource manager. |
int |
getTransactionTimeout()
Return the transaction timeout for this instance of the resource manager. |
int |
prepare(javax.transaction.xa.Xid xid)
Ask the resource manager to prepare for a transaction commit of the transaction specified in xid. |
MessageImpl |
receive(long consumerId,
long wait)
Return the next available message to the specified consumer. |
MessageImpl |
receiveNoWait(long consumerId)
Return the next available mesage to the specified consumer. |
void |
recover()
Recover the session. |
javax.transaction.xa.Xid[] |
recover(int flag)
Obtain a list of prepared transaction branches from a resource manager. |
void |
rollback()
Rollback the session. |
void |
rollback(javax.transaction.xa.Xid xid)
Inform the resource manager to roll back work done on behalf of a transaction branch. |
void |
send(java.util.List messages)
Send a set of messages. |
void |
send(MessageImpl message)
Send a message. |
void |
setAsynchronous(long consumerId,
boolean enable)
Enable or disable asynchronous message delivery for a particular consumer. |
void |
setMessageListener(JmsMessageListener listener)
Set the listener for this session. |
boolean |
setTransactionTimeout(int seconds)
Set the current transaction timeout value for this XAResource instance. |
void |
start()
Start message delivery to this session. |
void |
start(javax.transaction.xa.Xid xid,
int flags)
Start work on behalf of a transaction branch specified in xid If TMJOIN is specified, the start is for joining a transaction previously seen by the resource manager |
void |
stop()
Stop message delivery to this session. |
void |
unsubscribe(java.lang.String name)
Unsubscribe a durable subscription. |
Method Detail |
public void close() throws javax.jms.JMSException
javax.jms.JMSException
- for any JMS errorpublic void acknowledgeMessage(long consumerId, java.lang.String messageId) throws javax.jms.JMSException
consumerId
- the identity of the consumer performing the ackmessageId
- the message identifierjavax.jms.JMSException
- for any errorpublic void send(MessageImpl message) throws javax.jms.JMSException
message
- the message to sendjavax.jms.JMSException
- for any errorpublic void send(java.util.List messages) throws javax.jms.JMSException
messages
- a list of MessageImpl
instancesjavax.jms.JMSException
- for any JMS errorpublic MessageImpl receiveNoWait(long consumerId) throws javax.jms.JMSException
consumerId
- the consumer identifiernull
if none is availablejavax.jms.JMSException
- for any JMS errorpublic MessageImpl receive(long consumerId, long wait) throws javax.jms.JMSException
wait
interval to indicate how long they are prepared to wait
for a message. If no message is available, and the client indicates that
it will wait, it will be notified via the registered JmsMessageListener
if one subsequently becomes available.consumerId
- the consumer identifierwait
- number of milliseconds to wait. A value of 0
indicates to wait indefinitelynull
javax.jms.JMSException
- for any JMS errorpublic java.util.List browse(long consumerId, int count) throws javax.jms.JMSException
consumerId
- the consumer identifiercount
- the maximum number of messages to receiveMessageImpl
instancesjavax.jms.JMSException
- for any JMS errorpublic long createConsumer(JmsDestination destination, java.lang.String selector, boolean noLocal) throws javax.jms.JMSException
destination
- the destination to consume messages fromselector
- the message selector. May be null
noLocal
- if true, and the destination is a topic, inhibits the
delivery of messages published by its own connection.
The behavior for noLocal
is not specified
if the destination is a queue.javax.jms.JMSException
- for any JMS errorpublic long createDurableConsumer(JmsTopic topic, java.lang.String name, java.lang.String selector, boolean noLocal) throws javax.jms.JMSException
Topic
destinations.topic
- the non-temporary Topic
to subscribe toname
- the name used to identify this subscriptionselector
- only messages with properties matching the message
selector expression are delivered. A value of null or an
empty string indicates that there is no message selector
for the message consumer.noLocal
- if set, inhibits the delivery of messages published by
its own connectionjavax.jms.JMSException
- for any JMS errorpublic long createBrowser(JmsQueue queue, java.lang.String selector) throws javax.jms.JMSException
queue
- the queue to browseselector
- the message selector. May be null
javax.jms.JMSException
- for any JMS errorpublic void closeConsumer(long consumerId) throws javax.jms.JMSException
consumerId
- the identity of the consumer to closejavax.jms.JMSException
- for any JMS errorpublic void unsubscribe(java.lang.String name) throws javax.jms.JMSException
name
- the name used to identify the subscriptionjavax.jms.JMSException
- for any JMS errorpublic void start() throws javax.jms.JMSException
javax.jms.JMSException
- for any JMS errorpublic void stop() throws javax.jms.JMSException
javax.jms.JMSException
- for any JMS errorpublic void setMessageListener(JmsMessageListener listener)
listener
- the message listenerpublic void setAsynchronous(long consumerId, boolean enable) throws javax.jms.JMSException
consumerId
- the consumer identifierenable
- true to enable; false to disablejavax.jms.JMSException
- for any JMS errorpublic void recover() throws javax.jms.JMSException
javax.jms.JMSException
- if the session cannot be recoveredpublic void commit() throws javax.jms.JMSException
javax.jms.JMSException
- if the session cannot be committedpublic void rollback() throws javax.jms.JMSException
javax.jms.JMSException
- if the session cannot be rolled backpublic void start(javax.transaction.xa.Xid xid, int flags) throws javax.transaction.xa.XAException
xid
- the xa transaction identityflags
- One of TMNOFLAGS, TMJOIN, or TMRESUMEjavax.transaction.xa.XAException
- if there is a problem completing the callpublic int prepare(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
xid
- the xa transaction identityjavax.transaction.xa.XAException
- if there is a problem completing the callpublic void commit(javax.transaction.xa.Xid xid, boolean onePhase) throws javax.transaction.xa.XAException
xid
- the xa transaction identityonePhase
- true if it is a one phase commitjavax.transaction.xa.XAException
- if there is a problem completing the callpublic void end(javax.transaction.xa.Xid xid, int flags) throws javax.transaction.xa.XAException
xid
- the xa transaction identityflags
- one of TMSUCCESS, TMFAIL, or TMSUSPENDjavax.transaction.xa.XAException
- if there is a problem completing the callpublic void forget(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
xid
- the xa transaction identityjavax.transaction.xa.XAException
- if there is a problem completing the callpublic javax.transaction.xa.Xid[] recover(int flag) throws javax.transaction.xa.XAException
flag
- One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGSjavax.transaction.xa.XAException
- if there is a problem completing the callpublic void rollback(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
xid
- the xa transaction identityjavax.transaction.xa.XAException
- if there is a problem completing the callpublic int getTransactionTimeout() throws javax.transaction.xa.XAException
javax.transaction.xa.XAException
- if there is a problem completing the callpublic boolean setTransactionTimeout(int seconds) throws javax.transaction.xa.XAException
seconds
- timeout in secondsjavax.transaction.xa.XAException
- if there is a problem completing the callpublic java.lang.String getResourceManagerId() throws javax.transaction.xa.XAException
javax.transaction.xa.XAException
- if there is a problem completing the call
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |