org.apache.camel.processor.aggregate
Class MemoryAggregationRepository

java.lang.Object
  extended by org.apache.camel.impl.ServiceSupport
      extended by org.apache.camel.processor.aggregate.MemoryAggregationRepository
All Implemented Interfaces:
Service, ShutdownableService, AggregationRepository

public class MemoryAggregationRepository
extends ServiceSupport
implements AggregationRepository

A memory based AggregationRepository which stores in memory only.

Version:
$Revision: 18914 $

Constructor Summary
MemoryAggregationRepository()
           
 
Method Summary
 Exchange add(CamelContext camelContext, String key, Exchange exchange)
          Add the given Exchange under the correlation key.
 void confirm(CamelContext camelContext, String exchangeId)
          Confirms the completion of the Exchange.
protected  void doStart()
           
protected  void doStop()
           
 Exchange get(CamelContext camelContext, String key)
          Gets the given exchange with the correlation key
 Set<String> getKeys()
          Gets the keys currently in the repository.
 void remove(CamelContext camelContext, String key, Exchange exchange)
          Removes the exchange with the given correlation key, which should happen when an Exchange is completed
 
Methods inherited from class org.apache.camel.impl.ServiceSupport
addChildService, doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, removeChildService, resume, shutdown, start, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryAggregationRepository

public MemoryAggregationRepository()
Method Detail

add

public Exchange add(CamelContext camelContext,
                    String key,
                    Exchange exchange)
Description copied from interface: AggregationRepository
Add the given Exchange under the correlation key.

Will replace any existing exchange.

Specified by:
add in interface AggregationRepository
Parameters:
camelContext - the current CamelContext
key - the correlation key
exchange - the aggregated exchange
Returns:
the old exchange if any existed

get

public Exchange get(CamelContext camelContext,
                    String key)
Description copied from interface: AggregationRepository
Gets the given exchange with the correlation key

Specified by:
get in interface AggregationRepository
Parameters:
camelContext - the current CamelContext
key - the correlation key
Returns:
the exchange, or null if no exchange was previously added

remove

public void remove(CamelContext camelContext,
                   String key,
                   Exchange exchange)
Description copied from interface: AggregationRepository
Removes the exchange with the given correlation key, which should happen when an Exchange is completed

Specified by:
remove in interface AggregationRepository
Parameters:
camelContext - the current CamelContext
key - the correlation key
exchange - the exchange to remove

confirm

public void confirm(CamelContext camelContext,
                    String exchangeId)
Description copied from interface: AggregationRepository
Confirms the completion of the Exchange.

Specified by:
confirm in interface AggregationRepository
Parameters:
camelContext - the current CamelContext
exchangeId - exchange id to confirm

getKeys

public Set<String> getKeys()
Description copied from interface: AggregationRepository
Gets the keys currently in the repository.

Specified by:
getKeys in interface AggregationRepository
Returns:
the keys

doStart

protected void doStart()
                throws Exception
Specified by:
doStart in class ServiceSupport
Throws:
Exception

doStop

protected void doStop()
               throws Exception
Specified by:
doStop in class ServiceSupport
Throws:
Exception


Apache CAMEL