Class SecureServerSocketChannel
java.lang.Object
java.nio.channels.spi.AbstractInterruptibleChannel
java.nio.channels.SelectableChannel
java.nio.channels.spi.AbstractSelectableChannel
java.nio.channels.ServerSocketChannel
io.github.rhusar.securenio.channels.SecureServerSocketChannel
- All Implemented Interfaces:
Closeable, AutoCloseable, Channel, InterruptibleChannel, NetworkChannel
A
ServerSocketChannel decorator that wraps a raw server socket channel, producing
SecureSocketChannel instances for each accepted connection. The TLS engine for each
accepted channel is configured in server mode using the provided SSLContext.
Non-accept operations are delegated transparently to the underlying raw server channel.
- Author:
- Radoslav Husar
-
Constructor Summary
ConstructorsConstructorDescriptionSecureServerSocketChannel(ServerSocketChannel delegate, SSLContext sslContext, ExecutorService taskExecutor) -
Method Summary
Modifier and TypeMethodDescriptionaccept()bind(SocketAddress local, int backlog) delegate()Returns the underlying raw (unencrypted) server channel.<T> TgetOption(SocketOption<T> name) protected voidprotected voidimplConfigureBlocking(boolean block) setOption(SocketOption<T> name, T value) socket()Set<SocketOption<?>> Methods inherited from class ServerSocketChannel
bind, open, open, validOpsMethods inherited from class AbstractSelectableChannel
blockingLock, configureBlocking, implCloseChannel, isBlocking, isRegistered, keyFor, provider, registerMethods inherited from class SelectableChannel
registerMethods inherited from class AbstractInterruptibleChannel
begin, close, end, isOpen
-
Constructor Details
-
SecureServerSocketChannel
public SecureServerSocketChannel(ServerSocketChannel delegate, SSLContext sslContext, ExecutorService taskExecutor)
-
-
Method Details
-
delegate
Returns the underlying raw (unencrypted) server channel. -
accept
- Specified by:
acceptin classServerSocketChannel- Throws:
IOException
-
implCloseSelectableChannel
- Specified by:
implCloseSelectableChannelin classAbstractSelectableChannel- Throws:
IOException
-
implConfigureBlocking
- Specified by:
implConfigureBlockingin classAbstractSelectableChannel- Throws:
IOException
-
bind
- Specified by:
bindin classServerSocketChannel- Throws:
IOException
-
setOption
- Specified by:
setOptionin interfaceNetworkChannel- Specified by:
setOptionin classServerSocketChannel- Throws:
IOException
-
getOption
- Throws:
IOException
-
supportedOptions
-
socket
- Specified by:
socketin classServerSocketChannel
-
getLocalAddress
- Specified by:
getLocalAddressin interfaceNetworkChannel- Specified by:
getLocalAddressin classServerSocketChannel- Throws:
IOException
-