Class ConcurrentSplitterFlowElementInvoker

  • All Implemented Interfaces:
    org.ikasan.spec.configuration.Configured<ConcurrentSplitterInvokerConfiguration>, org.ikasan.spec.configuration.ConfiguredResource<ConcurrentSplitterInvokerConfiguration>, org.ikasan.spec.flow.FlowElementInvoker<org.ikasan.spec.component.splitting.Splitter>, org.ikasan.spec.management.ManagedService

    public class ConcurrentSplitterFlowElementInvoker
    extends AbstractFlowElementInvoker<ConcurrentSplitterInvokerConfiguration>
    implements org.ikasan.spec.flow.FlowElementInvoker<org.ikasan.spec.component.splitting.Splitter>, org.ikasan.spec.management.ManagedService
    A default implementation of the FlowElementInvoker for a concurrent splitter This invokes a subFlow concurrently, using an ExecutorService, for each element of the resulting split, then continues with the main flow in the current thread
    Author:
    Ikasan Development Team
    • Constructor Detail

      • ConcurrentSplitterFlowElementInvoker

        public ConcurrentSplitterFlowElementInvoker​(java.util.concurrent.ExecutorService executorService)
        Constructor
        Parameters:
        executorService - the ExecutorService used to invoke the subFlow component(s)
    • Method Detail

      • getInvokerType

        public java.lang.String getInvokerType()
        Specified by:
        getInvokerType in interface org.ikasan.spec.flow.FlowElementInvoker<org.ikasan.spec.component.splitting.Splitter>
      • invoke

        public org.ikasan.spec.flow.FlowElement invoke​(java.util.List<org.ikasan.spec.flow.FlowEventListener> flowEventListeners,
                                                       java.lang.String moduleName,
                                                       java.lang.String flowName,
                                                       org.ikasan.spec.flow.FlowInvocationContext flowInvocationContext,
                                                       org.ikasan.spec.flow.FlowEvent flowEvent,
                                                       org.ikasan.spec.flow.FlowElement<org.ikasan.spec.component.splitting.Splitter> flowElement)
        Specified by:
        invoke in interface org.ikasan.spec.flow.FlowElementInvoker<org.ikasan.spec.component.splitting.Splitter>
      • pendingCallback

        protected boolean pendingCallback​(java.util.List payloads,
                                          java.util.concurrent.atomic.AtomicInteger count)
        Allows for easier testing
        Parameters:
        payloads -
        Returns:
      • newAsyncTask

        protected ConcurrentSplitterFlowElementInvoker.SplitFlowElement newAsyncTask​(org.ikasan.spec.flow.FlowElement nextFlowElementInRoute,
                                                                                     java.util.List<org.ikasan.spec.flow.FlowEventListener> flowEventListeners,
                                                                                     java.lang.String moduleName,
                                                                                     java.lang.String flowName,
                                                                                     org.ikasan.spec.flow.FlowInvocationContext flowInvocationContext,
                                                                                     org.ikasan.spec.flow.FlowEvent flowEvent)
        Factory method to aid testing.
        Parameters:
        nextFlowElementInRoute -
        flowEventListeners -
        moduleName -
        flowName -
        flowInvocationContext -
        flowEvent -
        Returns:
      • destroy

        public void destroy()
        Specified by:
        destroy in interface org.ikasan.spec.management.ManagedService