Bootstrap now implements ExternalResourceReleasable

This commit is contained in:
Trustin Lee 2009-04-22 09:19:31 +00:00
parent c3f3e005d9
commit 59956be369

View File

@ -34,6 +34,7 @@ import org.jboss.netty.channel.ChannelFactory;
import org.jboss.netty.channel.ChannelHandler;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.util.ExternalResourceReleasable;
import org.jboss.netty.util.internal.MapUtil;
/**
@ -50,7 +51,7 @@ import org.jboss.netty.util.internal.MapUtil;
*
* @apiviz.uses org.jboss.netty.channel.ChannelFactory
*/
public class Bootstrap {
public class Bootstrap implements ExternalResourceReleasable {
private volatile ChannelFactory factory;
private volatile ChannelPipeline pipeline = pipeline();
@ -264,4 +265,11 @@ public class Bootstrap {
options.put(key, value);
}
}
public void releaseExternalResources() {
ChannelFactory factory = this.factory;
if (factory != null) {
factory.releaseExternalResources();
}
}
}