Fields Summary |
---|
protected static org.apache.juli.logging.Log | log |
protected static org.apache.tomcat.util.res.StringManager | sm |
public static final String | CIPHER_SUITE_KEYThe Request attribute key for the cipher suite. |
public static final String | KEY_SIZE_KEYThe Request attribute key for the key size. |
public static final String | CERTIFICATE_KEYThe Request attribute key for the client certificate chain. |
public static final String | SESSION_ID_KEYThe Request attribute key for the session id.
This one is a Tomcat extension to the Servlet spec. |
protected volatile boolean | runningRunning state of the endpoint. |
protected volatile boolean | pausedWill be set to true whenever the endpoint is paused. |
protected boolean | initializedTrack the initialization state of the endpoint. |
protected int | curThreadsBusyCurrent worker threads busy count. |
protected int | curThreadsCurrent worker threads count. |
protected int | sequenceSequence number used to generate thread names. |
protected Executor | executorExternal Executor based thread pool. |
protected int | maxThreadsMaximum amount of worker threads. |
protected int | threadPriorityPriority of the acceptor and poller threads. |
protected int | portServer socket port. |
protected InetAddress | addressAddress for the server socket. |
protected int | backlogAllows the server developer to specify the backlog that
should be used for server sockets. By default, this value
is 100. |
protected boolean | tcpNoDelaySocket TCP no delay. |
protected int | soLingerSocket linger. |
protected int | soTimeoutSocket timeout. |
protected boolean | daemonThe default is true - the created threads will be
in daemon mode. If set to false, the control thread
will not be daemon - and will keep the process alive. |
protected String | nameName of the thread pool, which will be used for naming child threads. |
Methods Summary |
---|
public abstract void | destroy()Deallocate APR memory pools, and close server socket.
|
public java.net.InetAddress | getAddress() return address;
|
public int | getBacklog() return backlog;
|
public int | getCurrentThreadCount()Return the amount of threads that are managed by the pool.
return curThreads;
|
public int | getCurrentThreadsBusy()Return the amount of threads currently busy.
return curThreadsBusy;
|
public boolean | getDaemon() return daemon;
|
public java.util.concurrent.Executor | getExecutor() return executor;
|
public int | getMaxSpareThreads()Dummy maxSpareThreads property. return 0;
|
public int | getMaxThreads() return maxThreads;
|
public int | getMinSpareThreads()Dummy minSpareThreads property. return 0;
|
public java.lang.String | getName() return name;
|
public int | getPort() return port;
|
protected int | getSequence()Get a sequence number used for thread naming.
return sequence++;
|
public int | getSoLinger()
return soLinger;
|
public int | getSoTimeout()
return soTimeout;
|
public boolean | getTcpNoDelay()
return tcpNoDelay;
|
public int | getThreadPriority() return threadPriority;
|
public abstract void | init()Initialize the endpoint.
|
public boolean | isPaused()Return the state of the endpoint.
return paused;
|
public boolean | isRunning()Return the state of the endpoint.
return running;
|
public void | pause()Pause the endpoint, which will make it stop accepting new sockets.
if (running && !paused) {
paused = true;
unlockAccept();
}
|
public void | resume()Resume the endpoint, which will make it start accepting new sockets
again.
if (running) {
paused = false;
}
|
public void | setAddress(java.net.InetAddress address) this.address = address;
|
public void | setBacklog(int backlog)
if (backlog > 0) this.backlog = backlog;
|
public void | setDaemon(boolean b)
daemon = b;
|
public void | setExecutor(java.util.concurrent.Executor executor)
this.executor = executor;
|
public void | setMaxThreads(int maxThreads)
this.maxThreads = maxThreads;
|
public void | setName(java.lang.String name)
this.name = name;
|
public void | setPort(int port) this.port=port;
|
public void | setSoLinger(int soLinger) this.soLinger = soLinger;
|
public void | setSoTimeout(int soTimeout) this.soTimeout = soTimeout;
|
public void | setTcpNoDelay(boolean tcpNoDelay) this.tcpNoDelay = tcpNoDelay;
|
public void | setThreadPriority(int threadPriority)
this.threadPriority = threadPriority;
|
public abstract void | start()Start the APR endpoint, creating acceptor, poller and sendfile threads.
|
public abstract void | stop()Stop the endpoint. This will cause all processing threads to stop.
|
protected void | unlockAccept()Unlock the server socket accept using a bugus connection.
java.net.Socket s = null;
try {
// Need to create a connection to unlock the accept();
if (address == null) {
s = new java.net.Socket("127.0.0.1", port);
} else {
s = new java.net.Socket(address, port);
// setting soLinger to a small value will help shutdown the
// connection quicker
s.setSoLinger(true, 0);
}
} catch(Exception e) {
if (log.isDebugEnabled()) {
log.debug(sm.getString("endpoint.debug.unlock", "" + port), e);
}
} finally {
if (s != null) {
try {
s.close();
} catch (Exception e) {
// Ignore
}
}
}
|