Java源码示例:org.jboss.netty.util.ExternalResourceReleasable

示例1
@Override
public synchronized void unbind() {
    if (started == false) {
        return;
    }
    ChannelPipelineFactory factory = bootstrap.getPipelineFactory();
    if (factory instanceof ExternalResourceReleasable) {
        ((ExternalResourceReleasable) factory).releaseExternalResources();
    }
    channels.close().awaitUninterruptibly();
    bootstrap.releaseExternalResources();
    started = false;
}
 
示例2
/**
 * Destroy the {@link ShareableWorkerPool} and release all resources. After this is called its not usable anymore
 */
public void destroy() {
    wrapped.shutdown();
    if (wrapped instanceof ExternalResourceReleasable) {
        ((ExternalResourceReleasable) wrapped).releaseExternalResources();
    }
}
 
示例3
private void releasePools() {
    if (bossPool instanceof ExternalResourceReleasable) {
        ((ExternalResourceReleasable) bossPool).releaseExternalResources();
    }
    if (workerPool instanceof ExternalResourceReleasable) {
        ((ExternalResourceReleasable) workerPool).releaseExternalResources();
    }
}
 
示例4
private void releasePools() {
    if (bossPool instanceof ExternalResourceReleasable) {
        ((ExternalResourceReleasable) bossPool).releaseExternalResources();
    }
    if (workerPool instanceof ExternalResourceReleasable) {
        ((ExternalResourceReleasable) workerPool).releaseExternalResources();
    }
}
 
示例5
private void releasePools() {
	if (bossPool instanceof ExternalResourceReleasable) {
		((ExternalResourceReleasable) bossPool).releaseExternalResources();
	}
	if (workerPool instanceof ExternalResourceReleasable) {
		((ExternalResourceReleasable) workerPool).releaseExternalResources();
	}
}