@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 Initializablepublic void destroy()
destroy in interface Initializablepublic Future<ExecutionResult> receive(XIngressConnectorElement connector, XMessageContext messageContext, CompletableFuture<XMessageContext> flowCompletionFuture, ExchangePattern exchangePattern)
public Future<ExecutionResult> receiveResponse(XEgressConnectorElement connector, XMessageContext messageContext)
receiveResponse in interface XPlatformpublic ExecutionResult receiveResponseSync(XEgressConnectorElement connector, XMessageContext messageContext)
receiveResponseSync in interface XPlatformpublic CompletableFuture<ExecutionResult> processAsync(XMessageContext messageContext, XProcessingElement processingElement)
processAsync in interface XPlatformpublic ExecutionResult processSync(XMessageContext messageContext, XProcessingElement processingElement)
processSync in interface XPlatformpublic <T> CompletableFuture<T> executeCompletionAsync(CompletableFuture<T> completableFuture, BiConsumer<T,Throwable> action)
executeCompletionAsync in interface XPlatformpublic <T> CompletableFuture<T> executeCompletionAsync(CompletableFuture<T> completableFuture, BiConsumer<T,Throwable> action, XProcessingElement processingElement)
executeCompletionAsync in interface XPlatformpublic void setExecutorService(ExecutorService executorService)
public void setScheduledThreadPool(ScheduledThreadPoolExecutor scheduledThreadPool)
public <T> ScheduledFuture expireCompletableFutureAfter(CompletableFuture<T> completableFuture, long delayInMillis)
XPlatformCompletableFuture to be completed with a TimeoutException after the given
delayexpireCompletableFutureAfter in interface XPlatformT - return type of the CompletableFuturecompletableFuture - 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)
XPlatformCompletableFuture to be completed with a TimeoutException after the given
delayexpireCompletableFutureAfter in interface XPlatformT - return type of the CompletableFuturecompletableFuture - instance of CompletableFuture to be altereddelayInMillis - delay in milliseconds before expiringtimeoutMessage - Message to be included for the resulting TimeoutExceptionScheduledFuture for the expiration taskpublic ScheduledFuture scheduleTimeoutForMessageContext(XMessageContext xMessageContext, long delayInMillis)
XPlatformXMessageContext as timed-out after the given time delayscheduleTimeoutForMessageContext in interface XPlatformxMessageContext - 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()
XPlatformgetGlobalResponseTimeout in interface XPlatformpublic long getGlobalEgressTimeout()
XPlatformgetGlobalEgressTimeout in interface XPlatformpublic Optional<XIntegrationFlowTracer> getIntegrationFlowTracer()
getIntegrationFlowTracer in interface XPlatformpublic boolean isMessageTracingEnabled()
isMessageTracingEnabled in interface XPlatformpublic void setGlobalResponseTimeout(long globalResponseTimeout)
public void setGlobalEgressTimeout(long globalEgressTimeout)
public void setIntegrationFlowTracer(XIntegrationFlowTracer integrationFlowTracer)
public void setFlowEventListeners(List<XFlowEventListener> flowEventListeners)
setFlowEventListeners in interface XPlatformpublic void addFlowEventListener(XFlowEventListener flowEventListener)
addFlowEventListener in interface XPlatformpublic void notifyFlowEvent(XFlowEventNotificationContext notificationContext, XFlowEventNotificationContext.XFlowEventType flowEventType, ExecutionResult executionResult)
notifyFlowEvent in interface XPlatformpublic XServerConfig getServerConfig()
getServerConfig in interface XPlatformpublic 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 XPlatformmessageContext - XMessageContext related to the completed message flowpublic void subscribeForMessageCount(XMessageCountSubscriber subscriber)
XPlatformsubscribeForMessageCount in interface XPlatformsubscriber - XMessageCountSubscriber instance to be registeredCopyright © 2016–2019 AdroitLogic. All rights reserved.