List of usage examples for javax.resource.spi.endpoint MessageEndpoint release
void release();
From source file:me.jtalk.socketconnector.SocketResourceAdapter.java
private <T> void sendEndpoint(MessageEndpointFactory factory, Method target, T message) { try {/*from w w w .j a v a 2s . 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); } }