FileDocCategorySizeDatePackage
BP.javaAPI DocSun JDK 1.5.0 Example2782Sat Jan 08 15:08:43 GMT 2005None

BP

public class BP extends Server
A multi-threaded server which creates a pool of threads for use by the server. The Thread pool decides how to schedule those threads.
author
Mark Reinhold
author
Brad R. Wetmore
version
1.2, 04/07/26

Fields Summary
private static final int
POOL_MULTIPLE
Constructors Summary
BP(int port, int backlog, boolean secure)


            
	super(port, backlog, secure);
    
Methods Summary
voidrunServer()


	ExecutorService xec = Executors.newFixedThreadPool(
	    Runtime.getRuntime().availableProcessors() * POOL_MULTIPLE);

	for (;;) {

	    SocketChannel sc = ssc.accept();

	    ChannelIO cio = (sslContext != null ?
		ChannelIOSecure.getInstance(
		    sc, true /* blocking */, sslContext) :
		ChannelIO.getInstance(
		    sc, true /* blocking */));

	    RequestServicer svc = new RequestServicer(cio);
	    xec.execute(svc);
	}