Package org.apache.mina.core.service
Interface IoProcessor<S extends IoSession>
-
- Type Parameters:
S
- the type of theIoSession
this processor can handle
- All Known Implementing Classes:
AbstractPollingIoProcessor
,AprIoProcessor
,NioDatagramAcceptor
,NioProcessor
,SimpleIoProcessorPool
public interface IoProcessor<S extends IoSession>
An internal interface to represent an 'I/O processor' that performs actual I/O operations forIoSession
s. 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 void
add(S session)
Adds the specifiedsession
to the I/O processor so that the I/O processor starts to perform any I/O operations related with thesession
.void
dispose()
Releases any resources allocated by this processor.void
flush(S session)
Flushes the internal write request queue of the specifiedsession
.boolean
isDisposed()
boolean
isDisposing()
void
remove(S session)
Removes and closes the specifiedsession
from the I/O processor so that the I/O processor closes the connection associated with thesession
and releases any other related resources.void
updateTrafficControl(S session)
Controls the traffic of the specifiedsession
depending of theIoSession.isReadSuspended()
andIoSession.isWriteSuspended()
flagsvoid
write(S session, WriteRequest writeRequest)
Writes the WriteRequest for the specifiedsession
.
-
-
-
Method Detail
-
isDisposing
boolean isDisposing()
- Returns:
true
if and if onlydispose()
method has been called. Please note that this method will returntrue
even after all the related resources are released.
-
isDisposed
boolean isDisposed()
- Returns:
true
if 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 specifiedsession
to 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 specifiedsession
depending of theIoSession.isReadSuspended()
andIoSession.isWriteSuspended()
flags- Parameters:
session
- The session to be updated
-
remove
void remove(S session)
Removes and closes the specifiedsession
from the I/O processor so that the I/O processor closes the connection associated with thesession
and releases any other related resources.- Parameters:
session
- The session to be removed
-
-