|
||||||||
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.JmsTopicSession | +--org.exolab.jms.client.JmsXATopicSession
XATopicSession
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 |
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 |
addPublisher(org.exolab.jms.client.JmsTopicPublisher publisher)
Register a publisher |
protected void |
addSubscriber(org.exolab.jms.client.JmsTopicSubscriber subscriber,
java.lang.String name)
Register a subscriber |
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.BytesMessage |
createBytesMessage()
Create a BytesMessage |
javax.jms.TopicSubscriber |
createDurableSubscriber(javax.jms.Topic topic,
java.lang.String name)
Create a durable subscriber for the specified topic |
javax.jms.TopicSubscriber |
createDurableSubscriber(javax.jms.Topic topic,
java.lang.String name,
java.lang.String selector,
boolean noLocal)
Create a durable subscriber for the specified topic |
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.TopicPublisher |
createPublisher(javax.jms.Topic topic)
Create a publisher for the specified topic. |
javax.jms.StreamMessage |
createStreamMessage()
Create a StreamMessage |
javax.jms.TopicSubscriber |
createSubscriber(javax.jms.Topic topic)
Create a non-durable subscriber for the specified topic |
javax.jms.TopicSubscriber |
createSubscriber(javax.jms.Topic topic,
java.lang.String selector,
boolean noLocal)
Create a non-durable subscriber for the specified topic |
javax.jms.TemporaryTopic |
createTemporaryTopic()
Create a temporary topic. |
javax.jms.TextMessage |
createTextMessage()
Create a TextMessage |
javax.jms.TextMessage |
createTextMessage(java.lang.String text)
Create a TextMessage |
javax.jms.Topic |
createTopic(java.lang.String topicName)
Create a topic identity given its name |
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 |
long |
getResourceManagerId()
Return the identity of the associated resource manager. |
java.lang.String |
getSessionId()
Returns the session identifier |
javax.jms.TopicSession |
getTopicSession()
|
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 |
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 |
removePublisher(org.exolab.jms.client.JmsTopicPublisher publisher)
Deregister a publisher |
protected void |
removeSubscriber(org.exolab.jms.client.JmsTopicSubscriber subscriber)
Deregister azsubscriber |
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. |
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 |
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.TopicSession getTopicSession() throws javax.jms.JMSException
getTopicSession
in interface javax.jms.XATopicSession
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.Topic createTopic(java.lang.String topicName) throws javax.jms.JMSException
createTopic
in interface javax.jms.TopicSession
topicName
- the topic namejavax.jms.JMSException
- if the topic can't be createdpublic javax.jms.TopicSubscriber createSubscriber(javax.jms.Topic topic) throws javax.jms.JMSException
createSubscriber
in interface javax.jms.TopicSession
topic
- the topic to subscriber tojavax.jms.JMSException
- if the subscriber cannot be createdpublic javax.jms.TopicSubscriber createSubscriber(javax.jms.Topic topic, java.lang.String selector, boolean noLocal) throws javax.jms.JMSException
createSubscriber
in interface javax.jms.TopicSession
topic
- the topic to subscriber toselector
- the message selector to filter messages.
May be null
noLocal
- if true
, inhibits the delivery of messages
published by its own connectionjavax.jms.JMSException
- if the subscriber cannot be createdpublic javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, java.lang.String name) throws javax.jms.JMSException
createDurableSubscriber
in interface javax.jms.TopicSession
topic
- the topic to subscribe toname
- the durable subscription namejavax.jms.JMSException
- if the subscriber can't be createdpublic javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, java.lang.String name, java.lang.String selector, boolean noLocal) throws javax.jms.JMSException
createDurableSubscriber
in interface javax.jms.TopicSession
topic
- the topic to subscribe toname
- the durable subscription nameselector
- the message selector to filter messages.
May be null
noLocal
- if true
, inhibits the delivery of messages
published by its own connectionjavax.jms.JMSException
- if the subscriber can't be createdpublic javax.jms.TopicPublisher createPublisher(javax.jms.Topic topic) throws javax.jms.JMSException
createPublisher
in interface javax.jms.TopicSession
topic
- the topic to publish to, or null
if this is an
unidentified producerjavax.jms.JMSException
- if the publisher can't be createdpublic javax.jms.TemporaryTopic createTemporaryTopic() throws javax.jms.JMSException
createTemporaryTopic
in interface javax.jms.TopicSession
javax.jms.JMSException
- if the topic cannot be createdpublic void unsubscribe(java.lang.String name) throws javax.jms.JMSException
unsubscribe
in interface javax.jms.TopicSession
name
- the durable subscription namejavax.jms.JMSException
- if the durable subscription can't be removedprotected void addSubscriber(org.exolab.jms.client.JmsTopicSubscriber subscriber, java.lang.String name) throws javax.jms.JMSException
subscriber
- the subscriber to registername
- durable subscription name, for durable subscribers,
null
otherwise.javax.jms.JMSException
- if the subscriber cannot be registered with the
serverprotected void addPublisher(org.exolab.jms.client.JmsTopicPublisher publisher) throws javax.jms.JMSException
publisher
- the publisher to registerjavax.jms.JMSException
- if the publisher cannot be registered with the
serverprotected void removeSubscriber(org.exolab.jms.client.JmsTopicSubscriber subscriber) throws javax.jms.JMSException
subscriber
- the subscriber to deregisterjavax.jms.JMSException
- if the subscriber cannot be deregistered from the
serverprotected void removePublisher(org.exolab.jms.client.JmsTopicPublisher publisher)
publisher
- the publisher to deregisterpublic 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 |