Package org.apache.mina.core.service
Interface IoProcessor<S extends IoSession>
-
- Type Parameters:
S- the type of theIoSessionthis processor can handle
- All Known Implementing Classes:
AbstractPollingIoProcessor,NioDatagramAcceptor,NioProcessor,SimpleIoProcessorPool
public interface IoProcessor<S extends IoSession>An internal interface to represent an 'I/O processor' that performs actual I/O operations forIoSessions. It abstracts existing reactor frameworks such as Java NIO once again to simplify transport implementations.- Author:
- Apache MINA Project
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidadd(S session)Adds 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.voidflush(S session)Flushes the internal write request queue of the specifiedsession.booleanisDisposed()booleanisDisposing()voidremove(S session)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.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 Detail
-
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
void add(S session)
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
void flush(S session)
Flushes the internal write request queue of the specifiedsession.- Parameters:
session- The session we want the message to be written
-
write
void write(S session, WriteRequest writeRequest)
Writes the WriteRequest for the specifiedsession.- Parameters:
session- The session we want the message to be writtenwriteRequest- the WriteRequest to write
-
updateTrafficControl
void updateTrafficControl(S session)
Controls the traffic of the specifiedsessiondepending of theIoSession.isReadSuspended()andIoSession.isWriteSuspended()flags- Parameters:
session- The session to be updated
-
remove
void remove(S session)
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
-
-