org.jboss.jms.server.endpoint
Class ServerConsumerEndpoint

java.lang.Object
  extended byorg.jboss.jms.server.endpoint.ServerConsumerEndpoint
All Implemented Interfaces:
Closeable, ConsumerEndpoint, Filter, Receiver, java.io.Serializable

public class ServerConsumerEndpoint
extends java.lang.Object
implements Receiver, Filter, ConsumerEndpoint

Concrete implementation of ConsumerEndpoint. Lives on the boundary between Messaging Core and the JMS Facade.

Version:
$Revision: 2594 $ $Id: ServerConsumerEndpoint.java 2594 2007-04-20 15:44:23Z timfox $
Author:
Ovidiu Feodorov, Tim Fox
See Also:
Serialized Form

Constructor Summary
protected ServerConsumerEndpoint(int id, Channel channel, ServerSessionEndpoint sessionEndpoint, java.lang.String selector, boolean noLocal, JBossDestination dest, int prefetchSize, CoreDestination dlq)
           
 
Method Summary
 boolean accept(Routable r)
          Tests whether the routable should be accepted.
protected  void acknowledge(long messageID)
           
protected  void acknowledgeTransactionally(long messageID, Transaction tx)
           
protected  void cancelDelivery(java.lang.Long messageID, int deliveryCount)
           
 void close()
          Close the instance
 void closing()
          Tell the instance to prepare to close
 JBossDestination getDestination()
           
 int getId()
           
 ServerSessionEndpoint getSessionEndpoint()
           
 Delivery handle(DeliveryObserver observer, Routable reference, Transaction tx)
          A receiver can return an active, "done" or null delivery.
 boolean isClosed()
           
 void more()
          If the client buffer has previously become full because the server was sending at a faster rate than the client could consume, then the server will stop sending messages.
protected  void promptDelivery()
           
protected  void remove()
          Actually remove the consumer and clear up any deliveries it may have This is called by the session on session.close() We can get rid of this when we store the deliveries on the session
protected  void sendToDLQ(java.lang.Long messageID, Transaction tx)
           
protected  void start()
           
protected  void stop()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServerConsumerEndpoint

protected ServerConsumerEndpoint(int id,
                                 Channel channel,
                                 ServerSessionEndpoint sessionEndpoint,
                                 java.lang.String selector,
                                 boolean noLocal,
                                 JBossDestination dest,
                                 int prefetchSize,
                                 CoreDestination dlq)
                          throws InvalidSelectorException
Method Detail

handle

public Delivery handle(DeliveryObserver observer,
                       Routable reference,
                       Transaction tx)
Description copied from interface: Receiver
A receiver can return an active, "done" or null delivery. The method returns null in case the receiver doesn't accept the message. The return value is unspecified when the message is submitted in the context of a transaction (tx not null).

Specified by:
handle in interface Receiver
Parameters:
observer - - the component the delivery should be acknowledged to.
See Also:
Delivery, DeliveryObserver

accept

public boolean accept(Routable r)
Description copied from interface: Filter
Tests whether the routable should be accepted.

Specified by:
accept in interface Filter
Returns:
true if the Filter accepts the routable - i.e. let's it pass.

closing

public void closing()
             throws JMSException
Description copied from interface: Closeable
Tell the instance to prepare to close

Specified by:
closing in interface Closeable
Throws:
JMSException

close

public void close()
           throws JMSException
Description copied from interface: Closeable
Close the instance

Specified by:
close in interface Closeable
Throws:
JMSException

isClosed

public boolean isClosed()
Specified by:
isClosed in interface Closeable

more

public void more()
          throws JMSException
Description copied from interface: ConsumerEndpoint
If the client buffer has previously become full because the server was sending at a faster rate than the client could consume, then the server will stop sending messages. When the client has emptied the buffer it then needs to inform the server that it can receive more messages by calling this method

Specified by:
more in interface ConsumerEndpoint
Throws:
JMSException

toString

public java.lang.String toString()

getDestination

public JBossDestination getDestination()

getSessionEndpoint

public ServerSessionEndpoint getSessionEndpoint()

getId

public int getId()

acknowledgeTransactionally

protected void acknowledgeTransactionally(long messageID,
                                          Transaction tx)
                                   throws java.lang.Throwable
Throws:
java.lang.Throwable

acknowledge

protected void acknowledge(long messageID)
                    throws java.lang.Throwable
Throws:
java.lang.Throwable

remove

protected void remove()
               throws java.lang.Throwable
Actually remove the consumer and clear up any deliveries it may have This is called by the session on session.close() We can get rid of this when we store the deliveries on the session

Throws:
java.lang.Throwable

promptDelivery

protected void promptDelivery()

sendToDLQ

protected void sendToDLQ(java.lang.Long messageID,
                         Transaction tx)
                  throws java.lang.Throwable
Throws:
java.lang.Throwable

cancelDelivery

protected void cancelDelivery(java.lang.Long messageID,
                              int deliveryCount)
                       throws java.lang.Throwable
Throws:
java.lang.Throwable

start

protected void start()

stop

protected void stop()
             throws java.lang.Throwable
Throws:
java.lang.Throwable


Copyright © 2006 JBoss Inc. All Rights Reserved.