use of org.jsmpp.extra.ProcessRequestException in project camel by apache.
the class MessageReceiverListenerImpl method onAcceptDataSm.
public DataSmResult onAcceptDataSm(DataSm dataSm, Session session) throws ProcessRequestException {
LOG.debug("Received a dataSm {}", dataSm);
MessageId newMessageId = messageIDGenerator.newMessageId();
Exchange exchange = endpoint.createOnAcceptDataSm(dataSm, newMessageId.getValue());
try {
processor.process(exchange);
} catch (Exception e) {
exchange.setException(e);
}
if (exchange.getException() != null) {
ProcessRequestException pre = exchange.getException(ProcessRequestException.class);
if (pre == null) {
pre = new ProcessRequestException(exchange.getException().getMessage(), 255, exchange.getException());
}
throw pre;
}
return new DataSmResult(newMessageId, dataSm.getOptionalParameters());
}
use of org.jsmpp.extra.ProcessRequestException in project camel by apache.
the class MessageReceiverListenerImpl method onAcceptDeliverSm.
public void onAcceptDeliverSm(DeliverSm deliverSm) throws ProcessRequestException {
LOG.debug("Received a deliverSm {}", deliverSm);
Exchange exchange;
try {
exchange = endpoint.createOnAcceptDeliverSmExchange(deliverSm);
} catch (Exception e) {
exceptionHandler.handleException("Cannot create exchange. This exception will be ignored.", e);
return;
}
try {
processor.process(exchange);
} catch (Exception e) {
exchange.setException(e);
}
if (exchange.getException() != null) {
ProcessRequestException pre = exchange.getException(ProcessRequestException.class);
if (pre == null) {
pre = new ProcessRequestException(exchange.getException().getMessage(), 255, exchange.getException());
}
throw pre;
}
}
Aggregations