public Object getRequest() throws ESBJobInterruptedException {
try {
currentExchange = messageExchanges.take();
} catch (BufferStoppedException e) {
Thread.currentThread().interrupt();
throw new ESBJobInterruptedException("Job canceled.");
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ESBJobInterruptedException("Job canceled.");
}
return currentExchange.getRequest();
}