Interface IoProcessor<S extends IoSession>
- Type Parameters:
S- the type of theIoSessionthis processor can handle
- All Known Implementing Classes:
AbstractPollingIoProcessor, AprIoProcessor, NioDatagramAcceptor, NioProcessor, SimpleIoProcessorPool, VmPipeFilterChain.VmPipeIoProcessor
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the specifiedsessionto the I/O processor so that the I/O processor starts to perform any I/O operations related with thesession.voiddispose()Releases any resources allocated by this processor.voidFlushes the internal write request queue of the specifiedsession.booleanbooleanvoidRemoves and closes the specifiedsessionfrom the I/O processor so that the I/O processor closes the connection associated with thesessionand releases any other related resources.voidupdateTrafficControl(S session) Controls the traffic of the specifiedsessiondepending of theIoSession.isReadSuspended()andIoSession.isWriteSuspended()flagsvoidwrite(S session, WriteRequest writeRequest) Writes the WriteRequest for the specifiedsession.
-
Method Details
-
isDisposing
boolean isDisposing()- Returns:
trueif and if onlydispose()method has been called. Please note that this method will returntrueeven after all the related resources are released.
-
isDisposed
boolean isDisposed()- Returns:
trueif and if only all resources of this processor have been disposed.
-
dispose
void dispose()Releases any resources allocated by this processor. Please note that the resources might not be released as long as there are any sessions managed by this processor. Most implementations will close all sessions immediately and release the related resources. -
add
Adds the specifiedsessionto the I/O processor so that the I/O processor starts to perform any I/O operations related with thesession.- Parameters:
session- The added session
-
flush
Flushes the internal write request queue of the specifiedsession.- Parameters:
session- The session we want the message to be written
-
write
Writes the WriteRequest for the specifiedsession.- Parameters:
session- The session we want the message to be writtenwriteRequest- the WriteRequest to write
-
updateTrafficControl
Controls the traffic of the specifiedsessiondepending of theIoSession.isReadSuspended()andIoSession.isWriteSuspended()flags- Parameters:
session- The session to be updated
-
remove
Removes and closes the specifiedsessionfrom the I/O processor so that the I/O processor closes the connection associated with thesessionand releases any other related resources.- Parameters:
session- The session to be removed
-