org.cid.distribution
Class ListMessageEnumeration

java.lang.Object
  extended by org.cid.distribution.ListMessageEnumeration
All Implemented Interfaces:
MessageEnumeration

public class ListMessageEnumeration
extends java.lang.Object
implements MessageEnumeration

A message iterator wrapper for the List interface.

Version:
$Revision: 173 $

Constructor Summary
ListMessageEnumeration(DistributionMessage message)
          Builds a new instance that will enumerate a single message.
ListMessageEnumeration(java.util.List<DistributionMessage> list)
          Builds a new instance that wraps the given list.
 
Method Summary
static ListMessageEnumeration getEmptyEnumeration()
          Returns an empty ListMessageEnumeration.
 boolean hasMoreMessages()
          Tests if this enumeration contains more elements.
 DistributionMessage nextMessage()
          Returns the next message in this MessageEnumeration.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListMessageEnumeration

public ListMessageEnumeration(java.util.List<DistributionMessage> list)
Builds a new instance that wraps the given list.

Parameters:
list -

ListMessageEnumeration

public ListMessageEnumeration(DistributionMessage message)
Builds a new instance that will enumerate a single message.

Parameters:
message -
Method Detail

getEmptyEnumeration

public static ListMessageEnumeration getEmptyEnumeration()
Returns an empty ListMessageEnumeration. This method is provided for handler or channels that block or consume messages.


hasMoreMessages

public boolean hasMoreMessages()
Tests if this enumeration contains more elements.

Specified by:
hasMoreMessages in interface MessageEnumeration
Returns:
Throws:
DistributionException

nextMessage

public DistributionMessage nextMessage()
Returns the next message in this MessageEnumeration.

Specified by:
nextMessage in interface MessageEnumeration
Returns:
Throws:
DistributionException


Copyright © 2006 null. All Rights Reserved.