java.lang.Object
org.glassfish.grizzly.AbstractBindingHandler
- All Implemented Interfaces:
SocketBinder
- Direct Known Subclasses:
TCPNIOBindingHandler
,UDPNIOBindingHandler
- Since:
- 2.2.19
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Builder -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Processor
protected ProcessorSelector
protected static final Random
protected final NIOTransport
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConnection<?>
bind
(int port) Binds Transport to the specific port on localhost.Connection<?>
Binds Transport to the specific host and port.Connection<?>
Binds Transport to the specific host and port.Connection<?>
Binds Transport to the specific host, and port within aPortRange
.Connection<?>
Binds Transport to the specific host, and port within aPortRange
.Gets the defaultProcessorSelector
, which will be used to getProcessor
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 defaultProcessorSelector
, which will be used to getProcessor
to process I/O events, occurring on connection phase.final void
This operation is not supported by implementations ofAbstractBindingHandler
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.glassfish.grizzly.SocketBinder
bind, bind, bindToInherited, unbind
-
Field Details
-
RANDOM
-
transport
-
processor
-
processorSelector
-
-
Constructor Details
-
AbstractBindingHandler
-
-
Method Details
-
getProcessor
-
setProcessor
-
getProcessorSelector
Gets the defaultProcessorSelector
, which will be used to getProcessor
to process I/O events, occurring on connection phase.- Returns:
- the default
ProcessorSelector
, which will be used to getProcessor
to process I/O events, occurring on connection phase.
-
setProcessorSelector
Sets the defaultProcessorSelector
, which will be used to getProcessor
to process I/O events, occurring on connection phase.- Parameters:
processorSelector
- the defaultProcessorSelector
, which will be used to getProcessor
to process I/O events, occurring on connection phase.
-
bind
Binds Transport to the specific port on localhost.- Specified by:
bind
in interfaceSocketBinder
- Parameters:
port
- the port to bind to- Returns:
- bound
Connection
- Throws:
IOException
- if unable to bind i.e. if port already bound
-
bind
Binds Transport to the specific host and port.- Specified by:
bind
in interfaceSocketBinder
- Parameters:
host
- the local host the server will bind toport
- specific port to bind to- Returns:
- bound
Connection
- Throws:
IOException
- if unable to bind i.e. if port already bound
-
bind
Binds Transport to the specific host and port.- Specified by:
bind
in interfaceSocketBinder
- Parameters:
host
- the local host the server will bind toport
- the port to bind tobacklog
- the maximum length of the queue- Returns:
- bound
Connection
- Throws:
IOException
- if unable to bind i.e. if port already bound
-
bind
Binds Transport to the specific host, and port within aPortRange
.- Specified by:
bind
in interfaceSocketBinder
- Parameters:
host
- the local host the server will bind toportRange
-PortRange
.backlog
- the maximum length of the queue- Returns:
- bound
Connection
- Throws:
IOException
- if unable to bind i.e. if port already bound
-
bind
public Connection<?> bind(String host, PortRange portRange, boolean randomStartPort, int backlog) throws IOException Description copied from interface:SocketBinder
Binds Transport to the specific host, and port within aPortRange
.- Specified by:
bind
in interfaceSocketBinder
- Parameters:
host
- 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 queue- Returns:
- bound
Connection
- Throws:
IOException
- if unable to bind i.e. if port already bound
-
unbindAll
public final void unbindAll()This operation is not supported by implementations ofAbstractBindingHandler
.- Specified by:
unbindAll
in interfaceSocketBinder
- Throws:
UnsupportedOperationException
- by default
-
getSystemInheritedChannel
- Throws:
IOException
-