Package org.apache.mina.core.polling
Class AbstractPollingIoProcessor.Processor
java.lang.Object
org.apache.mina.core.polling.AbstractPollingIoProcessor.Processor
- All Implemented Interfaces:
Runnable
- Enclosing class:
AbstractPollingIoProcessor<S extends AbstractIoSession>
The main loop. This is the place in charge to poll the Selector, and to
process the active sessions. It's done in - handle the newly created
sessions -
-
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
public void 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
- Throws:
Exception
-
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
- Throws:
Exception
-
process
Deal with session ready for the read or write operations, or both.
-