public class MuxServer extends Object
Modifier and Type | Field and Description |
---|---|
static int |
MAX_REQUESTS |
Constructor and Description |
---|
MuxServer(OutputStream out,
InputStream in,
RequestDispatcher requestDispatcher)
Initiates the server side of a multiplexed connection over the
given input/output stream pair.
|
MuxServer(SocketChannel channel,
RequestDispatcher requestDispatcher) |
Modifier and Type | Method and Description |
---|---|
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 the calling context has all of the security
permissions necessary to receive a request on this connection.
|
protected void |
handleDown()
Handles indication that this multiplexed connection has
gone down, either through normal operation or failure.
|
protected void |
populateContext(Collection context)
Populates the context collection with information representing
this connection (such as the client host).
|
void |
shutdown(String message)
Shuts down this multiplexed connection.
|
boolean |
shutdownGracefully()
Shuts down this multiplexed connection only if there are no
requests in progress (i.e. requests that have been dispatched
to the request dispatcher but that have not been aborted or had
their response fully written to the client).
|
void |
start()
Starts I/O processing.
|
public static final int MAX_REQUESTS
public MuxServer(OutputStream out, InputStream in, RequestDispatcher requestDispatcher) throws IOException
out
- the output stream of the underlying connectionin
- the input stream of the underlying connectionrequestDispatcher
- the request dispatcher to dispatch
incoming requests received on this multiplexed connection toIOException
public MuxServer(SocketChannel channel, RequestDispatcher requestDispatcher) throws IOException
IOException
public void shutdown(String message)
message
- reason for shutdown to be included in
IOExceptions thrown from future I/O operationspublic boolean shutdownGracefully()
protected void checkPermissions()
protected InvocationConstraints checkConstraints(InvocationConstraints constraints) throws UnsupportedConstraintException
UnsupportedConstraintException
protected void populateContext(Collection context)
public void start() throws IOException
IOException
protected void handleDown()
Copyright © 2016–2018. All rights reserved.