|
||||||||||
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
The JmsTopicSession extends JmsSession and implements TopicSession. It is a client side representation of a JMS session.
Fields inherited from interface javax.jms.Session |
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE |
Method Summary | |
void |
acknowledgeMessage(javax.jms.Message message)
Acknowledge the specified message. |
protected void |
addConsumer(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(JmsMessageProducer producer)
Add a producer to the list of producers managed by this session |
protected void |
addPublisher(JmsTopicPublisher publisher)
Add the specified publisher to the list of managed publishers. |
protected void |
addSubscriber(JmsTopicSubscriber subscriber,
java.lang.String name)
Add the specified subscriber to the list of managed subscribers. |
protected boolean |
checkForValidTemporaryDestination(JmsDestination destination)
This method checks the destination. |
void |
close()
|
void |
commit()
|
javax.jms.BytesMessage |
createBytesMessage()
|
javax.jms.TopicSubscriber |
createDurableSubscriber(javax.jms.Topic topic,
java.lang.String name)
|
javax.jms.TopicSubscriber |
createDurableSubscriber(javax.jms.Topic topic,
java.lang.String name,
java.lang.String selector,
boolean noLocal)
|
javax.jms.MapMessage |
createMapMessage()
|
javax.jms.Message |
createMessage()
|
javax.jms.ObjectMessage |
createObjectMessage()
|
javax.jms.ObjectMessage |
createObjectMessage(java.io.Serializable object)
|
javax.jms.TopicPublisher |
createPublisher(javax.jms.Topic topic)
|
javax.jms.StreamMessage |
createStreamMessage()
|
javax.jms.TopicSubscriber |
createSubscriber(javax.jms.Topic topic)
|
javax.jms.TopicSubscriber |
createSubscriber(javax.jms.Topic topic,
java.lang.String selector,
boolean noLocal)
|
javax.jms.TemporaryTopic |
createTemporaryTopic()
|
javax.jms.TextMessage |
createTextMessage()
|
javax.jms.TextMessage |
createTextMessage(java.lang.String text)
|
javax.jms.Topic |
createTopic(java.lang.String topicName)
|
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 |
execute(java.lang.Object object)
This is the called to process messages asynchronously delivered by the server. |
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()
|
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 |
java.lang.String |
getSessionId()
Returns the session identifier |
boolean |
getTransacted()
|
protected boolean |
isClosed()
Check if the session is closed |
void |
onMessage(javax.jms.Message message)
|
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)
Send the specified collection of messages to the client |
void |
recover()
|
protected void |
removeConsumer(JmsMessageConsumer consumer)
Remove the consumer with the specified id from the list of managed consumers |
void |
removeMessageListener(JmsMessageConsumer listener)
Remove the message listener for the specified destination |
protected void |
removeProducer(JmsMessageProducer producer)
Remove the producer from the list of managed producers |
protected void |
removePublisher(JmsTopicPublisher publisher)
Remove the specified publisher form the list of managed publishers. |
protected void |
removeSubscriber(JmsTopicSubscriber subscriber)
Remove the specified subscriber form the list of managed subscribers. |
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()
|
void |
run()
|
protected void |
sendMessage(javax.jms.Message message)
Send the specified message to the server. |
void |
setMessageListener(JmsMessageConsumer listener)
This will set the message listener for a particular consumer. |
void |
setMessageListener(javax.jms.MessageListener listener)
|
void |
start()
This will start message delivery to this session. |
void |
stop()
This will stop message delivery to this session. |
void |
unsubscribe(java.lang.String name)
|
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, commit, createBytesMessage, createMapMessage, createMessage, createObjectMessage, createObjectMessage, createStreamMessage, createTextMessage, createTextMessage, getMessageListener, getTransacted, recover, rollback, run, setMessageListener |
Method Detail |
public javax.jms.Topic createTopic(java.lang.String topicName) throws javax.jms.JMSException
createTopic
in interface javax.jms.TopicSession
public javax.jms.TopicSubscriber createSubscriber(javax.jms.Topic topic) throws javax.jms.JMSException
createSubscriber
in interface javax.jms.TopicSession
public javax.jms.TopicSubscriber createSubscriber(javax.jms.Topic topic, java.lang.String selector, boolean noLocal) throws javax.jms.JMSException
createSubscriber
in interface javax.jms.TopicSession
public javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, java.lang.String name) throws javax.jms.JMSException
createDurableSubscriber
in interface javax.jms.TopicSession
public 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
public javax.jms.TopicPublisher createPublisher(javax.jms.Topic topic) throws javax.jms.JMSException
createPublisher
in interface javax.jms.TopicSession
public javax.jms.TemporaryTopic createTemporaryTopic() throws javax.jms.JMSException
createTemporaryTopic
in interface javax.jms.TopicSession
public void unsubscribe(java.lang.String name) throws javax.jms.JMSException
unsubscribe
in interface javax.jms.TopicSession
protected void addSubscriber(JmsTopicSubscriber subscriber, java.lang.String name) throws javax.jms.JMSException
The consumer name can be null for non-durable subscribers.
consumer
- consumer to addprotected void addPublisher(JmsTopicPublisher publisher) throws javax.jms.JMSException
If the publisher is for a temporary topic then we need to register this with connection. All temporary topic message processing happens locally
publisher
- publisher to addprotected void removeSubscriber(JmsTopicSubscriber subscriber) throws javax.jms.JMSException
This method will not clean up the server side reciever until the session is closed.
subscriber
- subscriber to removeprotected void removePublisher(JmsTopicPublisher publisher) throws javax.jms.JMSException
publisher
- publisher to removepublic javax.jms.BytesMessage createBytesMessage() throws javax.jms.JMSException
createBytesMessage
in interface javax.jms.Session
public javax.jms.MapMessage createMapMessage() throws javax.jms.JMSException
createMapMessage
in interface javax.jms.Session
public javax.jms.Message createMessage() throws javax.jms.JMSException
createMessage
in interface javax.jms.Session
public javax.jms.ObjectMessage createObjectMessage() throws javax.jms.JMSException
createObjectMessage
in interface javax.jms.Session
public javax.jms.ObjectMessage createObjectMessage(java.io.Serializable object) throws javax.jms.JMSException
createObjectMessage
in interface javax.jms.Session
public javax.jms.StreamMessage createStreamMessage() throws javax.jms.JMSException
createStreamMessage
in interface javax.jms.Session
public javax.jms.TextMessage createTextMessage() throws javax.jms.JMSException
createTextMessage
in interface javax.jms.Session
public javax.jms.TextMessage createTextMessage(java.lang.String text) throws javax.jms.JMSException
createTextMessage
in interface javax.jms.Session
public boolean getTransacted() throws javax.jms.JMSException
getTransacted
in interface javax.jms.Session
public void commit() throws javax.jms.JMSException
commit
in interface javax.jms.Session
public void rollback() throws javax.jms.JMSException
rollback
in interface javax.jms.Session
public void close() throws javax.jms.JMSException
close
in interface javax.jms.Session
public void recover() throws javax.jms.JMSException
recover
in interface javax.jms.Session
public javax.jms.MessageListener getMessageListener() throws javax.jms.JMSException
getMessageListener
in interface javax.jms.Session
public void setMessageListener(javax.jms.MessageListener listener) throws javax.jms.JMSException
setMessageListener
in interface javax.jms.Session
public void run()
run
in interface javax.jms.Session
public void setMessageListener(JmsMessageConsumer listener) throws javax.jms.JMSException
If a listener is already registered for the consumer, it will be automatically overwritten
listener
- the message listenerpublic void removeMessageListener(JmsMessageConsumer listener) throws javax.jms.JMSException
listener
- the message listenerpublic void start() throws javax.jms.JMSException
javax.jms.IllegalStateException
- if the session is closedjavax.jms.JMSException
- if message delivery can't be startedpublic void stop() throws javax.jms.JMSException
javax.jms.IllegalStateException
- if the session is closedjavax.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
- public void onMessage(javax.jms.Message message)
onMessage
in interface javax.jms.MessageListener
public void onMessages(java.util.Vector messages)
JmsMessageListener
onMessages
in interface JmsMessageListener
org.exolab.jms.client.JmsMessageListener
messages
- - collection of MessageHandle objectspublic void onMessageAvailable(long clientId)
JmsMessageListener
onMessageAvailable
in interface JmsMessageListener
org.exolab.jms.client.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()
protected 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(JmsMessageConsumer consumer)
consumer
- the consumer to addprotected void removeConsumer(JmsMessageConsumer consumer)
id
- - the consumer id to removeprotected void addProducer(JmsMessageProducer producer)
producer
- - the producer to addprotected void removeProducer(JmsMessageProducer producer)
producer
- - the producer to removeprotected final boolean isClosed()
true
if the session is closedpublic 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
- public void destroy() throws javax.jms.JMSException
javax.jms.JMSException
- - if there is a problem completing this requestprotected void addMessage(javax.jms.Message message)
message
- the message to add.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |