org.glassfish.grizzly.nio.transport
Class UDPNIOServerConnection

java.lang.Object
  extended by org.glassfish.grizzly.nio.NIOConnection
      extended by org.glassfish.grizzly.nio.transport.UDPNIOConnection
          extended by org.glassfish.grizzly.nio.transport.UDPNIOServerConnection
All Implemented Interfaces:
AttributeStorage, Closeable<Connection>, Connection<java.net.SocketAddress>, MonitoringAware<ConnectionProbe>, Readable<java.net.SocketAddress>, Writable<java.net.SocketAddress>

public class UDPNIOServerConnection
extends UDPNIOConnection

Server Connection implementation for the UDPNIOTransport

Author:
Alexey Stashok

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.glassfish.grizzly.Connection
Connection.CloseListener, Connection.CloseType
 
Field Summary
 
Fields inherited from class org.glassfish.grizzly.nio.NIOConnection
asyncReadQueue, asyncWriteQueue, attributes, channel, closeFlag, isBlocking, isStandalone, maxAsyncWriteQueueSize, monitoringConfig, processor, processorSelector, readBufferSize, readTimeoutMillis, selectionKey, selectorRunner, transport, writeBufferSize, writeTimeoutMillis, zeroByteReadCount
 
Constructor Summary
UDPNIOServerConnection(UDPNIOTransport transport, java.nio.channels.DatagramChannel channel)
           
 
Method Summary
 void close(CompletionHandler<Connection> completionHandler)
          Close the Connection
 Processor getProcessor()
          Gets the default Processor, which will process Connection I/O events.
 ProcessorSelector getProcessorSelector()
          Gets the default ProcessorSelector, which will be used to get Processor to process Connection I/O events, in case if this Connection's Processor is null.
protected  void preClose()
           
 void unbind(CompletionHandler<Connection> completionHandler)
           
 
Methods inherited from class org.glassfish.grizzly.nio.transport.UDPNIOConnection
getLocalAddress, getPeerAddress, isConnected, onConnect, onRead, onWrite, register, resetProperties, setReadBufferSize, setSelectionKey, setSelectorRunner, setWriteBufferSize, toString
 
Methods inherited from class org.glassfish.grizzly.nio.NIOConnection
addCloseListener, attachToSelectorRunner, checkEmptyRead, close, close0, closeSilently, configureBlocking, configureStandalone, detachSelectorRunner, disableIOEvent, enableIOEvent, getAsyncReadQueue, getAsyncWriteQueue, getAttributes, getChannel, getMaxAsyncWriteQueueSize, getMonitoringConfig, getReadBufferSize, getReadTimeout, getSelectionKey, getSelectorRunner, getTransport, getWriteBufferSize, getWriteTimeout, isBlocking, isOpen, isStandalone, notifyConnectionError, notifyIOEventDisabled, notifyIOEventEnabled, notifyIOEventReady, notifyProbesAccept, notifyProbesBind, notifyProbesClose, notifyProbesConnect, notifyProbesError, notifyProbesRead, notifyProbesWrite, obtainProcessor, obtainProcessorState, read, read, removeCloseListener, setChannel, setMaxAsyncWriteQueueSize, setProcessor, setProcessorSelector, setReadTimeout, setWriteTimeout, simulateIOEvent, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UDPNIOServerConnection

public UDPNIOServerConnection(UDPNIOTransport transport,
                              java.nio.channels.DatagramChannel channel)
Method Detail

getProcessor

public Processor getProcessor()
Description copied from interface: Connection
Gets the default Processor, which will process Connection I/O events. If Processor is null, - then Transport will try to get Processor using Connection's ProcessorSelector.select(IOEvent, Connection). If ProcessorSelector, associated withthe Connection is also null - Transport will try to get Processor using own settings.

Specified by:
getProcessor in interface Connection<java.net.SocketAddress>
Overrides:
getProcessor in class NIOConnection
Returns:
the default Processor, which will process Connection I/O events.

getProcessorSelector

public ProcessorSelector getProcessorSelector()
Description copied from interface: Connection
Gets the default ProcessorSelector, which will be used to get Processor to process Connection I/O events, in case if this Connection's Processor is null.

Specified by:
getProcessorSelector in interface Connection<java.net.SocketAddress>
Overrides:
getProcessorSelector in class NIOConnection
Returns:
the default ProcessorSelector, which will be used to get Processor to process Connection I/O events, in case if this Connection's Processor is null.

close

public void close(CompletionHandler<Connection> completionHandler)
Description copied from interface: Connection
Close the Connection

Specified by:
close in interface Closeable<Connection>
Specified by:
close in interface Connection<java.net.SocketAddress>
Overrides:
close in class NIOConnection
Parameters:
completionHandler - CompletionHandler to be called, when the connection is closed.

unbind

public void unbind(CompletionHandler<Connection> completionHandler)

preClose

protected void preClose()
Overrides:
preClose in class UDPNIOConnection


Copyright © 2012 Oracle Corporation. All Rights Reserved.