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

public Class UDPNIOBindingHandler

extends AbstractBindingHandler
Class Inheritance
Imports
java.io.IOException, java.net.DatagramSocket, .SocketAddress, java.nio.channels.DatagramChannel, 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 UDPNIOTransport alone. Example usage:
UDPNIOBindingHandler handler = UDPNIOBindingHandler.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 UDPNIOTransport
Inherited from org.glassfish.grizzly.AbstractBindingHandler:
processorprocessorSelectorRANDOMtransport

Constructor Summary

AccessConstructor and Description
public

Method Summary

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

Implements org.glassfish.grizzly.SocketBinder.bind.

Binds Transport to the specific SocketAddress.

public UDPNIOServerConnection
bind(SocketAddress socketAddress, int backlog)

Implements org.glassfish.grizzly.SocketBinder.bind.

Binds Transport to the specific SocketAddress.

private UDPNIOServerConnection
bindToChannel(final DatagramChannel serverDatagramChannel, final SocketAddress socketAddress)

public UDPNIOServerConnection
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 UDPNIOBindingHandler.Builder
builder(final UDPNIOTransport 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

udpTransportback to summary
private final UDPNIOTransport udpTransport

Constructor Detail

UDPNIOBindingHandlerback to summary
public UDPNIOBindingHandler(UDPNIOTransport udpTransport)

Method Detail

bindback to summary
public UDPNIOServerConnection 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 UDPNIOServerConnection 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
bindToChannelback to summary
private UDPNIOServerConnection bindToChannel(final DatagramChannel serverDatagramChannel, final SocketAddress socketAddress) throws IOException
bindToInheritedback to summary
public UDPNIOServerConnection 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 UDPNIOBindingHandler.Builder builder(final UDPNIOTransport 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 UDPNIOBindingHandler.Builder

extends AbstractBindingHandler.Builder<UDPNIOBindingHandler.Builder>
Class Inheritance

Field Summary

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

Constructor Summary

AccessConstructor and Description
public

Method Summary

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

Field Detail

transportback to summary
private UDPNIOTransport transport

Constructor Detail

Builderback to summary
public Builder()

Method Detail

buildback to summary
public UDPNIOBindingHandler 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 UDPNIOBindingHandler.Builder transport(UDPNIOTransport transport)