站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 messaging API Documentation 英文版文档

SpyMessageConsumer (JBoss Messaging API) - JBoss 4.0.1 sp1 messaging API Documentation 英文版文档


org.jboss.mq
Class SpyMessageConsumer

java.lang.Object
  extended byorg.jboss.mq.SpyMessageConsumer
All Implemented Interfaces:
javax.jms.MessageConsumer, Runnable, SpyConsumer
Direct Known Subclasses:
SpyQueueReceiver, SpyTopicSubscriber

public class SpyMessageConsumer
extends Object
implements javax.jms.MessageConsumer, SpyConsumer, Runnable

This class implements javax.jms.MessageConsumer.

Version:
$Revision: 1.33.2.1 $
Author:
Norbert Lataille (Norbert.Lataille@m4x.org), Hiram Chirino (Cojonudo14@hotmail.com), David Maplesden (David.Maplesden@orion.co.nz), Adrian Brock

Field Summary
protected  boolean closed
          Are we closed ?
protected  Thread listenerThread
          The listener thread
protected  boolean listening
          Are we listening
protected  boolean receiving
          Are we receiving a message
 SpySession session
          Link to my session
protected  Object stateLock
          The state lock
 Subscription subscription
          The subscription structure should be fill out by the descendent
protected  boolean waitingForMessage
          Are we waiting for a message
 
Method Summary
 void addMessage(SpyMessage message)
          Add a message
 void close()
           
 javax.jms.MessageListener getMessageListener()
           
 String getMessageSelector()
           
 Subscription getSubscription()
          Get the subscription
protected  boolean isListening()
          Are we listening
 javax.jms.Message receive()
           
 javax.jms.Message receive(long timeOut)
           
 javax.jms.Message receiveNoWait()
           
 void restartProcessing()
          Restarts the processing of the messages in case of a recovery
 void run()
           
protected  void sessionConsumerProcessMessage(SpyMessage message)
           
 void setMessageListener(javax.jms.MessageListener listener)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

session

public SpySession session
Link to my session


subscription

public Subscription subscription
The subscription structure should be fill out by the descendent


closed

protected boolean closed
Are we closed ?


stateLock

protected Object stateLock
The state lock


receiving

protected boolean receiving
Are we receiving a message


waitingForMessage

protected boolean waitingForMessage
Are we waiting for a message


listening

protected boolean listening
Are we listening


listenerThread

protected Thread listenerThread
The listener thread

Method Detail

getSubscription

public Subscription getSubscription()
Get the subscription

Specified by:
getSubscription in interface SpyConsumer
Returns:
the subscription

addMessage

public void addMessage(SpyMessage message)
                throws javax.jms.JMSException
Add a message

Specified by:
addMessage in interface SpyConsumer
Parameters:
message - the message to add
Throws:
javax.jms.JMSException - for any error

restartProcessing

public void restartProcessing()
Restarts the processing of the messages in case of a recovery


setMessageListener

public void setMessageListener(javax.jms.MessageListener listener)
                        throws javax.jms.JMSException
Specified by:
setMessageListener in interface javax.jms.MessageConsumer
Throws:
javax.jms.JMSException

getMessageSelector

public String getMessageSelector()
                          throws javax.jms.JMSException
Specified by:
getMessageSelector in interface javax.jms.MessageConsumer
Throws:
javax.jms.JMSException

getMessageListener

public javax.jms.MessageListener getMessageListener()
                                             throws javax.jms.JMSException
Specified by:
getMessageListener in interface javax.jms.MessageConsumer
Throws:
javax.jms.JMSException

receive

public javax.jms.Message receive()
                          throws javax.jms.JMSException
Specified by:
receive in interface javax.jms.MessageConsumer
Throws:
javax.jms.JMSException

receive

public javax.jms.Message receive(long timeOut)
                          throws javax.jms.JMSException
Specified by:
receive in interface javax.jms.MessageConsumer
Throws:
javax.jms.JMSException

receiveNoWait

public javax.jms.Message receiveNoWait()
                                throws javax.jms.JMSException
Specified by:
receiveNoWait in interface javax.jms.MessageConsumer
Throws:
javax.jms.JMSException

close

public void close()
           throws javax.jms.JMSException
Specified by:
close in interface javax.jms.MessageConsumer
Throws:
javax.jms.JMSException

run

public void run()
Specified by:
run in interface Runnable

toString

public String toString()

isListening

protected boolean isListening()
Are we listening

Returns:
true when listening, false otherwise

sessionConsumerProcessMessage

protected void sessionConsumerProcessMessage(SpyMessage message)
                                      throws javax.jms.JMSException
Throws:
javax.jms.JMSException


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.