class SslServerEndpointImpl.SslListenHandle extends Utilities implements ServerEndpoint.ListenHandle
Utilities.SSLContextInfo
Modifier and Type | Field and Description |
---|---|
private int |
acceptFailureCount |
private long |
acceptFailureTime |
private boolean |
closed
Whether the listen handle has been closed.
|
private Set |
connections
Set of connections created by this listen handle
|
private Object |
failureLock
Used to throttle accept failures
|
private RequestDispatcher |
requestDispatcher
The request handler
|
private SecurityContext |
securityContext
The security context at the time of the listen.
|
(package private) ServerSocket |
serverSocket
The server socket used to accept connections
|
ANY_KEY_ALGORITHM, clientLogger, DSA_KEY_ALGORITHM, getSubjectPermission, initLogger, INTEGRITY_PREFERRED, INTEGRITY_REQUIRED, RSA_KEY_ALGORITHM, serverLogger, UNKNOWN_PRINCIPAL
Constructor and Description |
---|
SslListenHandle(RequestDispatcher requestDispatcher,
ServerSocket serverSocket)
Creates a listen handle
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
acceptLoop()
Handles new socket connections.
|
void |
close()
Stops listening for requests on the associated
ListenEndpoint . |
private boolean |
continueAfterAcceptFailure(Throwable t)
Throttles the accept loop after ServerSocket.accept throws
an exception, and decides whether to continue at all.
|
ServerEndpoint.ListenCookie |
getCookie()
Returns a
ListenCookie to identify the listen
operation as the return value of the ListenContext.addListenEndpoint method. |
private int |
getPort()
Returns the port on which this handle is listening.
|
(package private) void |
handleConnection(SslServerEndpointImpl.SslServerConnection connection,
RequestDispatcher requestDispatcher)
Handles a newly accepted server connection.
|
(package private) void |
noteConnectionClosed(SslServerEndpointImpl.SslServerConnection connection)
Called when a connection is closed without a call to close on this
listener.
|
(package private) SslServerEndpointImpl.SslServerConnection |
serverConnection(Socket socket)
Returns a connection for the specified socket.
|
String |
toString()
Returns a string representation of this object.
|
checkValidity, contains, doesEncryption, doesServerAuthentication, equals, firstX509Cert, getCertFactory, getCipherAlgorithm, getClassName, getClientPrincipals, getClientPrincipals, getClientSSLContextInfo, getKeyAlgorithm, getKeyExchangeAlgorithm, getPermittedKeyAlgorithms, getServerPrincipals, getServerSSLContextInfo, getSupportedCipherSuites, hasStrongCipherAlgorithm, logThrow, maintainsIntegrity, permittedKeyAlgorithm, position, releaseClientSSLContextInfo, safeEquals, subjectString, toString
private final RequestDispatcher requestDispatcher
final ServerSocket serverSocket
private final SecurityContext securityContext
private boolean closed
private final Set connections
private final Object failureLock
private long acceptFailureTime
private int acceptFailureCount
SslListenHandle(RequestDispatcher requestDispatcher, ServerSocket serverSocket) throws IOException
IOException
final void acceptLoop()
private boolean continueAfterAcceptFailure(Throwable t)
public String toString()
SslServerEndpointImpl.SslServerConnection serverConnection(Socket socket) throws IOException
IOException
void handleConnection(SslServerEndpointImpl.SslServerConnection connection, RequestDispatcher requestDispatcher)
private int getPort()
public void close()
ServerEndpoint.ListenHandle
ListenEndpoint
.
After this method has returned, no more requests will be
dispatched to the RequestDispatcher
for the
listen operation represented by this
ListenHandle
, and the listen operation is no
longer considered active. This method frees any resources
associated with the listen operation.
Invoking this method terminates any requests that have
been received because of the listen operation and
dispatched to the associated RequestDispatcher
but have not yet had their response output stream closed
(see InboundRequest.abort
);
subsequent I/O operations on such requests will fail with
an IOException
, except some operations that
may succeed because they only affect data in local I/O
buffers.
close
in interface ServerEndpoint.ListenHandle
void noteConnectionClosed(SslServerEndpointImpl.SslServerConnection connection)
public ServerEndpoint.ListenCookie getCookie()
ServerEndpoint.ListenHandle
ListenCookie
to identify the listen
operation as the return value of the ListenContext.addListenEndpoint
method.getCookie
in interface ServerEndpoint.ListenHandle
ListenCookie
to identify the listen
operationCopyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.