Search in sources :

Example 1 with WorkflowInterceptor

use of com.adaptris.core.WorkflowInterceptor in project interlok by adaptris.

the class BasicJettyConsumer method submitToWorkflow.

private boolean submitToWorkflow(AdaptrisMessage msg) {
    boolean waitForCompletion = false;
    if (retrieveAdaptrisMessageListener() instanceof WorkflowImp) {
        List<WorkflowInterceptor> interceptors = ((WorkflowImp) retrieveAdaptrisMessageListener()).getInterceptors();
        for (WorkflowInterceptor i : interceptors) {
            if (JettyWorkflowInterceptorImpl.class.isAssignableFrom(i.getClass())) {
                waitForCompletion = true;
                break;
            }
        }
    }
    retrieveAdaptrisMessageListener().onAdaptrisMessage(msg);
    return waitForCompletion;
}
Also used : WorkflowInterceptor(com.adaptris.core.WorkflowInterceptor) WorkflowImp(com.adaptris.core.WorkflowImp)

Example 2 with WorkflowInterceptor

use of com.adaptris.core.WorkflowInterceptor in project interlok by adaptris.

the class WorkflowManager method testAndInjectCachingInterceptor.

/**
 * Test if we have a configured caching interceptor. If we do, great, otherwise create one.
 *
 * @throws CoreException
 */
private void testAndInjectCachingInterceptor() throws CoreException {
    for (WorkflowInterceptor interceptor : managedWorkflow.getInterceptors()) {
        if (interceptor instanceof JmxSubmitMessageInterceptor) {
            this.injectInterceptor = (JmxSubmitMessageInterceptor) interceptor;
        }
    }
    if (this.injectInterceptor == null) {
        injectInterceptor = LifecycleHelper.initAndStart(new JmxSubmitMessageInterceptor());
        managedWorkflow.getInterceptors().add(injectInterceptor);
    }
}
Also used : InFlightWorkflowInterceptor(com.adaptris.core.interceptor.InFlightWorkflowInterceptor) WorkflowInterceptor(com.adaptris.core.WorkflowInterceptor) JettyPoolingWorkflowInterceptor(com.adaptris.core.http.jetty.JettyPoolingWorkflowInterceptor)

Example 3 with WorkflowInterceptor

use of com.adaptris.core.WorkflowInterceptor in project interlok by adaptris.

the class StatisticsMBeanCase method createWorkflow.

protected static StandardWorkflow createWorkflow(String uid, WorkflowInterceptor... interceptors) throws CoreException {
    StandardWorkflow wf = new StandardWorkflow();
    wf.setUniqueId(uid);
    for (WorkflowInterceptor wi : interceptors) {
        wf.addInterceptor(wi);
    }
    return wf;
}
Also used : StandardWorkflow(com.adaptris.core.StandardWorkflow) WorkflowInterceptor(com.adaptris.core.WorkflowInterceptor)

Example 4 with WorkflowInterceptor

use of com.adaptris.core.WorkflowInterceptor in project interlok by adaptris.

the class MessageNotificationCase method createWorkflow.

protected StandardWorkflow createWorkflow(String uid, WorkflowInterceptor... interceptors) throws CoreException {
    StandardWorkflow wf = new StandardWorkflow();
    wf.setUniqueId(uid);
    for (WorkflowInterceptor wi : interceptors) {
        wf.addInterceptor(wi);
    }
    return wf;
}
Also used : StandardWorkflow(com.adaptris.core.StandardWorkflow) WorkflowInterceptor(com.adaptris.core.WorkflowInterceptor)

Example 5 with WorkflowInterceptor

use of com.adaptris.core.WorkflowInterceptor in project interlok by adaptris.

the class InFlightWorkflowInterceptorTest method createPoolingWorkflow.

protected static PoolingWorkflow createPoolingWorkflow(String uid, WorkflowInterceptor... interceptors) throws CoreException {
    PoolingWorkflow wf = new PoolingWorkflow();
    wf.setUniqueId(uid);
    for (WorkflowInterceptor wi : interceptors) {
        wf.addInterceptor(wi);
    }
    return wf;
}
Also used : WorkflowInterceptor(com.adaptris.core.WorkflowInterceptor) PoolingWorkflow(com.adaptris.core.PoolingWorkflow)

Aggregations

WorkflowInterceptor (com.adaptris.core.WorkflowInterceptor)5 StandardWorkflow (com.adaptris.core.StandardWorkflow)2 PoolingWorkflow (com.adaptris.core.PoolingWorkflow)1 WorkflowImp (com.adaptris.core.WorkflowImp)1 JettyPoolingWorkflowInterceptor (com.adaptris.core.http.jetty.JettyPoolingWorkflowInterceptor)1 InFlightWorkflowInterceptor (com.adaptris.core.interceptor.InFlightWorkflowInterceptor)1