org.apache.camel.model.config
Class StreamResequencerConfig

java.lang.Object
  extended by org.apache.camel.model.config.StreamResequencerConfig

public class StreamResequencerConfig
extends Object

Defines the configuration parameters for the StreamResequencer. Usage example:

 from("direct:start").resequencer(header("seqnum")).stream(
         StreamResequencerConfig.getDefault()).to("mock:result")
 
is equivalent to
 from("direct:start").resequencer(header("seqnum")).stream().to("mock:result")
 
Custom values for capacity and timeout can be set like in this example:
 from("direct:start").resequencer(header("seqnum")).stream(
         new StreamResequencerConfig(300, 400L)).to("mock:result")
 

Version:
$Revision: 1276 $
Author:
Martin Krasser

Constructor Summary
StreamResequencerConfig()
          Creates a new StreamResequencerConfig instance using default values for capacity (1000) and timeout (1000L).
StreamResequencerConfig(int capacity, long timeout)
          Creates a new BatchResequencerConfig instance using the given values for capacity and timeout.
StreamResequencerConfig(int capacity, long timeout, ExpressionResultComparator<Exchange> comparator)
          Creates a new BatchResequencerConfig instance using the given values for capacity and timeout.
 
Method Summary
 int getCapacity()
           
 ExpressionResultComparator<Exchange> getComparator()
           
static StreamResequencerConfig getDefault()
          Returns a new StreamResequencerConfig instance using default values for capacity (1000) and timeout (1000L).
 long getTimeout()
           
 void setCapacity(int capacity)
           
 void setComparator(ExpressionResultComparator<Exchange> comparator)
           
 void setTimeout(long timeout)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamResequencerConfig

public StreamResequencerConfig()
Creates a new StreamResequencerConfig instance using default values for capacity (1000) and timeout (1000L). Elements of the sequence are compared using the DefaultExchangeComparator.


StreamResequencerConfig

public StreamResequencerConfig(int capacity,
                               long timeout)
Creates a new BatchResequencerConfig instance using the given values for capacity and timeout. Elements of the sequence are compared using the DefaultExchangeComparator.

Parameters:
capacity - capacity of the resequencer's inbound queue.
timeout - minimum time to wait for missing elements (messages).

StreamResequencerConfig

public StreamResequencerConfig(int capacity,
                               long timeout,
                               ExpressionResultComparator<Exchange> comparator)
Creates a new BatchResequencerConfig instance using the given values for capacity and timeout. Elements of the sequence are compared with the given ExpressionResultComparator.

Parameters:
capacity - capacity of the resequencer's inbound queue.
timeout - minimum time to wait for missing elements (messages).
Method Detail

getDefault

public static StreamResequencerConfig getDefault()
Returns a new StreamResequencerConfig instance using default values for capacity (1000) and timeout (1000L). Elements of the sequence are compared using the DefaultExchangeComparator.

Returns:
a default StreamResequencerConfig.

getCapacity

public int getCapacity()

setCapacity

public void setCapacity(int capacity)

getTimeout

public long getTimeout()

setTimeout

public void setTimeout(long timeout)

getComparator

public ExpressionResultComparator<Exchange> getComparator()

setComparator

public void setComparator(ExpressionResultComparator<Exchange> comparator)


Copyright © 2010 IONA Open Source Community. All Rights Reserved.