|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.exolab.jms.client.net.JmsSessionStubImpl
Wraps an ServerSession
.
Constructor Summary | |
protected |
JmsSessionStubImpl(ServerSession session,
org.exolab.jms.net.orb.ORB orb,
java.lang.String uri,
java.lang.String principal,
java.lang.String credentials)
Construct a new JmsSessionStubImpl . |
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. |
boolean |
onMessage(MessageImpl message)
Deliver a message. |
void |
onMessageAvailable()
Inform the session that there is a message available for a synchronous consumer. |
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. |
void |
stop()
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 |
Constructor Detail |
protected JmsSessionStubImpl(ServerSession session, org.exolab.jms.net.orb.ORB orb, java.lang.String uri, java.lang.String principal, java.lang.String credentials) throws java.rmi.RemoteException
JmsSessionStubImpl
.session
- the reference to the server sessionorb
- the ORB to export this withuri
- the URI to export this onprincipal
- the security principal. May be null
credentials
- the security credentials. May be null
Method Detail |
public void close() throws javax.jms.JMSException
close
in interface ServerSession
javax.jms.JMSException
- for any JMS errorpublic void acknowledgeMessage(long consumerId, java.lang.String messageId) throws javax.jms.JMSException
acknowledgeMessage
in interface ServerSession
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
send
in interface ServerSession
message
- the message to sendjavax.jms.JMSException
- for any errorpublic void send(java.util.List messages) throws javax.jms.JMSException
send
in interface ServerSession
messages
- a list of MessageImpl
instancesjavax.jms.JMSException
- for any JMS errorpublic MessageImpl receiveNoWait(long consumerId) throws javax.jms.JMSException
receiveNoWait
in interface ServerSession
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.receive
in interface ServerSession
consumerId
- the consumer identifierwait
- number of milliseconds to wait. A value of 0
indicates to wait indefinitelynull
if none is availablejavax.jms.JMSException
- for any JMS errorpublic java.util.List browse(long consumerId, int count) throws javax.jms.JMSException
browse
in interface ServerSession
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
createConsumer
in interface ServerSession
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.createDurableConsumer
in interface ServerSession
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
createBrowser
in interface ServerSession
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
closeConsumer
in interface ServerSession
consumerId
- the identity of the consumer to closejavax.jms.JMSException
- for any JMS errorpublic void unsubscribe(java.lang.String name) throws javax.jms.JMSException
unsubscribe
in interface ServerSession
name
- the name used to identify the subscriptionjavax.jms.JMSException
- for any JMS errorpublic void start() throws javax.jms.JMSException
start
in interface ServerSession
javax.jms.JMSException
- for any JMS errorpublic void stop() throws javax.jms.JMSException
stop
in interface ServerSession
javax.jms.JMSException
- for any JMS errorpublic void setMessageListener(JmsMessageListener listener)
setMessageListener
in interface ServerSession
listener
- the message listenerpublic void setAsynchronous(long consumerId, boolean enable) throws javax.jms.JMSException
setAsynchronous
in interface ServerSession
consumerId
- the consumer identifierenable
- true to enable; false to disablejavax.jms.JMSException
- for any JMS errorpublic void recover() throws javax.jms.JMSException
recover
in interface ServerSession
javax.jms.JMSException
- if the session cannot be recoveredpublic void commit() throws javax.jms.JMSException
commit
in interface ServerSession
javax.jms.JMSException
- if the session cannot be committedpublic void rollback() throws javax.jms.JMSException
rollback
in interface ServerSession
javax.jms.JMSException
- if the session cannot be rolled backpublic void start(javax.transaction.xa.Xid xid, int flags) throws javax.transaction.xa.XAException
start
in interface ServerSession
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
prepare
in interface ServerSession
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
commit
in interface ServerSession
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
end
in interface ServerSession
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
forget
in interface ServerSession
xid
- the xa transaction identityjavax.transaction.xa.XAException
- if there is a problem completing the callpublic void rollback(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
rollback
in interface ServerSession
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
recover
in interface ServerSession
flag
- One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGSjavax.transaction.xa.XAException
- - if there is a problem completing the callpublic int getTransactionTimeout() throws javax.transaction.xa.XAException
getTransactionTimeout
in interface ServerSession
javax.transaction.xa.XAException
- if there is a problem completing the callpublic boolean setTransactionTimeout(int seconds) throws javax.transaction.xa.XAException
setTransactionTimeout
in interface ServerSession
seconds
- timeout in secondsjavax.transaction.xa.XAException
- if there is a problem completing the callpublic java.lang.String getResourceManagerId() throws javax.transaction.xa.XAException
getResourceManagerId
in interface ServerSession
javax.transaction.xa.XAException
- if there is a problem completing the callpublic boolean onMessage(MessageImpl message) throws java.rmi.RemoteException
onMessage
in interface JmsMessageListener
message
- the message to deliverjava.rmi.RemoteException
- if the message can't be deliveredpublic void onMessageAvailable() throws java.rmi.RemoteException
onMessageAvailable
in interface JmsMessageListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |