public class MuxServer extends Mux
Modifier and Type | Field and Description |
---|---|
private static Logger |
logger
mux logger
|
private RequestDispatcher |
requestDispatcher
the request dispatcher to dispatch incoming requests to
|
private SecurityContext |
securityContext
the security context to dispatch incoming requests in
|
private static int |
serverInitialInboundRation
initial inbound ration as server, default is 32768
|
private static Executor |
userThreadPool
pool of threads for executing tasks with user code: used for
dispatching incoming requests to request dispatchers
|
Abort, Abort_partial, Acknowledgment, busySessions, CLIENT, ClientConnectionHeader_negotiate, Close, Data, Data_ackRequired, Data_close, Data_eof, Data_open, Error, IncrementRation, IncrementRation_shift, initialInboundRation, initialOutboundRation, MAX_REQUESTS, MAX_SESSION_ID, maxFragmentSize, muxDown, muxDownCause, muxDownMessage, muxLock, NoOperation, Ping, PingAck, role, SERVER, serverConnectionReady, sessions, Shutdown
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.
|
private void |
dispatchNewRequest(int sessionID) |
(package private) void |
handleOpen(int sessionID)
Handles message to open a new session over this connection.
|
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).
|
addSession, asyncSendAbort, asyncSendAcknowledgment, asyncSendClientConnectionHeader, asyncSendClose, asyncSendData, asyncSendError, asyncSendIncrementRation, asyncSendNoOperation, asyncSendPing, asyncSendPingAck, asyncSendServerConnectionHeader, asyncSendShutdown, directBuffersUseful, futureSendData, futureSendError, handleDown, processIncomingData, removeSession, setDown, setStartTimeout, start
private static final int serverInitialInboundRation
private static final Executor userThreadPool
private static final Logger logger
private final RequestDispatcher requestDispatcher
private final SecurityContext securityContext
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)
void handleOpen(int sessionID) throws ProtocolException
handleOpen
in class Mux
ProtocolException
private void dispatchNewRequest(int sessionID) throws ProtocolException
ProtocolException
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.