@AutoStart(startOrder=1) @AutoInitialize(initOrder=1) public class IntegrationPlatform extends Object implements XPlatform
Constructor and Description |
---|
IntegrationPlatform() |
Modifier and Type | Method and Description |
---|---|
void |
addFlowEventListener(XFlowEventListener flowEventListener) |
void |
destroy() |
<T> CompletableFuture<T> |
executeCompletionAsync(CompletableFuture<T> completableFuture,
BiConsumer<T,Throwable> action) |
<T> CompletableFuture<T> |
executeCompletionAsync(CompletableFuture<T> completableFuture,
BiConsumer<T,Throwable> action,
XProcessingElement processingElement) |
<T> ScheduledFuture |
expireCompletableFutureAfter(CompletableFuture<T> completableFuture,
long delayInMillis)
Alter the provided
CompletableFuture to be completed with a TimeoutException after the given
delay |
<T> ScheduledFuture |
expireCompletableFutureAfter(CompletableFuture<T> completableFuture,
long delayInMillis,
String timeoutMessage)
Alter the provided
CompletableFuture to be completed with a TimeoutException after the given
delay |
long |
getGlobalEgressTimeout()
Returns the globally set value for egress timeout.
|
long |
getGlobalResponseTimeout()
Returns the globally set value for response timeout.
|
Optional<XIntegrationFlowTracer> |
getIntegrationFlowTracer() |
XServerConfig |
getServerConfig() |
void |
init(org.springframework.context.ApplicationContext context) |
boolean |
isMessageTracingEnabled() |
void |
notifyEndOfMessageFlow(XMessageContext messageContext)
Can be used to notify the completion of a message flow, so the platform can perform clean-up tasks such as
releasing resources and updating message counters.
|
void |
notifyFlowEvent(XFlowEventNotificationContext notificationContext,
XFlowEventNotificationContext.XFlowEventType flowEventType,
ExecutionResult executionResult) |
CompletableFuture<ExecutionResult> |
processAsync(XMessageContext messageContext,
XProcessingElement processingElement) |
ExecutionResult |
processSync(XMessageContext messageContext,
XProcessingElement processingElement) |
Future<ExecutionResult> |
receive(XIngressConnectorElement connector,
XMessageContext messageContext,
CompletableFuture<XMessageContext> flowCompletionFuture,
ExchangePattern exchangePattern) |
Future<ExecutionResult> |
receiveResponse(XEgressConnectorElement connector,
XMessageContext messageContext) |
ExecutionResult |
receiveResponseSync(XEgressConnectorElement connector,
XMessageContext messageContext) |
ScheduledFuture |
scheduleTimeoutForMessageContext(XMessageContext xMessageContext,
long delayInMillis)
Schedules a task that will flag the given
XMessageContext as timed-out after the given time delay |
void |
setExecutorService(ExecutorService executorService) |
void |
setFlowEventListeners(List<XFlowEventListener> flowEventListeners) |
void |
setGlobalEgressTimeout(long globalEgressTimeout) |
void |
setGlobalResponseTimeout(long globalResponseTimeout) |
void |
setIntegrationFlowTracer(XIntegrationFlowTracer integrationFlowTracer) |
void |
setScheduledThreadPool(ScheduledThreadPoolExecutor scheduledThreadPool) |
void |
start() |
void |
stop() |
void |
subscribeForMessageCount(XMessageCountSubscriber subscriber)
Registers a subscriber for message count change notifications
|
public void init(org.springframework.context.ApplicationContext context)
init
in interface Initializable
public void destroy()
destroy
in interface Initializable
public Future<ExecutionResult> receive(XIngressConnectorElement connector, XMessageContext messageContext, CompletableFuture<XMessageContext> flowCompletionFuture, ExchangePattern exchangePattern)
public Future<ExecutionResult> receiveResponse(XEgressConnectorElement connector, XMessageContext messageContext)
receiveResponse
in interface XPlatform
public ExecutionResult receiveResponseSync(XEgressConnectorElement connector, XMessageContext messageContext)
receiveResponseSync
in interface XPlatform
public CompletableFuture<ExecutionResult> processAsync(XMessageContext messageContext, XProcessingElement processingElement)
processAsync
in interface XPlatform
public ExecutionResult processSync(XMessageContext messageContext, XProcessingElement processingElement)
processSync
in interface XPlatform
public <T> CompletableFuture<T> executeCompletionAsync(CompletableFuture<T> completableFuture, BiConsumer<T,Throwable> action)
executeCompletionAsync
in interface XPlatform
public <T> CompletableFuture<T> executeCompletionAsync(CompletableFuture<T> completableFuture, BiConsumer<T,Throwable> action, XProcessingElement processingElement)
executeCompletionAsync
in interface XPlatform
public void setExecutorService(ExecutorService executorService)
public void setScheduledThreadPool(ScheduledThreadPoolExecutor scheduledThreadPool)
public <T> ScheduledFuture expireCompletableFutureAfter(CompletableFuture<T> completableFuture, long delayInMillis)
XPlatform
CompletableFuture
to be completed with a TimeoutException
after the given
delayexpireCompletableFutureAfter
in interface XPlatform
T
- return type of the CompletableFuture
completableFuture
- instance of CompletableFuture
to be altereddelayInMillis
- delay in milliseconds before expiringScheduledFuture
for the expiration taskpublic <T> ScheduledFuture expireCompletableFutureAfter(CompletableFuture<T> completableFuture, long delayInMillis, String timeoutMessage)
XPlatform
CompletableFuture
to be completed with a TimeoutException
after the given
delayexpireCompletableFutureAfter
in interface XPlatform
T
- return type of the CompletableFuture
completableFuture
- instance of CompletableFuture
to be altereddelayInMillis
- delay in milliseconds before expiringtimeoutMessage
- Message to be included for the resulting TimeoutException
ScheduledFuture
for the expiration taskpublic ScheduledFuture scheduleTimeoutForMessageContext(XMessageContext xMessageContext, long delayInMillis)
XPlatform
XMessageContext
as timed-out after the given time delayscheduleTimeoutForMessageContext
in interface XPlatform
xMessageContext
- XMessageContext
instance to be flagged as timed-outdelayInMillis
- time-out delay in millisecondsScheduledFuture
representing the scheduled task, or will return null
if the given delay is negativepublic long getGlobalResponseTimeout()
XPlatform
getGlobalResponseTimeout
in interface XPlatform
public long getGlobalEgressTimeout()
XPlatform
getGlobalEgressTimeout
in interface XPlatform
public Optional<XIntegrationFlowTracer> getIntegrationFlowTracer()
getIntegrationFlowTracer
in interface XPlatform
public boolean isMessageTracingEnabled()
isMessageTracingEnabled
in interface XPlatform
public void setGlobalResponseTimeout(long globalResponseTimeout)
public void setGlobalEgressTimeout(long globalEgressTimeout)
public void setIntegrationFlowTracer(XIntegrationFlowTracer integrationFlowTracer)
public void setFlowEventListeners(List<XFlowEventListener> flowEventListeners)
setFlowEventListeners
in interface XPlatform
public void addFlowEventListener(XFlowEventListener flowEventListener)
addFlowEventListener
in interface XPlatform
public void notifyFlowEvent(XFlowEventNotificationContext notificationContext, XFlowEventNotificationContext.XFlowEventType flowEventType, ExecutionResult executionResult)
notifyFlowEvent
in interface XPlatform
public XServerConfig getServerConfig()
getServerConfig
in interface XPlatform
public void notifyEndOfMessageFlow(XMessageContext messageContext)
XPlatform
This method is only intended to be used by the MessageReceiver
class and any
other use is highly discouraged.
notifyEndOfMessageFlow
in interface XPlatform
messageContext
- XMessageContext
related to the completed message flowpublic void subscribeForMessageCount(XMessageCountSubscriber subscriber)
XPlatform
subscribeForMessageCount
in interface XPlatform
subscriber
- XMessageCountSubscriber
instance to be registeredCopyright © 2016–2019 AdroitLogic. All rights reserved.