public abstract class HttpServerConnection extends Object implements TimedConnection
Modifier and Type | Class and Description |
---|---|
private class |
HttpServerConnection.Dispatcher
Incoming request dispatcher.
|
private class |
HttpServerConnection.InboundRequestImpl
HTTP-based implementation of InboundRequest abstraction.
|
Modifier and Type | Field and Description |
---|---|
private static int |
BUSY |
private static int |
CLOSED |
private RequestDispatcher |
dispatcher |
private static int |
HTTP_MAJOR |
private static int |
HTTP_MINOR |
private static int |
IDLE |
private InputStream |
in |
private HttpServerManager |
manager |
private OutputStream |
out |
private static String |
serverString |
private Socket |
sock |
private int |
state |
private Object |
stateLock |
private static int |
UNSTARTED |
private static Executor |
userThreadPool |
Constructor and Description |
---|
HttpServerConnection(Socket sock,
RequestDispatcher dispatcher,
HttpServerManager manager)
Creates new HttpServerConnection on top of given socket.
|
Modifier and Type | Method and Description |
---|---|
protected void |
busy()
Upcall indicating that connection is about to become busy.
|
protected InvocationConstraints |
checkConstraints(InvocationConstraints constraints)
Checks that the specified requirements are either fully or
partially satisfied by the constraints actually in force for
this connection, and returns any constraints that must be fully
or partially implemented by higher layers in order to fully
satisfy all of the specified requirements.
|
protected void |
checkPermissions()
Verifies that calling context has sufficient security permissions to
receive a request on this connection.
|
private static Header |
createResponseHeader(boolean persist)
Creates base header to be used in response message.
|
protected void |
idle()
Upcall indicating that connection has become idle.
|
protected abstract void |
populateContext(Collection context)
Populates the given context collection with context information
representing this connection.
|
private void |
registerAcks(String ackList)
Notifies listeners for response ack cookies parsed from (possibly null)
comma-separated cookie list string.
|
boolean |
shutdown(boolean force)
Attempts to shut down connection, returning true if connection is
closed.
|
protected void |
start()
Starts request dispatch thread.
|
private static boolean |
supportsChunking(StartLine sline,
Header header)
Returns true if the received message start line indicates that the
sender understands chunked transfer coding.
|
private static boolean |
supportsPersist(StartLine sline,
Header header)
Returns true if the received message start line and header indicate that
the connection can be persisted.
|
private static final int HTTP_MAJOR
private static final int HTTP_MINOR
private static final int UNSTARTED
private static final int IDLE
private static final int BUSY
private static final int CLOSED
private static final String serverString
private static final Executor userThreadPool
private final Socket sock
private final InputStream in
private final OutputStream out
private final RequestDispatcher dispatcher
private final HttpServerManager manager
private final Object stateLock
private int state
public HttpServerConnection(Socket sock, RequestDispatcher dispatcher, HttpServerManager manager) throws IOException
IOException
protected void start()
protected void checkPermissions()
protected InvocationConstraints checkConstraints(InvocationConstraints constraints) throws UnsupportedConstraintException
UnsupportedConstraintException
protected abstract void populateContext(Collection context)
protected void idle()
protected void busy()
public boolean shutdown(boolean force)
shutdown
in interface TimedConnection
private void registerAcks(String ackList)
private static boolean supportsPersist(StartLine sline, Header header)
private static boolean supportsChunking(StartLine sline, Header header)
private static Header createResponseHeader(boolean persist)
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.