org.jboss.jms.client.remoting
Class MessageCallbackHandler

java.lang.Object
  extended byorg.jboss.jms.client.remoting.MessageCallbackHandler

public class MessageCallbackHandler
extends java.lang.Object

Version:
$Revision: 1661 $ $Id: MessageCallbackHandler.java 1661 2006-11-30 08:01:35Z ovidiu.feodorov@jboss.com $
Author:
Ovidiu Feodorov, Tim Fox/a>

Constructor Summary
MessageCallbackHandler(boolean isCC, int ackMode, SessionDelegate sess, ConsumerDelegate cons, int consumerID, int bufferSize, QueuedExecutor sessionExecutor, int maxDeliveries)
           
 
Method Summary
 void addToFrontOfBuffer(MessageProxy proxy)
           
static void callOnMessage(SessionDelegate sess, MessageListener listener, int consumerID, boolean isConnectionConsumer, MessageProxy m, int ackMode, int maxDeliveries)
           
 void close()
           
 int getConsumerId()
           
protected  MessageProxy getMessage(long timeout)
           
 MessageListener getMessageListener()
           
 HandleMessageResponse handleMessage(java.util.List msgs)
          Handles a list of messages sent from the server
protected static void postDeliver(SessionDelegate sess, boolean isConnectionConsumer, boolean cancel)
           
protected static void preDeliver(SessionDelegate sess, int consumerID, MessageProxy m, boolean isConnectionConsumer)
           
protected  void processMessages(java.util.List msgs)
           
 MessageProxy receive(long timeout)
          Method used by the client thread to get a Message, if available.
 void setMessageListener(MessageListener listener)
           
 java.lang.String toString()
           
protected  long waitOnLock(java.lang.Object lock, long waitTime)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MessageCallbackHandler

public MessageCallbackHandler(boolean isCC,
                              int ackMode,
                              SessionDelegate sess,
                              ConsumerDelegate cons,
                              int consumerID,
                              int bufferSize,
                              QueuedExecutor sessionExecutor,
                              int maxDeliveries)
Method Detail

callOnMessage

public static void callOnMessage(SessionDelegate sess,
                                 MessageListener listener,
                                 int consumerID,
                                 boolean isConnectionConsumer,
                                 MessageProxy m,
                                 int ackMode,
                                 int maxDeliveries)
                          throws JMSException
Throws:
JMSException

preDeliver

protected static void preDeliver(SessionDelegate sess,
                                 int consumerID,
                                 MessageProxy m,
                                 boolean isConnectionConsumer)
                          throws JMSException
Throws:
JMSException

postDeliver

protected static void postDeliver(SessionDelegate sess,
                                  boolean isConnectionConsumer,
                                  boolean cancel)
                           throws JMSException
Throws:
JMSException

handleMessage

public HandleMessageResponse handleMessage(java.util.List msgs)
                                    throws HandleCallbackException
Handles a list of messages sent from the server

Parameters:
msgs - The list of messages
Returns:
The number of messages handled (placeholder for future - now we always accept all messages) or -1 if closed
Throws:
HandleCallbackException

setMessageListener

public void setMessageListener(MessageListener listener)
                        throws JMSException
Throws:
JMSException

close

public void close()
           throws JMSException
Throws:
JMSException

receive

public MessageProxy receive(long timeout)
                     throws JMSException
Method used by the client thread to get a Message, if available.

Parameters:
timeout - - the timeout value in milliseconds. A zero timeount never expires, and the call blocks indefinitely. A -1 timeout means receiveNoWait(): return the next message or null if one is not immediately available. Returns null if the consumer is concurrently closed.
Throws:
JMSException

getMessageListener

public MessageListener getMessageListener()

toString

public java.lang.String toString()

getConsumerId

public int getConsumerId()

addToFrontOfBuffer

public void addToFrontOfBuffer(MessageProxy proxy)

waitOnLock

protected long waitOnLock(java.lang.Object lock,
                          long waitTime)
                   throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

getMessage

protected MessageProxy getMessage(long timeout)
                           throws JMSException
Throws:
JMSException

processMessages

protected void processMessages(java.util.List msgs)


Copyright © 2006 JBoss Inc. All Rights Reserved.