Search in sources :

Example 1 with AdaptrisMessageConsumer

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

the class ExampleChannelCase method configureWorkflow.

protected Workflow configureWorkflow(WorkflowImp impl) throws CoreException {
    impl.setUniqueId(UUID.randomUUID().toString());
    AdaptrisMessageConsumer consumer = new NullMessageConsumer();
    impl.setConsumer(consumer);
    impl.setProducer(new NullMessageProducer());
    impl.setServiceCollection(createServiceCollection());
    return impl;
}
Also used : AdaptrisMessageConsumer(com.adaptris.core.AdaptrisMessageConsumer) NullMessageProducer(com.adaptris.core.NullMessageProducer) NullMessageConsumer(com.adaptris.core.NullMessageConsumer)

Example 2 with AdaptrisMessageConsumer

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

the class FailedMessageRetrierCase method createWorkflow.

protected StandardWorkflow createWorkflow(String uniqueId) throws Exception {
    AdaptrisMessageConsumer consumer = new MockMessageConsumer();
    AdaptrisMessageProducer producer = new MockMessageProducer();
    StandardWorkflow workflow = new StandardWorkflow();
    workflow.setUniqueId(uniqueId);
    workflow.setConsumer(consumer);
    workflow.setProducer(producer);
    Channel channel = new MockChannel();
    channel.setUniqueId(null);
    channel.getWorkflowList().add(workflow);
    channel.prepare();
    return workflow;
}
Also used : StandardWorkflow(com.adaptris.core.StandardWorkflow) MockChannel(com.adaptris.core.stubs.MockChannel) MockMessageProducer(com.adaptris.core.stubs.MockMessageProducer) AdaptrisMessageConsumer(com.adaptris.core.AdaptrisMessageConsumer) AdaptrisMessageProducer(com.adaptris.core.AdaptrisMessageProducer) MockChannel(com.adaptris.core.stubs.MockChannel) Channel(com.adaptris.core.Channel) MockMessageConsumer(com.adaptris.core.stubs.MockMessageConsumer)

Example 3 with AdaptrisMessageConsumer

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

the class ExampleWorkflowCase method testSetConsumer.

@Test
public void testSetConsumer() throws Exception {
    WorkflowImp wf = createWorkflowForGenericTests();
    AdaptrisMessageConsumer obj = wf.getConsumer();
    try {
        wf.setConsumer(null);
        fail();
    } catch (IllegalArgumentException e) {
    }
    assertEquals(obj, wf.getConsumer());
}
Also used : AdaptrisMessageConsumer(com.adaptris.core.AdaptrisMessageConsumer) WorkflowImp(com.adaptris.core.WorkflowImp) Test(org.junit.Test)

Example 4 with AdaptrisMessageConsumer

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

the class JmsTransactedWorkflow method initialiseWorkflow.

@Override
protected void initialiseWorkflow() throws CoreException {
    AdaptrisMessageConsumer amc = getConsumer();
    if (amc instanceof JmsPollingConsumerImpl) {
        ((JmsPollingConsumerImpl) amc).setRollbackTimeout(waitPeriodAfterRollbackMs());
        ((JmsPollingConsumerImpl) amc).setTransacted(Boolean.TRUE);
    } else if (amc instanceof JmsConsumerImpl) {
        ((JmsConsumerImpl) amc).setRollbackTimeout(waitPeriodAfterRollbackMs());
        ((JmsConsumerImpl) amc).setTransacted(Boolean.TRUE);
    } else if (!(amc instanceof NullMessageConsumer)) {
        throw new CoreException(this.getClass().getSimpleName() + " must be used with a JMSConsumer");
    }
    ProduceExceptionHandler produceExceptionHandler = getProduceExceptionHandler();
    if (produceExceptionHandler != null && !(produceExceptionHandler instanceof NullProduceExceptionHandler)) {
        throw new CoreException(this.getClass().getSimpleName() + " may not have a ProduceExceptionHandler set");
    }
    super.initialiseWorkflow();
}
Also used : CoreException(com.adaptris.core.CoreException) AdaptrisMessageConsumer(com.adaptris.core.AdaptrisMessageConsumer) NullProduceExceptionHandler(com.adaptris.core.NullProduceExceptionHandler) NullProduceExceptionHandler(com.adaptris.core.NullProduceExceptionHandler) ProduceExceptionHandler(com.adaptris.core.ProduceExceptionHandler) NullMessageConsumer(com.adaptris.core.NullMessageConsumer)

Aggregations

AdaptrisMessageConsumer (com.adaptris.core.AdaptrisMessageConsumer)4 NullMessageConsumer (com.adaptris.core.NullMessageConsumer)2 AdaptrisMessageProducer (com.adaptris.core.AdaptrisMessageProducer)1 Channel (com.adaptris.core.Channel)1 CoreException (com.adaptris.core.CoreException)1 NullMessageProducer (com.adaptris.core.NullMessageProducer)1 NullProduceExceptionHandler (com.adaptris.core.NullProduceExceptionHandler)1 ProduceExceptionHandler (com.adaptris.core.ProduceExceptionHandler)1 StandardWorkflow (com.adaptris.core.StandardWorkflow)1 WorkflowImp (com.adaptris.core.WorkflowImp)1 MockChannel (com.adaptris.core.stubs.MockChannel)1 MockMessageConsumer (com.adaptris.core.stubs.MockMessageConsumer)1 MockMessageProducer (com.adaptris.core.stubs.MockMessageProducer)1 Test (org.junit.Test)1