java.lang.Object
org.glassfish.grizzly.nio.NIOConnection
- All Implemented Interfaces:
AttributeStorage,Closeable,Connection<SocketAddress>,MonitoringAware<ConnectionProbe>,OutputSink,Readable<SocketAddress>,Writeable<SocketAddress>
- Direct Known Subclasses:
TCPNIOConnection,UDPNIOConnection
Common
Connection implementation for Java NIO Connections.- Author:
- Alexey Stashok
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.glassfish.grizzly.Connection
Connection.CloseListener, Connection.CloseType -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AttributeHolderprotected SelectableChannelprotected static final AtomicReferenceFieldUpdater<NIOConnection,Object> Semaphore responsible for connect/close notificationprotected booleanprotected booleanprotected intprotected final DefaultMonitoringConfig<ConnectionProbe>Connection probesprotected static final Objectprotected static final Objectprotected Processorprotected ProcessorSelectorprotected longprotected SelectionKeyprotected SelectorRunnerprotected final NIOTransportprotected longprotected short -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCloseListener(CloseListener closeListener) Add theConnection.CloseListener, which will be notified once Connection will be closed.voidaddCloseListener(Connection.CloseListener closeListener) Add theConnection.CloseListener, which will be notified once Connection will be closed.voidChecks if this Connection is open and ready to be used.voidattachToSelectorRunner(SelectorRunner selectorRunner) protected final voidcheckEmptyRead(int size) close()Gracefully close theConnectionvoidclose(CompletionHandler<Closeable> completionHandler) Deprecated.protected voidcloseGracefully0(CompletionHandler<Closeable> completionHandler, CloseReason closeReason) final voidGracefully close theConnectionsilently, no notification required on completion or failure.voidcloseWithReason(IOException reason) Gracefully closes the Connection and provides the reason description.voidconfigureBlocking(boolean isBlocking) Sets theConnectionmode.voidconfigureStandalone(boolean isStandalone) voidfinal voiddisableIOEvent(IOEvent ioEvent) protected voiddoClose()Do the actual connection close.protected voidEnables OP_READ if it has never been enabled before.final voidenableIOEvent(IOEvent ioEvent) voidexecuteInEventThread(IOEvent event, Runnable runnable) Executes theRunnablein the thread, responsible for running the given type of event on this Connection.Get associatedAttributeHolder.ReturnsCloseReasonif this Connection has been closed, or null otherwise.longgetId()Returns id of this instance, unique in the context of the JVM and the implementation class.intGet the max size (in bytes) of asynchronous write queue associated with connection.final MonitoringConfig<ConnectionProbe>Return the object associatedMonitoringConfig.Gets the defaultProcessor, which will processConnectionI/O events.Gets the defaultProcessorSelector, which will be used to getProcessorto processConnectionI/O events, in case if thisConnection'sProcessoris null.longgetReadTimeout(TimeUnit timeUnit) Returns the current value for the blocking read timeout converted to the providedTimeUnitspecification.Get theTransport, to which thisConnectionbelongs to.longgetWriteTimeout(TimeUnit timeUnit) Returns the current value for the blocking write timeout converted to the providedTimeUnitspecification.booleanbooleanisClosed()booleanisOpen()IsConnectionopen and ready.booleanvoidnotifyConnectionError(Throwable error) Method gets invoked, when error occur during the Connection lifecycle.protected static voidnotifyIOEventDisabled(NIOConnection connection, IOEvent ioEvent) Notify registeredConnectionProbes about the IO Event disabled event.protected static voidnotifyIOEventEnabled(NIOConnection connection, IOEvent ioEvent) Notify registeredConnectionProbes about the IO Event enabled event.protected static voidnotifyIOEventReady(NIOConnection connection, IOEvent ioEvent) Notify registeredConnectionProbes about the IO Event ready event.protected static voidnotifyProbesAccept(NIOConnection serverConnection, NIOConnection clientConnection) Notify registeredConnectionProbes about the accept event.protected static voidnotifyProbesBind(NIOConnection connection) Notify registeredConnectionProbes about the bind event.protected static voidnotifyProbesClose(NIOConnection connection) Notify registeredConnectionProbes about the close event.protected static voidnotifyProbesConnect(NIOConnection connection) Notify registeredConnectionProbes about the connect event.protected static voidnotifyProbesError(NIOConnection connection, Throwable error) Notify registeredConnectionProbes about the error.protected static voidnotifyProbesRead(NIOConnection connection, Buffer data, int size) Notify registeredConnectionProbes about the read event.protected static voidnotifyProbesWrite(NIOConnection connection, Buffer data, long size) Notify registeredConnectionProbes about the write event.obtainProcessor(IOEvent ioEvent) Gets theProcessor, which will processConnectionI/O event.<E> EobtainProcessorState(Processor processor, Supplier<E> factory) Returns theProcessorstate associated with this Connection.protected voidpreClose()<M> GrizzlyFuture<ReadResult<M,SocketAddress>> read()Method reads data.<M> voidread(CompletionHandler<ReadResult<M, SocketAddress>> completionHandler) booleanremoveCloseListener(CloseListener closeListener) Remove theConnection.CloseListener.booleanremoveCloseListener(Connection.CloseListener closeListener) Remove theConnection.CloseListener.protected voidsetChannel(SelectableChannel channel) voidsetMaxAsyncWriteQueueSize(int maxAsyncWriteQueueSize) Set the max size (in bytes) of asynchronous write queue associated with connection.voidsetProcessor(Processor preferableProcessor) Sets the defaultProcessor, which will processConnectionI/O events.voidsetProcessorSelector(ProcessorSelector preferableProcessorSelector) Sets the defaultProcessorSelector, which will be used to getProcessorto processConnectionI/O events, in case if thisConnection'sProcessoris null.voidsetReadTimeout(long timeout, TimeUnit timeUnit) Specifies the timeout for the blocking reads.protected voidsetSelectionKey(SelectionKey selectionKey) protected voidsetSelectorRunner(SelectorRunner selectorRunner) voidsetWriteTimeout(long timeout, TimeUnit timeUnit) Specifies the timeout for the blocking writes.voidsimulateIOEvent(IOEvent ioEvent) Close theConnectionprotected voidterminate0(CompletionHandler<Closeable> completionHandler, CloseReason reason) voidClose theConnectionsilently, no notification required on completion or failure.voidterminateWithReason(IOException reason) Closes the Connection and provides the reason description.<M> voidwrite(SocketAddress dstAddress, M message, CompletionHandler<WriteResult<M, SocketAddress>> completionHandler) Method writes the buffer to the specific address.<M> voidwrite(SocketAddress dstAddress, M message, CompletionHandler<WriteResult<M, SocketAddress>> completionHandler, PushBackHandler pushbackHandler) Deprecated.<M> GrizzlyFuture<WriteResult<M,SocketAddress>> write(M message) Method writes the buffer.<M> voidwrite(M message, CompletionHandler<WriteResult<M, SocketAddress>> completionHandler) Method writes the buffer.<M> voidwrite(M message, CompletionHandler<WriteResult<M, SocketAddress>> completionHandler, PushBackHandler pushbackHandler) Deprecated.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.glassfish.grizzly.Connection
getLocalAddress, getPeerAddress, getReadBufferSize, getWriteBufferSize, setReadBufferSize, setWriteBufferSizeMethods inherited from interface org.glassfish.grizzly.OutputSink
canWrite, canWrite, notifyCanWrite, notifyCanWrite
-
Field Details
-
NOTIFICATION_INITIALIZED
-
NOTIFICATION_CLOSED_COMPLETE
-
transport
-
maxAsyncWriteQueueSize
protected volatile int maxAsyncWriteQueueSize -
readTimeoutMillis
protected volatile long readTimeoutMillis -
writeTimeoutMillis
protected volatile long writeTimeoutMillis -
channel
-
selectionKey
-
selectorRunner
-
processor
-
processorSelector
-
attributes
-
connectCloseSemaphoreUpdater
protected static final AtomicReferenceFieldUpdater<NIOConnection,Object> connectCloseSemaphoreUpdaterSemaphore responsible for connect/close notification -
isBlocking
protected volatile boolean isBlocking -
isStandalone
protected volatile boolean isStandalone -
zeroByteReadCount
protected short zeroByteReadCount -
monitoringConfig
Connection probes
-
-
Constructor Details
-
NIOConnection
-
-
Method Details
-
getId
public long getId()Description copied from interface:ConnectionReturns id of this instance, unique in the context of the JVM and the implementation class.- Specified by:
getIdin interfaceConnection<SocketAddress>- Returns:
- id of this instance, never null.
-
configureBlocking
public void configureBlocking(boolean isBlocking) Description copied from interface:ConnectionSets theConnectionmode.- Specified by:
configureBlockingin interfaceConnection<SocketAddress>- Parameters:
isBlocking- theConnectionmode. true, ifConnectionshould operate in blocking mode, or false otherwise.
-
isBlocking
public boolean isBlocking()- Specified by:
isBlockingin interfaceConnection<SocketAddress>- Returns:
- the
Connectionmode. true, ifConnectionis operating in blocking mode, or false otherwise.
-
getMemoryManager
- Specified by:
getMemoryManagerin interfaceConnection<SocketAddress>- Returns:
- an associated
MemoryManager. It's a shortcut forConnection.getTransport().getMemoryManager()
-
configureStandalone
public void configureStandalone(boolean isStandalone) - Specified by:
configureStandalonein interfaceConnection<SocketAddress>
-
isStandalone
public boolean isStandalone()- Specified by:
isStandalonein interfaceConnection<SocketAddress>
-
getTransport
Description copied from interface:ConnectionGet theTransport, to which thisConnectionbelongs to.- Specified by:
getTransportin interfaceConnection<SocketAddress>- Returns:
- the
Transport, to which thisConnectionbelongs to.
-
getMaxAsyncWriteQueueSize
public int getMaxAsyncWriteQueueSize()Get the max size (in bytes) of asynchronous write queue associated with connection.- Specified by:
getMaxAsyncWriteQueueSizein interfaceConnection<SocketAddress>- Returns:
- the max size (in bytes) of asynchronous write queue associated with connection.
-
setMaxAsyncWriteQueueSize
public void setMaxAsyncWriteQueueSize(int maxAsyncWriteQueueSize) Set the max size (in bytes) of asynchronous write queue associated with connection.- Specified by:
setMaxAsyncWriteQueueSizein interfaceConnection<SocketAddress>- Parameters:
maxAsyncWriteQueueSize- the max size (in bytes) of asynchronous write queue associated with connection.
-
getReadTimeout
Description copied from interface:ConnectionReturns the current value for the blocking read timeout converted to the providedTimeUnitspecification. If this value hasn't been explicitly set, it will default to 30 seconds.- Specified by:
getReadTimeoutin interfaceConnection<SocketAddress>- Parameters:
timeUnit- theTimeUnitto convert the returned result to.- Returns:
- the read timeout value
-
setReadTimeout
Description copied from interface:ConnectionSpecifies the timeout for the blocking reads. This may be overridden on a per-connection basis. A value of zero or less effectively disables the timeout.- Specified by:
setReadTimeoutin interfaceConnection<SocketAddress>- Parameters:
timeout- the new timeout valuetimeUnit- theTimeUnitspecification of the provided value.- See Also:
-
getWriteTimeout
Description copied from interface:ConnectionReturns the current value for the blocking write timeout converted to the providedTimeUnitspecification. If this value hasn't been explicitly set, it will default to 30 seconds.- Specified by:
getWriteTimeoutin interfaceConnection<SocketAddress>- Parameters:
timeUnit- theTimeUnitto convert the returned result to.- Returns:
- the write timeout value
-
setWriteTimeout
Description copied from interface:ConnectionSpecifies the timeout for the blocking writes. This may be overridden on a per-connection basis. A value of zero or less effectively disables the timeout.- Specified by:
setWriteTimeoutin interfaceConnection<SocketAddress>- Parameters:
timeout- the new timeout valuetimeUnit- theTimeUnitspecification of the provided value.- See Also:
-
getSelectorRunner
-
setSelectorRunner
-
attachToSelectorRunner
- Throws:
IOException
-
detachSelectorRunner
- Throws:
IOException
-
getChannel
-
setChannel
-
getSelectionKey
-
setSelectionKey
-
obtainProcessor
Description copied from interface:ConnectionGets theProcessor, which will processConnectionI/O event. IfProcessoris null, - thenTransportwill try to getProcessorusingConnection'sProcessorSelector.select(IOEvent, Connection). IfProcessorSelector, associated withtheConnectionis also null - will askTransportfor aProcessor.- Specified by:
obtainProcessorin interfaceConnection<SocketAddress>- Parameters:
ioEvent- event to obtain the processor for- Returns:
- the default
Processor, which will processConnectionI/O events.
-
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>- Returns:
- the default
Processor, which will processConnectionI/O events.
-
setProcessor
Description copied from interface:ConnectionSets 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:
setProcessorin interfaceConnection<SocketAddress>- Parameters:
preferableProcessor- the defaultProcessor, which will processConnectionI/O events.
-
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>- Returns:
- the default
ProcessorSelector, which will be used to getProcessorto processConnectionI/O events, in case if thisConnection'sProcessoris null.
-
setProcessorSelector
Description copied from interface:ConnectionSets the defaultProcessorSelector, which will be used to getProcessorto processConnectionI/O events, in case if thisConnection'sProcessoris null.- Specified by:
setProcessorSelectorin interfaceConnection<SocketAddress>- Parameters:
preferableProcessorSelector- the defaultProcessorSelector, which will be used to getProcessorto processConnectionI/O events, in case if thisConnection'sProcessoris null.
-
obtainProcessorState
Description copied from interface:ConnectionReturns theProcessorstate associated with this Connection.- Specified by:
obtainProcessorStatein interfaceConnection<SocketAddress>- Type Parameters:
E- state of theProcessor- Parameters:
processor-Processorfactory- factory that is used to initialise the state- Returns:
- the
Processorstate associated with this Connection.
-
executeInEventThread
Description copied from interface:ConnectionExecutes theRunnablein the thread, responsible for running the given type of event on this Connection. The thread will be chosen based onTransportsettings, especially current I/O strategy.- Specified by:
executeInEventThreadin interfaceConnection<SocketAddress>- Parameters:
event- event to get the thread pool fromrunnable- Runnable to run in the thread
-
getAsyncReadQueue
-
getAsyncWriteQueue
-
getAttributes
Description copied from interface:AttributeStorageGet associatedAttributeHolder. Implementation may return null ifAttributeHolderwasn't initialized yet.- Specified by:
getAttributesin interfaceAttributeStorage- Returns:
- associated
AttributeHolder. Implementation may return null ifAttributeHolderwasn't initialized yet.
-
read
Description copied from interface:ReadableMethod reads data.- Specified by:
readin interfaceReadable<SocketAddress>- Type Parameters:
M- type of data to read- Returns:
Future, using which it's possible to check the result
-
read
- Specified by:
readin interfaceReadable<SocketAddress>
-
write
Description copied from interface:WriteableMethod writes the buffer.- Specified by:
writein interfaceWriteable<SocketAddress>- Type Parameters:
M- type of data to be written- Parameters:
message- the buffer, from which the data will be written- Returns:
Future, using which it's possible to check the result
-
write
Description copied from interface:WriteableMethod writes the buffer.- Specified by:
writein interfaceWriteable<SocketAddress>- Type Parameters:
M- type of data to be written- Parameters:
message- the buffer, from which the data will be writtencompletionHandler-CompletionHandler, which will get notified, when write will be completed
-
write
@Deprecated public <M> void write(M message, CompletionHandler<WriteResult<M, SocketAddress>> completionHandler, PushBackHandler pushbackHandler) Deprecated.Description copied from interface:WriteableMethod writes the buffer.- Specified by:
writein interfaceWriteable<SocketAddress>- Type Parameters:
M- type of data to be written- Parameters:
message- the buffer, from which the data will be writtencompletionHandler-CompletionHandler, which will get notified, when write will be completedpushbackHandler-PushBackHandler, which will be notified if message was accepted by transport write queue or refused
-
write
public <M> void write(SocketAddress dstAddress, M message, CompletionHandler<WriteResult<M, SocketAddress>> completionHandler) Description copied from interface:WriteableMethod writes the buffer to the specific address.- Specified by:
writein interfaceWriteable<SocketAddress>- Type Parameters:
M- type of data to be written- Parameters:
dstAddress- the destination address the buffer will be sent tomessage- the buffer, from which the data will be writtencompletionHandler-CompletionHandler, which will get notified, when write will be completed
-
write
@Deprecated public <M> void write(SocketAddress dstAddress, M message, CompletionHandler<WriteResult<M, SocketAddress>> completionHandler, PushBackHandler pushbackHandler) Deprecated.Description copied from interface:WriteableMethod writes the buffer to the specific address.- Specified by:
writein interfaceWriteable<SocketAddress>- Type Parameters:
M- type of data to be written- Parameters:
dstAddress- the destination address the buffer will be sent tomessage- the buffer, from which the data will be writtencompletionHandler-CompletionHandler, which will get notified, when write will be completedpushbackHandler-PushBackHandler, which will be notified if message was accepted by transport write queue or refused
-
isOpen
public boolean isOpen()Description copied from interface:ConnectionIsConnectionopen and ready. Returns true, if connection is open and ready, or false otherwise.- Specified by:
isOpenin interfaceCloseable- Specified by:
isOpenin interfaceConnection<SocketAddress>- Returns:
- true, if connection is open and ready, or false otherwise.
-
assertOpen
Description copied from interface:ConnectionChecks if this Connection is open and ready to be used. If this Connection is closed - this method throwsIOExceptiongiving the reason why this Connection was closed.- Specified by:
assertOpenin interfaceCloseable- Specified by:
assertOpenin interfaceConnection<SocketAddress>- Throws:
IOException- giving the reason why this Closeable was closed.
-
isClosed
public boolean isClosed() -
getCloseReason
Description copied from interface:ConnectionReturnsCloseReasonif this Connection has been closed, or null otherwise.- Specified by:
getCloseReasonin interfaceConnection<SocketAddress>- Returns:
CloseReasonif this Connection has been closed, or null otherwise
-
terminateSilently
public void terminateSilently()Description copied from interface:ConnectionClose theConnectionsilently, no notification required on completion or failure.- Specified by:
terminateSilentlyin interfaceCloseable- Specified by:
terminateSilentlyin interfaceConnection<SocketAddress>
-
terminate
Description copied from interface:ConnectionClose theConnection- Specified by:
terminatein interfaceCloseable- Specified by:
terminatein interfaceConnection<SocketAddress>- Returns:
Future, which could be checked in case, if close operation will be run asynchronously
-
terminateWithReason
Description copied from interface:ConnectionCloses the Connection and provides the reason description. This method is similar toConnection.terminateSilently(), but additionally provides the reason why the Connection will be closed.- Specified by:
terminateWithReasonin interfaceCloseable- Specified by:
terminateWithReasonin interfaceConnection<SocketAddress>- Parameters:
reason- reason why terminated. This will be thrown isCloseable.isOpen()is called subsequently
-
close
Description copied from interface:ConnectionGracefully close theConnection- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceConnection<SocketAddress>- Returns:
Future, which could be checked in case, if close operation will be run asynchronously- See Also:
-
close
Deprecated.please useclose()with the followingGrizzlyFuture.addCompletionHandler(org.glassfish.grizzly.CompletionHandler)callGracefully close theConnection- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceConnection<SocketAddress>- Parameters:
completionHandler-CompletionHandlerto be called, when the connection is closed.
-
closeSilently
public final void closeSilently()Description copied from interface:ConnectionGracefully close theConnectionsilently, no notification required on completion or failure.- Specified by:
closeSilentlyin interfaceCloseable- Specified by:
closeSilentlyin interfaceConnection<SocketAddress>
-
closeWithReason
Description copied from interface:ConnectionGracefully closes the Connection and provides the reason description. This method is similar toConnection.closeSilently(), but additionally provides the reason why the Connection will be closed.- Specified by:
closeWithReasonin interfaceCloseable- Specified by:
closeWithReasonin interfaceConnection<SocketAddress>- Parameters:
reason- reason why closed, this will be thrown byCloseable.isOpen()if called subsequently
-
closeFuture
- Specified by:
closeFuturein interfaceCloseable- Returns:
- the
Future, that will be notified once this Closeable is closed
-
closeGracefully0
protected void closeGracefully0(CompletionHandler<Closeable> completionHandler, CloseReason closeReason) -
terminate0
-
doClose
Do the actual connection close.- Throws:
IOException
-
addCloseListener
Add theConnection.CloseListener, which will be notified once Connection will be closed.- Specified by:
addCloseListenerin interfaceCloseable- Specified by:
addCloseListenerin interfaceConnection<SocketAddress>- Parameters:
closeListener-Connection.CloseListener.
-
removeCloseListener
Remove theConnection.CloseListener.- Specified by:
removeCloseListenerin interfaceCloseable- Specified by:
removeCloseListenerin interfaceConnection<SocketAddress>- Parameters:
closeListener-Connection.CloseListener.- Returns:
- true if the listener was successfully removed, or false otherwise.
-
addCloseListener
Description copied from interface:ConnectionAdd theConnection.CloseListener, which will be notified once Connection will be closed.- Specified by:
addCloseListenerin interfaceConnection<SocketAddress>- Parameters:
closeListener-Connection.CloseListener
-
removeCloseListener
Description copied from interface:ConnectionRemove theConnection.CloseListener.- Specified by:
removeCloseListenerin interfaceConnection<SocketAddress>- Parameters:
closeListener-Connection.CloseListener.- Returns:
- true if listener successfully removed
-
notifyConnectionError
Method gets invoked, when error occur during the Connection lifecycle.- Specified by:
notifyConnectionErrorin interfaceConnection<SocketAddress>- Parameters:
error-Throwable.
-
getMonitoringConfig
Return the object associatedMonitoringConfig.- Specified by:
getMonitoringConfigin interfaceConnection<SocketAddress>- Specified by:
getMonitoringConfigin interfaceMonitoringAware<ConnectionProbe>- Returns:
- the Connection monitoring configuration
MonitoringConfig.
-
notifyProbesBind
Notify registeredConnectionProbes about the bind event.- Parameters:
connection- the Connection event occurred on.
-
notifyProbesAccept
protected static void notifyProbesAccept(NIOConnection serverConnection, NIOConnection clientConnection) Notify registeredConnectionProbes about the accept event.- Parameters:
serverConnection- the server Connection, which accepted the client connection.clientConnection- the client Connection.
-
notifyProbesConnect
Notify registeredConnectionProbes about the connect event.- Parameters:
connection- the Connection event occurred on.
-
notifyProbesRead
Notify registeredConnectionProbes about the read event. -
notifyProbesWrite
Notify registeredConnectionProbes about the write event. -
notifyIOEventReady
Notify registeredConnectionProbes about the IO Event ready event.- Parameters:
connection- the Connection event occurred on.ioEvent- theIOEvent.
-
notifyIOEventEnabled
Notify registeredConnectionProbes about the IO Event enabled event.- Parameters:
connection- the Connection event occurred on.ioEvent- theIOEvent.
-
notifyIOEventDisabled
Notify registeredConnectionProbes about the IO Event disabled event.- Parameters:
connection- the Connection event occurred on.ioEvent- theIOEvent.
-
notifyProbesClose
Notify registeredConnectionProbes about the close event.- Parameters:
connection- the Connection event occurred on.
-
notifyProbesError
Notify registeredConnectionProbes about the error.- Parameters:
connection- the Connection event occurred on.
-
preClose
protected void preClose() -
enableInitialOpRead
Enables OP_READ if it has never been enabled before.- Throws:
IOException
-
simulateIOEvent
- Specified by:
simulateIOEventin interfaceConnection<SocketAddress>- Throws:
IOException
-
enableIOEvent
- Specified by:
enableIOEventin interfaceConnection<SocketAddress>- Throws:
IOException
-
disableIOEvent
- Specified by:
disableIOEventin interfaceConnection<SocketAddress>- Throws:
IOException
-
checkEmptyRead
protected final void checkEmptyRead(int size)
-
close()with the followingGrizzlyFuture.addCompletionHandler(org.glassfish.grizzly.CompletionHandler)call