org.jboss.messaging.core.server.impl
Class ServerConsumerImpl

java.lang.Object
  extended by org.jboss.messaging.core.server.impl.ServerConsumerImpl
All Implemented Interfaces:
Consumer, ServerConsumer

public class ServerConsumerImpl
extends java.lang.Object
implements ServerConsumer

Concrete implementation of a ClientConsumer.

Version:
$Revision: 3783 $ $Id: ServerConsumerImpl.java 3783 2008-02-25 12:15:14Z timfox $
Author:
Tim Fox, Jeff Mesnil, Clebert Suconic

Constructor Summary
ServerConsumerImpl(long id, long replicatedSessionID, ServerSession session, QueueBinding binding, Filter filter, boolean started, boolean browseOnly, StorageManager storageManager, PagingManager pagingManager, Channel channel, Channel replicatingChannel, boolean preAcknowledge, boolean updateDeliveries, java.util.concurrent.Executor executor, ManagementService managementService)
           
 
Method Summary
 void acknowledge(boolean autoCommitAcks, Transaction tx, long messageID)
           
 java.util.LinkedList<MessageReference> cancelRefs(boolean lastConsumedAsDelivered, Transaction tx)
           
 void close()
           
 void deliverReplicated(long messageID)
           
 void failedOver()
           
 java.util.concurrent.atomic.AtomicInteger getAvailableCredits()
          To be used on tests only
 int getCountOfPendingDeliveries()
           
 MessageReference getExpired(long messageID)
           
 Filter getFilter()
           
 long getID()
           
 Queue getQueue()
           
 HandleStatus handle(MessageReference ref)
           
 void lock()
           
 void receiveCredits(int credits)
           
 void setStarted(boolean started)
           
 void unlock()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerConsumerImpl

public ServerConsumerImpl(long id,
                          long replicatedSessionID,
                          ServerSession session,
                          QueueBinding binding,
                          Filter filter,
                          boolean started,
                          boolean browseOnly,
                          StorageManager storageManager,
                          PagingManager pagingManager,
                          Channel channel,
                          Channel replicatingChannel,
                          boolean preAcknowledge,
                          boolean updateDeliveries,
                          java.util.concurrent.Executor executor,
                          ManagementService managementService)
                   throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

getID

public long getID()
Specified by:
getID in interface ServerConsumer

handle

public HandleStatus handle(MessageReference ref)
                    throws java.lang.Exception
Specified by:
handle in interface Consumer
Throws:
java.lang.Exception

getFilter

public Filter getFilter()
Specified by:
getFilter in interface Consumer

close

public void close()
           throws java.lang.Exception
Specified by:
close in interface ServerConsumer
Throws:
java.lang.Exception

getCountOfPendingDeliveries

public int getCountOfPendingDeliveries()
Specified by:
getCountOfPendingDeliveries in interface ServerConsumer

cancelRefs

public java.util.LinkedList<MessageReference> cancelRefs(boolean lastConsumedAsDelivered,
                                                         Transaction tx)
                                                  throws java.lang.Exception
Specified by:
cancelRefs in interface ServerConsumer
Throws:
java.lang.Exception

setStarted

public void setStarted(boolean started)
Specified by:
setStarted in interface ServerConsumer

receiveCredits

public void receiveCredits(int credits)
                    throws java.lang.Exception
Specified by:
receiveCredits in interface ServerConsumer
Throws:
java.lang.Exception

getQueue

public Queue getQueue()
Specified by:
getQueue in interface ServerConsumer

acknowledge

public void acknowledge(boolean autoCommitAcks,
                        Transaction tx,
                        long messageID)
                 throws java.lang.Exception
Specified by:
acknowledge in interface ServerConsumer
Throws:
java.lang.Exception

getExpired

public MessageReference getExpired(long messageID)
                            throws java.lang.Exception
Specified by:
getExpired in interface ServerConsumer
Throws:
java.lang.Exception

deliverReplicated

public void deliverReplicated(long messageID)
                       throws java.lang.Exception
Specified by:
deliverReplicated in interface ServerConsumer
Throws:
java.lang.Exception

failedOver

public void failedOver()
Specified by:
failedOver in interface ServerConsumer

lock

public void lock()
Specified by:
lock in interface ServerConsumer

unlock

public void unlock()
Specified by:
unlock in interface ServerConsumer

getAvailableCredits

public java.util.concurrent.atomic.AtomicInteger getAvailableCredits()
To be used on tests only



Copyright © 2006 JBoss Inc. All Rights Reserved.