org.apache.servicemix.eip.patterns
Class SplitAggregator
java.lang.Object
org.apache.servicemix.common.endpoints.AbstractEndpoint
org.apache.servicemix.common.endpoints.SimpleEndpoint
org.apache.servicemix.common.endpoints.ProviderEndpoint
org.apache.servicemix.eip.EIPEndpoint
org.apache.servicemix.eip.support.AbstractAggregator
org.apache.servicemix.eip.patterns.SplitAggregator
- All Implemented Interfaces:
- org.apache.servicemix.common.Endpoint
- Direct Known Subclasses:
- RecipientListAggregator
public class SplitAggregator
- extends AbstractAggregator
Aggregator can be used to wait and combine several messages.
This component implements the
Aggregator
pattern.
This aggregator collect messages with a count, index and correlationId properties.
These properties are automatically set by splitters.
A timeout may be specified so that the aggregator will not keep data forever if a message is missing.
- Version:
- $Revision: 376451 $
- Author:
- gnodet
| Fields inherited from class org.apache.servicemix.common.endpoints.AbstractEndpoint |
definition, description, endpoint, interfaceName, logger, service, serviceUnit |
| Methods inherited from class org.apache.servicemix.eip.support.AbstractAggregator |
closeAggregation, getClosedAggregatesStoreFactory, getTarget, isAggregationClosed, isCopyAttachments, isCopyProperties, isRescheduleTimeouts, isSynchronous, onTimeout, process, processAsync, processSync, sendAggregate, setClosedAggregatesStoreFactory, setCopyAttachments, setCopyProperties, setRescheduleTimeouts, setSynchronous, setTarget, start |
| Methods inherited from class org.apache.servicemix.eip.EIPEndpoint |
chooseFirstEndpointWithDescriptor, copyAttachments, copyProperties, getDefinition, getDefinitionFromDescription, getDefinitionFromWsdlExchangeTarget, getDefinitionFromWsdlResource, getDescription, getDescriptionForExchangeTarget, getEndpointsForExchangeTarget, getLockManager, getStore, getStoreFactory, getTimerManager, getWsdlExchangeTarget, getWsdlResource, setLockManager, setStore, setStoreFactory, setTimerManager, setWsdlExchangeTarget, setWsdlResource, stop |
| Methods inherited from class org.apache.servicemix.common.endpoints.ProviderEndpoint |
activate, deactivate, getRole, processInOnly, processInOut |
| Methods inherited from class org.apache.servicemix.common.endpoints.SimpleEndpoint |
done, fail, getChannel, getContext, getExchangeFactory, send, sendSync |
| Methods inherited from class org.apache.servicemix.common.endpoints.AbstractEndpoint |
getEndpoint, getInterfaceName, getKey, getService, getServiceUnit, isExchangeOkay, prepareExchange, setDefinition, setDescription, setEndpoint, setInterfaceName, setService, setServiceUnit, toString, validate |
count
protected org.apache.servicemix.expression.Expression count
index
protected org.apache.servicemix.expression.Expression index
corrId
protected org.apache.servicemix.expression.Expression corrId
aggregateElementName
protected QName aggregateElementName
messageElementName
protected QName messageElementName
countAttribute
protected String countAttribute
indexAttribute
protected String indexAttribute
timeout
protected long timeout
SplitAggregator
public SplitAggregator()
getAggregateElementName
public QName getAggregateElementName()
- Returns:
- the aggregateElementName
setAggregateElementName
public void setAggregateElementName(QName aggregateElementName)
- Parameters:
aggregateElementName - the aggregateElementName to set
getCorrId
public org.apache.servicemix.expression.Expression getCorrId()
- Returns:
- the corrId
setCorrId
public void setCorrId(org.apache.servicemix.expression.Expression corrId)
- Parameters:
corrId - the corrId to set
getCount
public org.apache.servicemix.expression.Expression getCount()
- Returns:
- the count
setCount
public void setCount(org.apache.servicemix.expression.Expression count)
- Parameters:
count - the count to set
getCountAttribute
public String getCountAttribute()
- Returns:
- the countAttribute
setCountAttribute
public void setCountAttribute(String countAttribute)
- Parameters:
countAttribute - the countAttribute to set
getIndex
public org.apache.servicemix.expression.Expression getIndex()
- Returns:
- the index
setIndex
public void setIndex(org.apache.servicemix.expression.Expression index)
- Parameters:
index - the index to set
getIndexAttribute
public String getIndexAttribute()
- Returns:
- the indexAttribute
setIndexAttribute
public void setIndexAttribute(String indexAttribute)
- Parameters:
indexAttribute - the indexAttribute to set
getMessageElementName
public QName getMessageElementName()
- Returns:
- the messageElementName
setMessageElementName
public void setMessageElementName(QName messageElementName)
- Parameters:
messageElementName - the messageElementName to set
getTimeout
public long getTimeout()
- Returns:
- the timeout
setTimeout
public void setTimeout(long timeout)
- Parameters:
timeout - the timeout to set
createAggregation
public Object createAggregation(String correlationID)
- Description copied from class:
AbstractAggregator
- Creates a new empty aggregation.
- Specified by:
createAggregation in class AbstractAggregator
- Returns:
- a newly created aggregation
getCorrelationID
public String getCorrelationID(javax.jbi.messaging.MessageExchange exchange,
javax.jbi.messaging.NormalizedMessage message)
throws Exception
- Description copied from class:
AbstractAggregator
- Retrieve the correlation ID of the given exchange
- Specified by:
getCorrelationID in class AbstractAggregator
- Returns:
- the correlationID
- Throws:
Exception
addMessage
public boolean addMessage(Object aggregation,
javax.jbi.messaging.NormalizedMessage message,
javax.jbi.messaging.MessageExchange exchange)
throws Exception
- Description copied from class:
AbstractAggregator
- Add a newly received message to this aggregation
- Specified by:
addMessage in class AbstractAggregator
- Returns:
true if the aggregate id complete
- Throws:
Exception
buildAggregate
public void buildAggregate(Object aggregation,
javax.jbi.messaging.NormalizedMessage message,
javax.jbi.messaging.MessageExchange exchange,
boolean doTimeout)
throws Exception
- Description copied from class:
AbstractAggregator
- Fill the given JBI message with the aggregation result.
- Specified by:
buildAggregate in class AbstractAggregator
doTimeout - false if the aggregation has completed or true
if this aggregation has timed out
- Throws:
Exception
createChildElement
protected Element createChildElement(QName name,
Node parent)
getTimeout
public Date getTimeout(Object aggregation)
- Description copied from class:
AbstractAggregator
- Returns the date when the onTimeout method should be called if the aggregation is not completed yet,
or null if the aggregation has no timeout.
- Specified by:
getTimeout in class AbstractAggregator
- Returns:
Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.