use of com.adaptris.core.NullProduceExceptionHandler in project interlok by adaptris.
the class ExampleWorkflowCase method testSetProduceExceptionHandler.
@Test
public void testSetProduceExceptionHandler() throws Exception {
WorkflowImp wf = createWorkflowForGenericTests();
assertNull(wf.getProduceExceptionHandler());
ProduceExceptionHandler obj = new NullProduceExceptionHandler();
wf.setProduceExceptionHandler(obj);
assertEquals(obj, wf.getProduceExceptionHandler());
}
use of com.adaptris.core.NullProduceExceptionHandler 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