public abstract class AbstractBindingHandler extends Object implements SocketBinder
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractBindingHandler.Builder<E extends AbstractBindingHandler.Builder>
Builder
|
| Modifier and Type | Field and Description |
|---|---|
protected Processor |
processor |
protected ProcessorSelector |
processorSelector |
protected static Random |
RANDOM |
protected NIOTransport |
transport |
| Constructor and Description |
|---|
AbstractBindingHandler(NIOTransport transport) |
| Modifier and Type | Method and Description |
|---|---|
Connection<?> |
bind(int port)
Binds Transport to the specific port on localhost.
|
Connection<?> |
bind(String host,
int port)
Binds Transport to the specific host and port.
|
Connection<?> |
bind(String host,
int port,
int backlog)
Binds Transport to the specific host and port.
|
Connection<?> |
bind(String host,
PortRange portRange,
boolean randomStartPort,
int backlog)
Binds Transport to the specific host, and port within a
PortRange. |
Connection<?> |
bind(String host,
PortRange portRange,
int backlog)
Binds Transport to the specific host, and port within a
PortRange. |
Processor |
getProcessor()
|
ProcessorSelector |
getProcessorSelector()
Gets the default
ProcessorSelector, which will be used to get Processor to process I/O events,
occurring on connection phase. |
protected <T> T |
getSystemInheritedChannel(Class<?> channelType) |
void |
setProcessor(Processor processor)
|
void |
setProcessorSelector(ProcessorSelector processorSelector)
Sets the default
ProcessorSelector, which will be used to get Processor to process I/O events,
occurring on connection phase. |
void |
unbindAll()
This operation is not supported by implementations of
AbstractBindingHandler. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbind, bind, bindToInherited, unbindprotected static final Random RANDOM
protected final NIOTransport transport
protected Processor processor
protected ProcessorSelector processorSelector
public AbstractBindingHandler(NIOTransport transport)
public Processor getProcessor()
public void setProcessor(Processor processor)
public ProcessorSelector getProcessorSelector()
ProcessorSelector, which will be used to get Processor to process I/O events,
occurring on connection phase.ProcessorSelector, which will be used to get Processor to process I/O events,
occurring on connection phase.public void setProcessorSelector(ProcessorSelector processorSelector)
ProcessorSelector, which will be used to get Processor to process I/O events,
occurring on connection phase.processorSelector - the default ProcessorSelector, which will be used to get Processor to
process I/O events, occurring on connection phase.public Connection<?> bind(int port) throws IOException
bind in interface SocketBinderport - the port to bind toConnectionIOException - if unable to bind i.e. if port already boundpublic Connection<?> bind(String host, int port) throws IOException
bind in interface SocketBinderhost - the local host the server will bind toport - specific port to bind toConnectionIOException - if unable to bind i.e. if port already boundpublic Connection<?> bind(String host, int port, int backlog) throws IOException
bind in interface SocketBinderhost - the local host the server will bind toport - the port to bind tobacklog - the maximum length of the queueConnectionIOException - if unable to bind i.e. if port already boundpublic Connection<?> bind(String host, PortRange portRange, int backlog) throws IOException
PortRange.bind in interface SocketBinderhost - the local host the server will bind toportRange - PortRange.backlog - the maximum length of the queueConnectionIOException - if unable to bind i.e. if port already boundpublic Connection<?> bind(String host, PortRange portRange, boolean randomStartPort, int backlog) throws IOException
SocketBinderPortRange.bind in interface SocketBinderhost - the local host the server will bind toportRange - PortRange.randomStartPort - if true, a random port in the range will be used as the initial port.backlog - the maximum length of the queueConnectionIOException - if unable to bind i.e. if port already boundpublic final void unbindAll()
AbstractBindingHandler.unbindAll in interface SocketBinderUnsupportedOperationException - by defaultprotected <T> T getSystemInheritedChannel(Class<?> channelType) throws IOException
IOExceptionCopyright © 2017–2020 Oracle Corporation. All rights reserved.