List of usage examples for javax.resource.spi.endpoint MessageEndpoint beforeDelivery
void beforeDelivery(java.lang.reflect.Method method) throws NoSuchMethodException, ResourceException;
From source file:me.jtalk.socketconnector.SocketResourceAdapter.java
private <T> void sendEndpoint(MessageEndpointFactory factory, Method target, T message) { try {// w w w.j ava2s . c o m MessageEndpoint endpoint = factory.createEndpoint(null); endpoint.beforeDelivery(target); try { log.trace("Sending endpoint message to ''{}'': prepare", target.getName()); if (message == null) { target.invoke(endpoint); } else { target.invoke(endpoint, message); } log.trace("Sending endpoint message to ''{}'': sent", target.getName()); } catch (IllegalAccessException | InvocationTargetException e) { log.error("Exception on message endpoint invocation", e); } endpoint.afterDelivery(); endpoint.release(); } catch (UnavailableException e) { log.error("Message endpoint is unavailable", e); } catch (ResourceException | NoSuchMethodException e) { log.error("Exception on message endpoint processing", e); } }