|
||||||||||
| 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
public abstract class AbstractAggregator
Aggregator can be used to wait and combine several messages.
This component implements the
Aggregator
pattern.
Closed aggregations are being kept in a Store. By default, we will use a simple
MemoryStore, but you can set your own StoreFactory to use other implementations.
TODO: distributed lock manager
TODO: persistent / transactional timer
| Field Summary |
|---|
| 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, logger, service, serviceUnit |
| Constructor Summary | |
|---|---|
AbstractAggregator()
|
|
| Method Summary | |
|---|---|
protected abstract boolean |
addMessage(Object aggregate,
javax.jbi.messaging.NormalizedMessage message,
javax.jbi.messaging.MessageExchange exchange)
Add a newly received message to this aggregation |
protected abstract void |
buildAggregate(Object aggregate,
javax.jbi.messaging.NormalizedMessage message,
javax.jbi.messaging.MessageExchange exchange,
boolean timeout)
Fill the given JBI message with the aggregation result. |
protected void |
closeAggregation(String correlationId)
Mark an aggregation as closed |
protected abstract Object |
createAggregation(String correlationID)
Creates a new empty aggregation. |
org.apache.servicemix.store.StoreFactory |
getClosedAggregatesStoreFactory()
Access the currently configured StoreFactory for storing closed aggregations |
protected abstract String |
getCorrelationID(javax.jbi.messaging.MessageExchange exchange,
javax.jbi.messaging.NormalizedMessage message)
Retrieve the correlation ID of the given exchange |
ExchangeTarget |
getTarget()
|
protected abstract Date |
getTimeout(Object aggregate)
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. |
protected boolean |
isAggregationClosed(String correlationId)
Check if the aggregation with the given correlation id is closed or not. |
boolean |
isCopyAttachments()
|
boolean |
isCopyProperties()
|
boolean |
isRescheduleTimeouts()
|
boolean |
isSynchronous()
|
protected void |
onTimeout(String processCorrelationId,
String correlationId,
org.apache.servicemix.timers.Timer timer)
|
void |
process(javax.jbi.messaging.MessageExchange exchange)
|
protected void |
processAsync(javax.jbi.messaging.MessageExchange exchange)
|
protected void |
processSync(javax.jbi.messaging.MessageExchange exchange)
|
protected void |
sendAggregate(String processCorrelationId,
String correlationId,
Object aggregation,
boolean timeout,
boolean sync)
|
void |
setClosedAggregatesStoreFactory(org.apache.servicemix.store.StoreFactory closedAggregatesStoreFactory)
Set a new StoreFactory for creating the Store to hold closed aggregations
If it hasn't been set, a simple MemoryStoreFactory will be used by default. |
void |
setCopyAttachments(boolean copyAttachments)
|
void |
setCopyProperties(boolean copyProperties)
|
void |
setRescheduleTimeouts(boolean rescheduleTimeouts)
|
void |
setSynchronous(boolean synchronous)
|
void |
setTarget(ExchangeTarget target)
|
void |
start()
|
| 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 |
| Constructor Detail |
|---|
public AbstractAggregator()
| Method Detail |
|---|
public boolean isSynchronous()
public void setSynchronous(boolean synchronous)
synchronous - the synchronous to setpublic boolean isRescheduleTimeouts()
public void setRescheduleTimeouts(boolean rescheduleTimeouts)
rescheduleTimeouts - the rescheduleTimeouts to setpublic ExchangeTarget getTarget()
public void setTarget(ExchangeTarget target)
target - the target to setpublic boolean isCopyProperties()
public void setCopyProperties(boolean copyProperties)
public boolean isCopyAttachments()
public void setCopyAttachments(boolean copyAttachments)
protected void processSync(javax.jbi.messaging.MessageExchange exchange)
throws Exception
processSync in class EIPEndpointExceptionpublic org.apache.servicemix.store.StoreFactory getClosedAggregatesStoreFactory()
StoreFactory for storing closed aggregations
public void setClosedAggregatesStoreFactory(org.apache.servicemix.store.StoreFactory closedAggregatesStoreFactory)
StoreFactory for creating the Store to hold closed aggregations
If it hasn't been set, a simple MemoryStoreFactory will be used by default.
closedAggregatesStoreFactory -
protected void processAsync(javax.jbi.messaging.MessageExchange exchange)
throws Exception
processAsync in class EIPEndpointException
public void start()
throws Exception
start in interface org.apache.servicemix.common.Endpointstart in class EIPEndpointException
public void process(javax.jbi.messaging.MessageExchange exchange)
throws Exception
process in interface org.apache.servicemix.common.Endpointprocess in class EIPEndpointException
protected void sendAggregate(String processCorrelationId,
String correlationId,
Object aggregation,
boolean timeout,
boolean sync)
throws Exception
Exception
protected void onTimeout(String processCorrelationId,
String correlationId,
org.apache.servicemix.timers.Timer timer)
protected boolean isAggregationClosed(String correlationId)
throws Exception
correlationId -
Exception
protected void closeAggregation(String correlationId)
throws Exception
correlationId -
Exception
protected abstract String getCorrelationID(javax.jbi.messaging.MessageExchange exchange,
javax.jbi.messaging.NormalizedMessage message)
throws Exception
exchange - message -
Exception
protected abstract Object createAggregation(String correlationID)
throws Exception
correlationID -
Exceptionprotected abstract Date getTimeout(Object aggregate)
aggregate -
protected abstract boolean addMessage(Object aggregate,
javax.jbi.messaging.NormalizedMessage message,
javax.jbi.messaging.MessageExchange exchange)
throws Exception
aggregate - message - exchange -
true if the aggregate id complete
Exception
protected abstract void buildAggregate(Object aggregate,
javax.jbi.messaging.NormalizedMessage message,
javax.jbi.messaging.MessageExchange exchange,
boolean timeout)
throws Exception
aggregate - message - exchange - timeout - false if the aggregation has completed or true
if this aggregation has timed out
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||