Top Inners Fields Constructors Methods
org.glassfish.grizzly

public abstract Class AbstractBindingHandler

extends Object
implements SocketBinder
Class Inheritance
All Implemented Interfaces
org.glassfish.grizzly.SocketBinder
Known Direct Subclasses
org.glassfish.grizzly.nio.transport.TCPNIOBindingHandler, org.glassfish.grizzly.nio.transport.UDPNIOBindingHandler
Imports
java.io.IOException, java.net.BindException, .InetSocketAddress, java.nio.channels.Channel, java.util.Random, org.glassfish.grizzly.nio.NIOTransport

Since
2.2.19

Nested and Inner Type Summary

Modifier and TypeClass and Description
public abstract static class

Field Summary

Modifier and TypeField and Description
protected Processor<E extends Context>
protected ProcessorSelector
protected static final Random
protected final NIOTransport

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Connection<?>
bind(final int port)

Implements org.glassfish.grizzly.SocketBinder.bind.

Binds Transport to the specific port on localhost.

public Connection<?>
bind(final String host, final int port)

Implements org.glassfish.grizzly.SocketBinder.bind.

Binds Transport to the specific host and port.

public Connection<?>
bind(final String host, final int port, final int backlog)

Implements org.glassfish.grizzly.SocketBinder.bind.

Binds Transport to the specific host and port.

public Connection<?>
bind(final String host, final PortRange portRange, final int backlog)

Implements org.glassfish.grizzly.SocketBinder.bind.

Binds Transport to the specific host, and port within a PortRange.

public Connection<?>
bind(final String host, final PortRange portRange, boolean randomStartPort, final int backlog)

Implements org.glassfish.grizzly.SocketBinder.bind.

Binds Transport to the specific host, and port within a PortRange.

public Processor<E extends Context>

Returns:

the default Processor to process IOEvent, occurring on connection phase.
getProcessor
()

Get the default Processor to process IOEvent, occurring on connection phase.

public ProcessorSelector

Returns:

the default ProcessorSelector, which will be used to get Processor to process I/O events, occurring on connection phase.
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(final Class<?> channelType)

public void
setProcessor(Processor<E extends Context>
the default Processor to process IOEvent, occurring on connection phase.
processor
)

Set the default Processor to process IOEvent, occurring on connection phase.

public void
setProcessorSelector(final ProcessorSelector
the default ProcessorSelector, which will be used to get Processor to process I/O events, occurring on connection phase.
processorSelector
)

Sets the default ProcessorSelector, which will be used to get Processor to process I/O events, occurring on connection phase.

public final void
unbindAll()

Implements org.glassfish.grizzly.SocketBinder.unbindAll.

This operation is not supported by implementations of AbstractBindingHandler.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

processorback to summary
protected Processor<E extends Context> processor
processorSelectorback to summary
protected ProcessorSelector processorSelector
RANDOMback to summary
protected static final Random RANDOM
transportback to summary
protected final NIOTransport transport

Constructor Detail

AbstractBindingHandlerback to summary
public AbstractBindingHandler(final NIOTransport transport)

Method Detail

bindback to summary
public Connection<?> bind(final int port) throws IOException

Implements org.glassfish.grizzly.SocketBinder.bind.

Doc from org.glassfish.grizzly.SocketBinder.bind.

Binds Transport to the specific port on localhost.

Annotations
@Override
Exceptions
IOException:
if unable to bind i.e. if port already bound
bindback to summary
public Connection<?> bind(final String host, final int port) throws IOException

Implements org.glassfish.grizzly.SocketBinder.bind.

Doc from org.glassfish.grizzly.SocketBinder.bind.

Binds Transport to the specific host and port.

Annotations
@Override
Exceptions
IOException:
if unable to bind i.e. if port already bound
bindback to summary
public Connection<?> bind(final String host, final int port, final int backlog) throws IOException

Implements org.glassfish.grizzly.SocketBinder.bind.

Doc from org.glassfish.grizzly.SocketBinder.bind.

Binds Transport to the specific host and port.

Annotations
@Override
Exceptions
IOException:
if unable to bind i.e. if port already bound
bindback to summary
public Connection<?> bind(final String host, final PortRange portRange, final int backlog) throws IOException

Implements org.glassfish.grizzly.SocketBinder.bind.

Doc from org.glassfish.grizzly.SocketBinder.bind.

Binds Transport to the specific host, and port within a PortRange.

Annotations
@Override
Exceptions
IOException:
if unable to bind i.e. if port already bound
bindback to summary
public Connection<?> bind(final String host, final PortRange portRange, boolean randomStartPort, final int backlog) throws IOException

Implements org.glassfish.grizzly.SocketBinder.bind.

Doc from org.glassfish.grizzly.SocketBinder.bind.

Binds Transport to the specific host, and port within a PortRange.

Annotations
@Override
Exceptions
IOException:
if unable to bind i.e. if port already bound
getProcessorback to summary
public Processor<E extends Context> getProcessor()

Get the default Processor to process IOEvent, occurring on connection phase.

Returns:Processor<E extends Context>

the default Processor to process IOEvent, occurring on connection phase.

getProcessorSelectorback to summary
public ProcessorSelector getProcessorSelector()

Gets the default ProcessorSelector, which will be used to get Processor to process I/O events, occurring on connection phase.

Returns:ProcessorSelector

the default ProcessorSelector, which will be used to get Processor to process I/O events, occurring on connection phase.

getSystemInheritedChannelback to summary
protected <T> T getSystemInheritedChannel(final Class<?> channelType) throws IOException
Annotations
@SuppressWarnings:unchecked
setProcessorback to summary
public void setProcessor(Processor<E extends Context> processor)

Set the default Processor to process IOEvent, occurring on connection phase.

Parameters
processor:Processor<E extends Context>

the default Processor to process IOEvent, occurring on connection phase.

setProcessorSelectorback to summary
public void setProcessorSelector(final ProcessorSelector processorSelector)

Sets the default ProcessorSelector, which will be used to get Processor to process I/O events, occurring on connection phase.

Parameters
processorSelector:ProcessorSelector

the default ProcessorSelector, which will be used to get Processor to process I/O events, occurring on connection phase.

unbindAllback to summary
public final void unbindAll()

Implements org.glassfish.grizzly.SocketBinder.unbindAll.

This operation is not supported by implementations of AbstractBindingHandler.

Annotations
@Override
Exceptions
UnsupportedOperationException:
by default
org.glassfish.grizzly back to summary

public abstract Class AbstractBindingHandler.Builder<E extends AbstractBindingHandler.Builder>

extends Object
Class Inheritance
Known Direct Subclasses
org.glassfish.grizzly.nio.transport.TCPNIOBindingHandler.Builder, org.glassfish.grizzly.nio.transport.UDPNIOBindingHandler.Builder
Annotations
@SuppressWarnings:unchecked

Builder

Field Summary

Modifier and TypeField and Description
protected Processor<E extends Context>
protected ProcessorSelector

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public AbstractBindingHandler
protected abstract AbstractBindingHandler
public E
processor(final Processor<E extends Context> processor)

public E
processorSelector(final ProcessorSelector processorSelector)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

processorback to summary
protected Processor<E extends Context> processor
processorSelectorback to summary
protected ProcessorSelector processorSelector

Constructor Detail

Builderback to summary
public Builder()

Method Detail

buildback to summary
public AbstractBindingHandler build()
createback to summary
protected abstract AbstractBindingHandler create()
processorback to summary
public E processor(final Processor<E extends Context> processor)
processorSelectorback to summary
public E processorSelector(final ProcessorSelector processorSelector)