/** * This is a helper method which calls {@see retain}/{@see release} before and after * a callable is called. * * @param callable * @param <T> * @return * @throws Exception */ public <T> T use(Callable<T> callable) throws Exception { retain(); try { return callable.call(); } finally { retained.decrementAndGet(); } }
@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(); } } });
public void handle(final SocketWrapper socket) { shutdownTacker.retain(); receivedConnectionAttempts.incrementAndGet(); socketsConnecting.add(socket);
public void handle(final SocketWrapper socket) { Fabric8MQStatus status = getFabric8MQStatus(); shutdownTacker.retain(); status.incrementReceivedConnectionAttempts(); socketsConnecting.add(socket);
public void handle(final SocketWrapper socket) { Fabric8MQStatus status = getFabric8MQStatus(); shutdownTacker.retain(); status.incrementReceivedConnectionAttempts(); socketsConnecting.add(socket);