org.apache.activemq.broker.region.group
Class MessageGroupHashBucket

java.lang.Object
  extended by org.apache.activemq.broker.region.group.MessageGroupHashBucket
All Implemented Interfaces:
MessageGroupMap

public class MessageGroupHashBucket
extends Object
implements MessageGroupMap

Uses hash-code buckets to associate consumers with sets of message group IDs.


Constructor Summary
MessageGroupHashBucket(int bucketCount, int cachedSize)
           
 
Method Summary
protected  MessageGroupSet createMessageGroupSet(int bucketNumber)
           
protected  MessageGroupSet createMessageGroupSet(int bucketNumber, MessageGroupSet parent)
           
 ConsumerId get(String groupId)
           
 int getBucketCount()
           
protected  int getBucketNumber(String groupId)
           
 Map<String,String> getGroups()
           
 String getType()
           
 void put(String groupId, ConsumerId consumerId)
           
 void removeAll()
           
 MessageGroupSet removeConsumer(ConsumerId consumerId)
           
 ConsumerId removeGroup(String groupId)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MessageGroupHashBucket

public MessageGroupHashBucket(int bucketCount,
                              int cachedSize)
Method Detail

put

public void put(String groupId,
                ConsumerId consumerId)
Specified by:
put in interface MessageGroupMap

get

public ConsumerId get(String groupId)
Specified by:
get in interface MessageGroupMap

removeGroup

public ConsumerId removeGroup(String groupId)
Specified by:
removeGroup in interface MessageGroupMap

removeConsumer

public MessageGroupSet removeConsumer(ConsumerId consumerId)
Specified by:
removeConsumer in interface MessageGroupMap

removeAll

public void removeAll()
Specified by:
removeAll in interface MessageGroupMap

getGroups

public Map<String,String> getGroups()
Specified by:
getGroups in interface MessageGroupMap
Returns:
a map of group names and associated consumer Id

getType

public String getType()
Specified by:
getType in interface MessageGroupMap

getBucketCount

public int getBucketCount()

toString

public String toString()
Overrides:
toString in class Object

createMessageGroupSet

protected MessageGroupSet createMessageGroupSet(int bucketNumber,
                                                MessageGroupSet parent)

createMessageGroupSet

protected MessageGroupSet createMessageGroupSet(int bucketNumber)

getBucketNumber

protected int getBucketNumber(String groupId)


Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.