@Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { retain(); try { return method.invoke(target, args); } catch (InvocationTargetException e) { throw e.getCause(); } finally { release(); } } });
private void handleConnectFailure(SocketWrapper socket, String reason) { if( socketsConnecting.remove(socket) ) { if( reason!=null ) { LOG.info(reason); } failedConnectionAttempts.incrementAndGet(); socket.close(); shutdownTacker.release(); } }
/** * Marks the resource as being in a shutdown state. Once no more concurrent * users of the resource are active, the <code>onStopCallback</code> will * be run possibly after this method returns. * * @param onStopCallback if not null will be run once * @throws ShutdownException if {@see shutdown} has been previously called. */ public void shutdown(Runnable onStopCallback) throws ShutdownException { if( stopping.compareAndSet(false, true) ) { this.onStopCallback = onStopCallback; release(); } else { throw new ShutdownException(); } }
private void handleShutdown(ConnectedSocketInfo connectedInfo) { if( socketsConnected.remove(connectedInfo) ) { connectedInfo.from.close(); connectedInfo.to.close(); shutdownTacker.release(); } }
private void handleConnectFailure(SocketWrapper socket, String reason) { if (socketsConnecting.remove(socket)) { if (reason != null) { LOG.info(reason); } Fabric8MQStatus status = getFabric8MQStatus(); status.incrementFailedConnectionAttempts(); socket.close(); shutdownTacker.release(); } }
private void handleConnectFailure(SocketWrapper socket, String reason) { if (socketsConnecting.remove(socket)) { if (reason != null) { LOG.info(reason); } Fabric8MQStatus status = getFabric8MQStatus(); status.incrementFailedConnectionAttempts(); socket.close(); shutdownTacker.release(); } }
private void handleShutdown(ConnectedSocketInfo connectedInfo) { if (socketsConnected.remove(connectedInfo)) { try { for (MultiplexerController multiplexerController : multiplexerControllers) { multiplexerController.removeTransport(connectedInfo.getTo()); } handle(connectedInfo.getTo()); connectedInfo.close(); } catch (Throwable e) { LOG.debug("Caught an error in handleShutdown", e); } finally { shutdownTacker.release(); } } }
private void handleShutdown(ConnectedSocketInfo connectedInfo) { if (socketsConnected.remove(connectedInfo)) { try { for (MultiplexerController multiplexerController : multiplexerControllers) { multiplexerController.removeTransport(connectedInfo.getTo()); } handle(connectedInfo.getTo()); connectedInfo.close(); } catch (Throwable e) { LOG.debug("Caught an error in handleShutdown", e); } finally { shutdownTacker.release(); } } }