org.mule.routing
Class AbstractAggregator

java.lang.Object
  extended by org.mule.processor.AbstractInterceptingMessageProcessorBase
      extended by org.mule.processor.AbstractInterceptingMessageProcessor
          extended by org.mule.routing.AbstractAggregator
All Implemented Interfaces:
AnnotatedObject, FlowConstructAware, MuleContextAware, Initialisable, Startable, Stoppable, InterceptingMessageProcessor, MessageProcessor, Aggregator, MessageSource
Direct Known Subclasses:
AbstractCorrelationAggregator, BankQuotesResponseAggregator, MessageChunkAggregator, Resequencer, SimpleCollectionAggregator

public abstract class AbstractAggregator
extends AbstractInterceptingMessageProcessor
implements Initialisable, MuleContextAware, FlowConstructAware, Aggregator, Startable, Stoppable

AbstractEventAggregator will aggregate a set of messages into a single message. EIP Reference: http://www.eaipatterns.com/Aggregator.html


Field Summary
protected  EventCorrelator eventCorrelator
           
protected  FlowConstruct flowConstruct
           
protected  MessageInfoMapping messageInfoMapping
           
protected  MuleContext muleContext
           
protected  boolean persistentStores
           
protected  String storePrefix
           
 
Fields inherited from class org.mule.processor.AbstractInterceptingMessageProcessorBase
logger, next, notificationHandler
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Startable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Stoppable
PHASE_NAME
 
Fields inherited from interface org.mule.api.AnnotatedObject
PROPERTY_NAME
 
Constructor Summary
AbstractAggregator()
           
 
Method Summary
 void expireAggregation(String groupId)
           
protected abstract  EventCorrelatorCallback getCorrelatorCallback(MuleContext muleContext)
           
 String getStorePrefix()
           
 long getTimeout()
           
 void initialise()
          Method used to perform any initialisation work.
 boolean isFailOnTimeout()
           
 boolean isPersistentStores()
           
 MuleEvent process(MuleEvent event)
          Invokes the MessageProcessor.
 void setFailOnTimeout(boolean failOnTimeout)
           
 void setFlowConstruct(FlowConstruct flowConstruct)
           
 void setMessageInfoMapping(MessageInfoMapping messageInfoMapping)
           
 void setMuleContext(MuleContext context)
           
 void setPersistentStores(boolean persistentStores)
           
 void setStorePrefix(String storePrefix)
           
 void setTimeout(long timeout)
           
 void start()
           
 void stop()
           
 
Methods inherited from class org.mule.processor.AbstractInterceptingMessageProcessorBase
getAnnotation, getAnnotations, getListener, getMuleContext, isEventValid, processNext, setAnnotations, setListener, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mule.api.source.MessageSource
setListener
 

Field Detail

eventCorrelator

protected EventCorrelator eventCorrelator

muleContext

protected MuleContext muleContext

flowConstruct

protected FlowConstruct flowConstruct

messageInfoMapping

protected MessageInfoMapping messageInfoMapping

persistentStores

protected boolean persistentStores

storePrefix

protected String storePrefix
Constructor Detail

AbstractAggregator

public AbstractAggregator()
Method Detail

initialise

public void initialise()
                throws InitialisationException
Description copied from interface: Initialisable
Method used to perform any initialisation work. If a fatal error occurs during initialisation an InitialisationException should be thrown, causing the Mule instance to shutdown. If the error is recoverable, say by retrying to connect, a RecoverableException should be thrown. There is no guarantee that by throwing a Recoverable exception that the Mule instance will not shut down.

Specified by:
initialise in interface Initialisable
Throws:
InitialisationException - if a fatal error occurs causing the Mule instance to shutdown
RecoverableException - if an error occurs that can be recovered from

start

public void start()
           throws MuleException
Specified by:
start in interface Startable
Throws:
MuleException

stop

public void stop()
          throws MuleException
Specified by:
stop in interface Stoppable
Throws:
MuleException

setMuleContext

public void setMuleContext(MuleContext context)
Specified by:
setMuleContext in interface MuleContextAware
Overrides:
setMuleContext in class AbstractInterceptingMessageProcessorBase

getCorrelatorCallback

protected abstract EventCorrelatorCallback getCorrelatorCallback(MuleContext muleContext)

process

public MuleEvent process(MuleEvent event)
                  throws MuleException
Description copied from interface: MessageProcessor
Invokes the MessageProcessor.

Specified by:
process in interface MessageProcessor
Parameters:
event - MuleEvent to be processed
Returns:
optional response MuleEvent
Throws:
MuleException

expireAggregation

public void expireAggregation(String groupId)
                       throws MessagingException
Specified by:
expireAggregation in interface Aggregator
Throws:
MessagingException

getTimeout

public long getTimeout()

setTimeout

public void setTimeout(long timeout)
Specified by:
setTimeout in interface Aggregator

isFailOnTimeout

public boolean isFailOnTimeout()

setFailOnTimeout

public void setFailOnTimeout(boolean failOnTimeout)
Specified by:
setFailOnTimeout in interface Aggregator

setFlowConstruct

public void setFlowConstruct(FlowConstruct flowConstruct)
Specified by:
setFlowConstruct in interface FlowConstructAware

setMessageInfoMapping

public void setMessageInfoMapping(MessageInfoMapping messageInfoMapping)

isPersistentStores

public boolean isPersistentStores()

setPersistentStores

public void setPersistentStores(boolean persistentStores)

getStorePrefix

public String getStorePrefix()

setStorePrefix

public void setStorePrefix(String storePrefix)


Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.