public abstract class AbstractAggregator extends AbstractInterceptingMessageProcessor implements Initialisable, MuleContextAware, FlowConstructAware, Aggregator, Startable, Stoppable, Disposable
AbstractEventAggregator will aggregate a set of messages into a
single message. EIP Reference: http://www.eaipatterns.com/Aggregator.html| Modifier and Type | Field and Description |
|---|---|
protected EventCorrelator |
eventCorrelator |
static String |
EVENTS_STORE_REGISTRY_KEY_PREFIX |
protected String |
eventsObjectStoreKey |
protected FlowConstruct |
flowConstruct |
static int |
MAX_PROCESSED_GROUPS |
protected MessageInfoMapping |
messageInfoMapping |
protected MuleContext |
muleContext |
protected boolean |
persistentStores |
protected String |
storePrefix |
logger, next, notificationHandlerPHASE_NAMEPHASE_NAMEPHASE_NAMEPHASE_NAMEPROPERTY_NAME| Constructor and Description |
|---|
AbstractAggregator() |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
A lifecycle method where implementor should free up any resources.
|
void |
expireAggregation(String groupId) |
protected abstract EventCorrelatorCallback |
getCorrelatorCallback(MuleContext muleContext) |
String |
getStorePrefix() |
long |
getTimeout() |
protected void |
initEventGroupsObjectStore() |
void |
initialise()
Method used to perform any initialisation work.
|
protected void |
initProcessedGroupsObjectStore() |
protected org.apache.commons.collections.Factory |
internalEventsGroupsObjectStoreFactory() |
protected org.apache.commons.collections.Factory |
internalProcessedGroupsObjectStoreFactory() |
boolean |
isFailOnTimeout() |
boolean |
isPersistentStores() |
MuleEvent |
process(MuleEvent event)
Invokes the MessageProcessor.
|
void |
setEventGroupsObjectStore(PartitionableObjectStore<MuleEvent> eventGroupsObjectStore) |
void |
setFailOnTimeout(boolean failOnTimeout) |
void |
setFlowConstruct(FlowConstruct flowConstruct) |
void |
setMessageInfoMapping(MessageInfoMapping messageInfoMapping) |
void |
setMuleContext(MuleContext context) |
void |
setPersistentStores(boolean persistentStores) |
void |
setProcessedGroupsObjectStore(ObjectStore<Long> processedGroupsObjectStore) |
void |
setStorePrefix(String storePrefix) |
void |
setTimeout(long timeout) |
void |
start() |
void |
stop() |
addMessageProcessorPathElements, getListener, getMuleContext, isEventValid, processNext, setListener, toStringgetAnnotation, getAnnotations, setAnnotationsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsetListenerpublic static final int MAX_PROCESSED_GROUPS
public static final String EVENTS_STORE_REGISTRY_KEY_PREFIX
protected EventCorrelator eventCorrelator
protected MuleContext muleContext
protected FlowConstruct flowConstruct
protected MessageInfoMapping messageInfoMapping
protected boolean persistentStores
protected String storePrefix
protected String eventsObjectStoreKey
public void initialise()
throws InitialisationException
InitialisableInitialisationException 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.initialise in interface InitialisableInitialisationException - if a fatal error occurs causing the Mule instance to shutdownRecoverableException - if an error occurs that can be recovered fromprotected void initProcessedGroupsObjectStore()
protected org.apache.commons.collections.Factory internalProcessedGroupsObjectStoreFactory()
protected void initEventGroupsObjectStore()
throws InitialisationException
InitialisationExceptionprotected org.apache.commons.collections.Factory internalEventsGroupsObjectStoreFactory()
public void start()
throws MuleException
start in interface StartableMuleExceptionpublic void stop()
throws MuleException
stop in interface StoppableMuleExceptionpublic void setMuleContext(MuleContext context)
setMuleContext in interface MuleContextAwaresetMuleContext in class AbstractInterceptingMessageProcessorBaseprotected abstract EventCorrelatorCallback getCorrelatorCallback(MuleContext muleContext)
public MuleEvent process(MuleEvent event) throws MuleException
MessageProcessorprocess in interface MessageProcessorevent - MuleEvent to be processedMuleExceptionpublic void expireAggregation(String groupId) throws MessagingException
expireAggregation in interface AggregatorMessagingExceptionpublic long getTimeout()
public void setTimeout(long timeout)
setTimeout in interface Aggregatorpublic boolean isFailOnTimeout()
public void setFailOnTimeout(boolean failOnTimeout)
setFailOnTimeout in interface Aggregatorpublic void setFlowConstruct(FlowConstruct flowConstruct)
setFlowConstruct in interface FlowConstructAwarepublic void setMessageInfoMapping(MessageInfoMapping messageInfoMapping)
public void setProcessedGroupsObjectStore(ObjectStore<Long> processedGroupsObjectStore)
public void setEventGroupsObjectStore(PartitionableObjectStore<MuleEvent> eventGroupsObjectStore)
public boolean isPersistentStores()
public void setPersistentStores(boolean persistentStores)
public String getStorePrefix()
public void setStorePrefix(String storePrefix)
public void dispose()
Disposabledispose in interface DisposableCopyright © 2003–2016 MuleSoft, Inc.. All rights reserved.