|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.exolab.jms.client.JmsMessageConsumer
This is an abstract class that defines the generic behaviour of a consumer. A consumer is created and controlled through a session
Instances of these class pertain to a Destination, whether it is a queue or a topic. In addition a consumer can only be created through a valid session.
JmsQueueReceiver
Field Summary | |
protected org.exolab.jms.client.JmsSession |
_session
A consumer needs to be allocated through the session. |
Method Summary | |
void |
close()
|
void |
destroy()
Release all resources used by this consumer |
long |
getClientId()
Return the session allocated consumer identifier |
java.lang.String |
getConsumerId()
This accessor will return a reference to the consumer id. |
abstract JmsDestination |
getJmsDestination()
This is an anstratc message that returns a reference to the destination |
java.lang.String |
getLastMessageDelivered()
Return the last message asynchronously delivered to the consumer |
javax.jms.MessageListener |
getMessageListener()
|
java.lang.String |
getMessageSelector()
|
boolean |
isClosed()
Determines if the consumer is closed |
void |
onMessage(javax.jms.Message message)
Whenever a message is received for this destination it is processed as follows. |
javax.jms.Message |
receive()
|
javax.jms.Message |
receive(long timeout)
|
javax.jms.Message |
receiveNoWait()
|
javax.jms.Message |
retrieveMessage(long wait)
This method will make a synchronous call to the server and retrieve the first message in the cache. |
void |
setMessageListener(javax.jms.MessageListener listener)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected org.exolab.jms.client.JmsSession _session
Method Detail |
public java.lang.String getConsumerId()
public long getClientId()
public java.lang.String getMessageSelector() throws javax.jms.JMSException
getMessageSelector
in interface javax.jms.MessageConsumer
public javax.jms.MessageListener getMessageListener() throws javax.jms.JMSException
getMessageListener
in interface javax.jms.MessageConsumer
public void setMessageListener(javax.jms.MessageListener listener) throws javax.jms.JMSException
setMessageListener
in interface javax.jms.MessageConsumer
public javax.jms.Message receive() throws javax.jms.JMSException
receive
in interface javax.jms.MessageConsumer
public javax.jms.Message receive(long timeout) throws javax.jms.JMSException
receive
in interface javax.jms.MessageConsumer
public javax.jms.Message receiveNoWait() throws javax.jms.JMSException
receiveNoWait
in interface javax.jms.MessageConsumer
public void close() throws javax.jms.JMSException
close
in interface javax.jms.MessageConsumer
public void destroy() throws javax.jms.JMSException
javax.jms.JMSException
- public void onMessage(javax.jms.Message message)
onMessage
in interface javax.jms.MessageListener
message
- message receivedpublic javax.jms.Message retrieveMessage(long wait) throws javax.jms.JMSException
If there are any problems then return JMSException
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 message,
the session is closed, or a message listener is set.public java.lang.String getLastMessageDelivered()
public boolean isClosed()
true
if the consumer is closedpublic abstract JmsDestination getJmsDestination()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |