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.htmlModifier 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, notificationHandler
PHASE_NAME
PHASE_NAME
PHASE_NAME
PHASE_NAME
PROPERTY_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, toString
getAnnotation, getAnnotations, setAnnotations
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
setListener
public 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
Initialisable
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.initialise
in interface Initialisable
InitialisationException
- 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
InitialisationException
protected org.apache.commons.collections.Factory internalEventsGroupsObjectStoreFactory()
public void start() throws MuleException
start
in interface Startable
MuleException
public void stop() throws MuleException
stop
in interface Stoppable
MuleException
public void setMuleContext(MuleContext context)
setMuleContext
in interface MuleContextAware
setMuleContext
in class AbstractInterceptingMessageProcessorBase
protected abstract EventCorrelatorCallback getCorrelatorCallback(MuleContext muleContext)
public MuleEvent process(MuleEvent event) throws MuleException
MessageProcessor
process
in interface MessageProcessor
event
- MuleEvent to be processedMuleException
public void expireAggregation(String groupId) throws MessagingException
expireAggregation
in interface Aggregator
MessagingException
public long getTimeout()
public void setTimeout(long timeout)
setTimeout
in interface Aggregator
public boolean isFailOnTimeout()
public void setFailOnTimeout(boolean failOnTimeout)
setFailOnTimeout
in interface Aggregator
public void setFlowConstruct(FlowConstruct flowConstruct)
setFlowConstruct
in interface FlowConstructAware
public 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()
Disposable
dispose
in interface Disposable
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.