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;
}
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;
}
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());
}
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();
}
Aggregations