Top Description Inners Fields Constructors Methods
org.glassfish.grizzly.nio.transport

public Class TCPNIOBindingHandler

extends AbstractBindingHandler
Class Inheritance
Imports
java.io.IOException, java.net.ServerSocket, .SocketAddress, java.nio.channels.ServerSocketChannel, java.util.concurrent.locks.Lock, org.glassfish.grizzly.AbstractBindingHandler, .Connection, org.glassfish.grizzly.utils.Exceptions

This class may be used to apply a custom org.glassfish.grizzly.Processor and/or org.glassfish.grizzly.ProcessorSelector atomically within a bind operation - not something that can normally be done using the TCPNIOTransport alone. Example usage:
TCPNIOBindingHandler handler = TCPNIOBindingHandler.builder(transport).setProcessor(custom).build();
handler.bind(socketAddress);
Since
2.2.19

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private final TCPNIOTransport
Inherited from org.glassfish.grizzly.AbstractBindingHandler:
processorprocessorSelectorRANDOMtransport

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public TCPNIOServerConnection
bind(SocketAddress socketAddress)

Implements org.glassfish.grizzly.SocketBinder.bind.

Binds Transport to the specific SocketAddress.

public TCPNIOServerConnection
bind(SocketAddress socketAddress, int backlog)

Implements org.glassfish.grizzly.SocketBinder.bind.

Binds Transport to the specific SocketAddress.

private TCPNIOServerConnection
bindToChannelAndAddress(final ServerSocketChannel serverSocketChannel, final SocketAddress socketAddress, final int backlog)

public TCPNIOServerConnection
bindToInherited()

Implements org.glassfish.grizzly.SocketBinder.bindToInherited.

Binds the Transport to the channel inherited from the entity that created this Java virtual machine.

public static TCPNIOBindingHandler.Builder
builder(final TCPNIOTransport transport)

public void
unbind(Connection<L> connection)

Implements org.glassfish.grizzly.SocketBinder.unbind.

Unbinds bound Transport connection.

Inherited from org.glassfish.grizzly.AbstractBindingHandler:
bindbindbindbindbindgetProcessorgetProcessorSelectorgetSystemInheritedChannelsetProcessorsetProcessorSelectorunbindAll

Field Detail

tcpTransportback to summary
private final TCPNIOTransport tcpTransport

Constructor Detail

TCPNIOBindingHandlerback to summary
pack-priv TCPNIOBindingHandler(final TCPNIOTransport tcpTransport)

Method Detail

bindback to summary
public TCPNIOServerConnection bind(SocketAddress socketAddress) throws IOException

Implements org.glassfish.grizzly.SocketBinder.bind.

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

Binds Transport to the specific SocketAddress.

Annotations
@Override
Exceptions
IOException:
if unable to bind i.e. if port already bound
bindback to summary
public TCPNIOServerConnection bind(SocketAddress socketAddress, int backlog) throws IOException

Implements org.glassfish.grizzly.SocketBinder.bind.

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

Binds Transport to the specific SocketAddress.

Annotations
@Override
Exceptions
IOException:
if unable to bind i.e. if port already bound
bindToChannelAndAddressback to summary
private TCPNIOServerConnection bindToChannelAndAddress(final ServerSocketChannel serverSocketChannel, final SocketAddress socketAddress, final int backlog) throws IOException
bindToInheritedback to summary
public TCPNIOServerConnection bindToInherited() throws IOException

Implements org.glassfish.grizzly.SocketBinder.bindToInherited.

Doc from org.glassfish.grizzly.SocketBinder.bindToInherited.

Binds the Transport to the channel inherited from the entity that created this Java virtual machine.

Annotations
@Override
Exceptions
IOException:
if unable to bind i.e. if port already bound
builderback to summary
public static TCPNIOBindingHandler.Builder builder(final TCPNIOTransport transport)
unbindback to summary
public void unbind(Connection<L> connection)

Implements org.glassfish.grizzly.SocketBinder.unbind.

Doc from org.glassfish.grizzly.SocketBinder.unbind.

Unbinds bound Transport connection.

Annotations
@Override
org.glassfish.grizzly.nio.transport back to summary

public Class TCPNIOBindingHandler.Builder

extends AbstractBindingHandler.Builder<TCPNIOBindingHandler.Builder>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private TCPNIOTransport
Inherited from org.glassfish.grizzly.AbstractBindingHandler.Builder:
processorprocessorSelector

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public TCPNIOBindingHandler
protected AbstractBindingHandler
public TCPNIOBindingHandler.Builder
Inherited from org.glassfish.grizzly.AbstractBindingHandler.Builder:
processorprocessorSelector

Field Detail

transportback to summary
private TCPNIOTransport transport

Constructor Detail

Builderback to summary
public Builder()

Method Detail

buildback to summary
public TCPNIOBindingHandler build()

Overrides org.glassfish.grizzly.AbstractBindingHandler.Builder.build.

Annotations
@Override
createback to summary
protected AbstractBindingHandler create()

Implements abstract org.glassfish.grizzly.AbstractBindingHandler.Builder.create.

Annotations
@Override
transportback to summary
public TCPNIOBindingHandler.Builder transport(TCPNIOTransport transport)