org.jboss.messaging.core.impl
Class OrderingGroupMonitor

java.lang.Object
  extended by org.jboss.messaging.core.impl.OrderingGroupMonitor

public class OrderingGroupMonitor
extends java.lang.Object

This class guards against any delivering of ordering group messages.

Author:
Howard Gao

Field Summary
static int NOT_OK_BEING_SENT
           
static int NOT_OK_NOT_FIRST
           
static int OK
           
 
Constructor Summary
OrderingGroupMonitor()
           
 
Method Summary
 int isAvailable(MessageReference ref)
          If ref is not in our registry, just return true.
static boolean isOrderingGroupMessage(MessageReference ref)
          check if the message has a group name
 void markSending(MessageReference ref)
           
 boolean messageCompleted(MessageReference ref)
          This method indicates a messgae is completed.
 void registerMessage(MessageReference ref)
          Check the message is it is a member of an ordering group, if so, put it in; if not, do nothing.
 void unmarkSending(MessageReference ref)
          reducing the refcount, if zero, remove it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OK

public static final int OK
See Also:
Constant Field Values

NOT_OK_NOT_FIRST

public static final int NOT_OK_NOT_FIRST
See Also:
Constant Field Values

NOT_OK_BEING_SENT

public static final int NOT_OK_BEING_SENT
See Also:
Constant Field Values
Constructor Detail

OrderingGroupMonitor

public OrderingGroupMonitor()
Method Detail

registerMessage

public void registerMessage(MessageReference ref)
Check the message is it is a member of an ordering group, if so, put it in; if not, do nothing. if the message is dropped due to maxSize being reached, it won't get registered.


isAvailable

public int isAvailable(MessageReference ref)
If ref is not in our registry, just return true. If in our registry, check if the ref is the first of the group. return true if it at the first place. return false otherwise.


messageCompleted

public boolean messageCompleted(MessageReference ref)
This method indicates a messgae is completed. it is called when a message is acked, commited or rollback once the message is completed, the next one in a ordering group becomes deliverable. return if there is more messages available after this one.


unmarkSending

public void unmarkSending(MessageReference ref)
reducing the refcount, if zero, remove it.


markSending

public void markSending(MessageReference ref)

isOrderingGroupMessage

public static boolean isOrderingGroupMessage(MessageReference ref)
check if the message has a group name



Copyright © 2006 JBoss Inc. All Rights Reserved.