com.caucho.message.common
Class MessageReceiverCredit

java.lang.Object
  extended by com.caucho.message.common.MessageReceiverCredit

public final class MessageReceiverCredit
extends java.lang.Object

counts message send/receive credit. It is assumed that the methods are called in a thread safe manner


Constructor Summary
MessageReceiverCredit()
           
 
Method Summary
 long getClientSequence()
          Returns the current client sequence.
 int getCredit()
          Returns the credit to fill the prefetch queue
 long getCreditAvailable()
          Returns the current credit available from the endpoint's perspective.
 long getEndpointSequence()
          Returns the current endpoint sequence.
 int getPrefetch()
           
 long getQueueSize()
          Returns the current queue size, received but unprocessed
 boolean isFlowRequired()
          Heuristic for sending the flow update.
 void receiveClient()
          Receive at the client
 long receiveEndpoint()
          Receive at the endpoint
 void setPrefetch(int prefetch)
           
 void updateCredit(int credit)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageReceiverCredit

public MessageReceiverCredit()
Method Detail

getPrefetch

public final int getPrefetch()

setPrefetch

public final void setPrefetch(int prefetch)

getEndpointSequence

public final long getEndpointSequence()
Returns the current endpoint sequence.


receiveEndpoint

public final long receiveEndpoint()
Receive at the endpoint


getClientSequence

public final long getClientSequence()
Returns the current client sequence.


receiveClient

public final void receiveClient()
Receive at the client


getCreditAvailable

public final long getCreditAvailable()
Returns the current credit available from the endpoint's perspective.


getQueueSize

public final long getQueueSize()
Returns the current queue size, received but unprocessed


getCredit

public final int getCredit()
Returns the credit to fill the prefetch queue


isFlowRequired

public final boolean isFlowRequired()
Heuristic for sending the flow update.


updateCredit

public final void updateCredit(int credit)