Class UDPNIOServerConnection
- java.lang.Object
-
- org.glassfish.grizzly.nio.NIOConnection
-
- org.glassfish.grizzly.nio.transport.UDPNIOConnection
-
- org.glassfish.grizzly.nio.transport.UDPNIOServerConnection
-
- All Implemented Interfaces:
AttributeStorage,Closeable,Connection<SocketAddress>,MonitoringAware<ConnectionProbe>,OutputSink,Readable<SocketAddress>,Writeable<SocketAddress>
public class UDPNIOServerConnection extends UDPNIOConnection
ServerConnectionimplementation for theUDPNIOTransport- 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
attributes, channel, connectCloseSemaphoreUpdater, isBlocking, isStandalone, maxAsyncWriteQueueSize, monitoringConfig, NOTIFICATION_CLOSED_COMPLETE, NOTIFICATION_INITIALIZED, processor, processorSelector, readTimeoutMillis, selectionKey, selectorRunner, transport, writeTimeoutMillis, zeroByteReadCount
-
-
Constructor Summary
Constructors Constructor Description UDPNIOServerConnection(UDPNIOTransport transport, DatagramChannel channel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcloseGracefully0(CompletionHandler<Closeable> completionHandler, CloseReason closeReason)ProcessorgetProcessor()Gets the defaultProcessor, which will processConnectionI/O events.ProcessorSelectorgetProcessorSelector()Gets the defaultProcessorSelector, which will be used to getProcessorto processConnectionI/O events, in case if thisConnection'sProcessoris null.protected voidpreClose()voidregister()protected voidterminate0(CompletionHandler<Closeable> completionHandler, CloseReason closeReason)voidunbind(CompletionHandler<Closeable> completionHandler)-
Methods inherited from class org.glassfish.grizzly.nio.transport.UDPNIOConnection
block, canWrite, canWrite, drop, drop, dropAll, enableInitialOpRead, getLocalAddress, getPeerAddress, getReadBufferSize, getWriteBufferSize, isConnected, join, join, notifyCanWrite, notifyCanWrite, notifyReady, onConnect, onRead, onWrite, resetProperties, setReadBufferSize, setSelectionKey, setSelectorRunner, setWriteBufferSize, toString, unblock
-
Methods inherited from class org.glassfish.grizzly.nio.NIOConnection
addCloseListener, addCloseListener, assertOpen, attachToSelectorRunner, checkEmptyRead, close, close, closeFuture, closeSilently, closeWithReason, configureBlocking, configureStandalone, detachSelectorRunner, disableIOEvent, doClose, enableIOEvent, executeInEventThread, getAsyncReadQueue, getAsyncWriteQueue, getAttributes, getChannel, getCloseReason, getId, getMaxAsyncWriteQueueSize, getMemoryManager, getMonitoringConfig, getReadTimeout, getSelectionKey, getSelectorRunner, getTransport, getWriteTimeout, isBlocking, isClosed, isOpen, isStandalone, notifyConnectionError, notifyIOEventDisabled, notifyIOEventEnabled, notifyIOEventReady, notifyProbesAccept, notifyProbesBind, notifyProbesClose, notifyProbesConnect, notifyProbesError, notifyProbesRead, notifyProbesWrite, obtainProcessor, obtainProcessorState, read, read, removeCloseListener, removeCloseListener, setChannel, setMaxAsyncWriteQueueSize, setProcessor, setProcessorSelector, setReadTimeout, setWriteTimeout, simulateIOEvent, terminate, terminateSilently, terminateWithReason, write, write, write, write, write
-
-
-
-
Constructor Detail
-
UDPNIOServerConnection
public UDPNIOServerConnection(UDPNIOTransport transport, DatagramChannel channel)
-
-
Method Detail
-
getProcessor
public Processor getProcessor()
Description copied from interface:ConnectionGets the defaultProcessor, which will processConnectionI/O events. IfProcessoris null, - thenTransportwill try to getProcessorusingConnection'sProcessorSelector.select(IOEvent, Connection). IfProcessorSelector, associated withtheConnectionis also null -Transportwill try to getProcessorusing own settings.- Specified by:
getProcessorin interfaceConnection<SocketAddress>- Overrides:
getProcessorin classNIOConnection- Returns:
- the default
Processor, which will processConnectionI/O events.
-
getProcessorSelector
public ProcessorSelector getProcessorSelector()
Description copied from interface:ConnectionGets the defaultProcessorSelector, which will be used to getProcessorto processConnectionI/O events, in case if thisConnection'sProcessoris null.- Specified by:
getProcessorSelectorin interfaceConnection<SocketAddress>- Overrides:
getProcessorSelectorin classNIOConnection- Returns:
- the default
ProcessorSelector, which will be used to getProcessorto processConnectionI/O events, in case if thisConnection'sProcessoris null.
-
register
public void register() throws IOException- Throws:
IOException
-
closeGracefully0
protected void closeGracefully0(CompletionHandler<Closeable> completionHandler, CloseReason closeReason)
- Overrides:
closeGracefully0in classNIOConnection
-
terminate0
protected void terminate0(CompletionHandler<Closeable> completionHandler, CloseReason closeReason)
- Overrides:
terminate0in classNIOConnection
-
unbind
public void unbind(CompletionHandler<Closeable> completionHandler)
-
preClose
protected void preClose()
- Overrides:
preClosein classNIOConnection
-
-