Class AbstractPollingIoProcessor.Processor
java.lang.Object
org.apache.mina.core.polling.AbstractPollingIoProcessor.Processor
- All Implemented Interfaces:
Runnable
- Enclosing class:
AbstractPollingIoProcessor<S extends AbstractIoSession>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanProcess a new session : - initialize it - create its chain - fire the CREATED listeners if anyprivate voidclearWriteRequestQueue(S session) private voidfireMessageSent(S session, WriteRequest req) private voidflush(long currentTime) Write all the pending messagesprivate booleanprivate intLoops over the new sessions blocking queue and returns the number of sessions which are effectively createdprivate voidnotifyIdleSessions(long currentTime) private voidprocess()private voidDeal with session ready for the read or write operations, or both.private booleanprivate intvoidrun()private voidscheduleFlush(S session) private voidUpdate the trafficControl for all the session.private intwriteBuffer(S session, WriteRequest req, boolean hasFragmentation, int maxLength, long currentTime) private intwriteFile(S session, WriteRequest req, boolean hasFragmentation, int maxLength, long currentTime)
-
Constructor Details
-
Processor
private Processor()
-
-
Method Details
-
run
-
handleNewSessions
private int handleNewSessions()Loops over the new sessions blocking queue and returns the number of sessions which are effectively created- Returns:
- The number of new sessions
-
notifyIdleSessions
-
updateTrafficMask
private void updateTrafficMask()Update the trafficControl for all the session. -
addNow
Process a new session : - initialize it - create its chain - fire the CREATED listeners if any- Parameters:
session- The session to create- Returns:
trueif the session has been registered
-
removeSessions
private int removeSessions() -
flush
private void flush(long currentTime) Write all the pending messages -
flushNow
-
scheduleFlush
-
writeFile
private int writeFile(S session, WriteRequest req, boolean hasFragmentation, int maxLength, long currentTime) throws Exception - Throws:
Exception
-
writeBuffer
private int writeBuffer(S session, WriteRequest req, boolean hasFragmentation, int maxLength, long currentTime) throws Exception - Throws:
Exception
-
removeNow
-
clearWriteRequestQueue
-
fireMessageSent
-
process
-
process
Deal with session ready for the read or write operations, or both.
-