@Override public void start() { timer.start(); }
@Override public void stop() { timer.stop(); } }
@Override public BoxedUnit apply() { timeout.cancel(); return null; } });
/** * Create a new instance using a new {@link HashedWheelTimer} and no {@link ThreadNameDeterminer} * * @param bossExecutor the Executor to use for server the {@link NioClientBoss} * @param bossCount the number of {@link NioClientBoss} instances this {@link NioClientBoss} will hold */ public NioClientBossPool(Executor bossExecutor, int bossCount) { this(bossExecutor, bossCount, new HashedWheelTimer(), null); stopTimer = true; }
/** * Stops the {@link Timer} which was specified in the constructor of this * handler. You should not call this method if the {@link Timer} is in use * by other objects. */ public void releaseExternalResources() { timer.stop(); }
private void scheduleHandshake() { if (clientConfig.getPeriodicHandshakeIntervalMs() > 0) { periodicHandshakeTask = timer.newTimeout(this, clientConfig.getPeriodicHandshakeIntervalMs(), TimeUnit.MILLISECONDS); } }
private void releasePool() { if (workerPool instanceof ExternalResourceReleasable) { ((ExternalResourceReleasable) workerPool).releaseExternalResources(); } } }
@Override protected ThreadRenamingRunnable newThreadRenamingRunnable(int id, ThreadNameDeterminer determiner) { return new ThreadRenamingRunnable(this, "New I/O server boss #" + id, determiner); }
public void remove() { if (bucket != null) { bucket.remove(this); } }
/** * Returns the {@link Inet6Address} representation of a {@link CharSequence} IP address. * <p> * This method will treat all IPv4 type addresses as "IPv4 mapped" (see {@link #getByName(CharSequence, boolean)}) * @param ip {@link CharSequence} IP address to be converted to a {@link Inet6Address} * @return {@link Inet6Address} representation of the {@code ip} or {@code null} if not a valid IP address. */ public static Inet6Address getByName(CharSequence ip) { return getByName(ip, true); }
protected long calculateSize(Object obj) { //logger.debug("Size: "+size); return objectSizeEstimator.estimateSize(obj); }
private void cancelHandshakeTimeout() { if (handshakeTimeout != null) { // cancel the task as we will fail the handshake future now handshakeTimeout.cancel(); } }
/** * Stops the {@link Timer} which was specified in the constructor of this * handler. You should not call this method if the {@link Timer} is in use * by other objects. */ public void releaseExternalResources() { timer.stop(); }
private void releasePools() { if (bossPool instanceof ExternalResourceReleasable) { ((ExternalResourceReleasable) bossPool).releaseExternalResources(); } if (workerPool instanceof ExternalResourceReleasable) { ((ExternalResourceReleasable) workerPool).releaseExternalResources(); } } }
@Override protected ThreadRenamingRunnable newThreadRenamingRunnable(int id, ThreadNameDeterminer determiner) { return new ThreadRenamingRunnable(this, "New I/O boss #" + id, determiner); }
public void operationComplete(ChannelFuture future) throws Exception { timeout.cancel(); } }
/** * Stops the {@link Timer} which was specified in the constructor of this * handler. You should not call this method if the {@link Timer} is in use * by other objects. */ public void releaseExternalResources() { timer.stop(); }
private static void releaseExternal(Executor executor) { if (executor instanceof ExternalResourceReleasable) { ((ExternalResourceReleasable) executor).releaseExternalResources(); } } }
@Override protected ThreadRenamingRunnable newThreadRenamingRunnable(int id, ThreadNameDeterminer determiner) { return new ThreadRenamingRunnable(this, "New I/O worker #" + id, determiner); }
private void releasePools() { if (bossPool instanceof ExternalResourceReleasable) { ((ExternalResourceReleasable) bossPool).releaseExternalResources(); } if (workerPool instanceof ExternalResourceReleasable) { ((ExternalResourceReleasable) workerPool).releaseExternalResources(); } }