|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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
public class SplitAggregator
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.
| Nested Class Summary | |
|---|---|
protected static class |
SplitAggregator.SplitterAggregation
|
| Nested classes/interfaces inherited from class org.apache.servicemix.eip.support.AbstractAggregator |
|---|
AbstractAggregator.ClosedAggregateException |
| Field Summary | |
|---|---|
protected javax.xml.namespace.QName |
aggregateElementName
|
protected org.apache.servicemix.expression.Expression |
corrId
|
protected org.apache.servicemix.expression.Expression |
count
|
protected java.lang.String |
countAttribute
|
protected org.apache.servicemix.expression.Expression |
index
|
protected java.lang.String |
indexAttribute
|
protected javax.xml.namespace.QName |
messageElementName
|
protected long |
timeout
|
| Fields inherited from class org.apache.servicemix.eip.EIPEndpoint |
|---|
lockManager, store, storeFactory, timerManager, wsdlExchangeTarget, wsdlResource |
| Fields inherited from class org.apache.servicemix.common.endpoints.AbstractEndpoint |
|---|
definition, description, endpoint, interfaceName, service, serviceUnit |
| Constructor Summary | |
|---|---|
SplitAggregator()
|
|
| Method Summary | |
|---|---|
boolean |
addMessage(java.lang.Object aggregation,
javax.jbi.messaging.NormalizedMessage message,
javax.jbi.messaging.MessageExchange exchange)
Add a newly received message to this aggregation |
void |
buildAggregate(java.lang.Object aggregation,
javax.jbi.messaging.NormalizedMessage message,
javax.jbi.messaging.MessageExchange exchange,
boolean doTimeout)
Fill the given JBI message with the aggregation result. |
java.lang.Object |
createAggregation(java.lang.String correlationID)
Creates a new empty aggregation. |
protected org.w3c.dom.Element |
createChildElement(javax.xml.namespace.QName name,
org.w3c.dom.Node parent)
|
javax.xml.namespace.QName |
getAggregateElementName()
|
java.lang.String |
getCorrelationID(javax.jbi.messaging.MessageExchange exchange,
javax.jbi.messaging.NormalizedMessage message)
Retrieve the correlation ID of the given exchange |
org.apache.servicemix.expression.Expression |
getCorrId()
|
org.apache.servicemix.expression.Expression |
getCount()
|
java.lang.String |
getCountAttribute()
|
org.apache.servicemix.expression.Expression |
getIndex()
|
java.lang.String |
getIndexAttribute()
|
javax.xml.namespace.QName |
getMessageElementName()
|
long |
getTimeout()
|
java.util.Date |
getTimeout(java.lang.Object aggregation)
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. |
void |
setAggregateElementName(javax.xml.namespace.QName aggregateElementName)
The qualified name that will be used as the root xml element when building the aggregate. |
void |
setCorrId(org.apache.servicemix.expression.Expression corrId)
An expression used to compute the correlation ids of incoming messages to find related messages. |
void |
setCount(org.apache.servicemix.expression.Expression count)
An expression used to compute the total number of message that the aggregate will contain. |
void |
setCountAttribute(java.lang.String countAttribute)
The name of the xml attribute attached to the root element that will contain the number of messages in this aggregate. |
void |
setIndex(org.apache.servicemix.expression.Expression index)
An expression used to compute the index of this message in the aggregate. |
void |
setIndexAttribute(java.lang.String indexAttribute)
The name of the xml attribute attached to the message element that will contain the index of messages in this aggregate. |
void |
setMessageElementName(javax.xml.namespace.QName messageElementName)
The qualified name of the xml element used to embed each message when building the aggregated message. |
void |
setTimeout(long timeout)
The maximum amount of time (in milliseconds) that can elapse between messages for a single aggregate. |
| 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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected org.apache.servicemix.expression.Expression count
protected org.apache.servicemix.expression.Expression index
protected org.apache.servicemix.expression.Expression corrId
protected javax.xml.namespace.QName aggregateElementName
protected javax.xml.namespace.QName messageElementName
protected java.lang.String countAttribute
protected java.lang.String indexAttribute
protected long timeout
| Constructor Detail |
|---|
public SplitAggregator()
| Method Detail |
|---|
public javax.xml.namespace.QName getAggregateElementName()
public void setAggregateElementName(javax.xml.namespace.QName aggregateElementName)
messageElementName property.
aggregateElementName - the aggregateElementName to setpublic org.apache.servicemix.expression.Expression getCorrId()
public void setCorrId(org.apache.servicemix.expression.Expression corrId)
corrId - the corrId to setpublic org.apache.servicemix.expression.Expression getCount()
public void setCount(org.apache.servicemix.expression.Expression count)
count - the count to setpublic java.lang.String getCountAttribute()
public void setCountAttribute(java.lang.String countAttribute)
countAttribute - the countAttribute to setpublic org.apache.servicemix.expression.Expression getIndex()
public void setIndex(org.apache.servicemix.expression.Expression index)
0 and count - 1 included.
index - the index to setpublic java.lang.String getIndexAttribute()
public void setIndexAttribute(java.lang.String indexAttribute)
indexAttribute - the indexAttribute to setpublic javax.xml.namespace.QName getMessageElementName()
public void setMessageElementName(javax.xml.namespace.QName messageElementName)
null, messages
contents will be appended directly as children of the root element.
messageElementName - the messageElementName to setpublic long getTimeout()
public void setTimeout(long timeout)
0 which means that the timeout is not used at all.
timeout - the timeout to setpublic java.lang.Object createAggregation(java.lang.String correlationID)
AbstractAggregator
createAggregation in class AbstractAggregator
public java.lang.String getCorrelationID(javax.jbi.messaging.MessageExchange exchange,
javax.jbi.messaging.NormalizedMessage message)
throws java.lang.Exception
AbstractAggregator
getCorrelationID in class AbstractAggregatorAbstractAggregator.ClosedAggregateException
java.lang.Exception
public boolean addMessage(java.lang.Object aggregation,
javax.jbi.messaging.NormalizedMessage message,
javax.jbi.messaging.MessageExchange exchange)
throws java.lang.Exception
AbstractAggregator
addMessage in class AbstractAggregatortrue if the aggregate id complete
java.lang.Exception
public void buildAggregate(java.lang.Object aggregation,
javax.jbi.messaging.NormalizedMessage message,
javax.jbi.messaging.MessageExchange exchange,
boolean doTimeout)
throws java.lang.Exception
AbstractAggregator
buildAggregate in class AbstractAggregatordoTimeout - false if the aggregation has completed or true
if this aggregation has timed out
java.lang.Exception
protected org.w3c.dom.Element createChildElement(javax.xml.namespace.QName name,
org.w3c.dom.Node parent)
public java.util.Date getTimeout(java.lang.Object aggregation)
AbstractAggregator
getTimeout in class AbstractAggregator
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||