Package org.apache.mina.core.polling
Class AbstractPollingIoProcessor.Processor
- java.lang.Object
-
- org.apache.mina.core.polling.AbstractPollingIoProcessor.Processor
-
- All Implemented Interfaces:
java.lang.Runnable
- Enclosing class:
- AbstractPollingIoProcessor<S extends AbstractIoSession>
private class AbstractPollingIoProcessor.Processor extends java.lang.Object implements java.lang.RunnableThe 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 Modifier Constructor Description privateProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleanaddNow(S session)Process 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 booleanflushNow(S session, long currentTime)private inthandleNewSessions()Loops over the new sessions blocking queue and returns the number of sessions which are effectively createdprivate voidnotifyIdleSessions(long currentTime)private voidprocess()private voidprocess(S session)Deal with session ready for the read or write operations, or both.private booleanremoveNow(S session)private intremoveSessions()voidrun()private voidscheduleFlush(S session)private voidupdateTrafficMask()Update 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)
-
-
-
Method Detail
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
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
private void notifyIdleSessions(long currentTime) throws java.lang.Exception- Throws:
java.lang.Exception
-
updateTrafficMask
private void updateTrafficMask()
Update the trafficControl for all the session.
-
addNow
private boolean addNow(S session)
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
private boolean flushNow(S session, long currentTime)
-
scheduleFlush
private void scheduleFlush(S session)
-
writeFile
private int writeFile(S session, WriteRequest req, boolean hasFragmentation, int maxLength, long currentTime) throws java.lang.Exception
- Throws:
java.lang.Exception
-
writeBuffer
private int writeBuffer(S session, WriteRequest req, boolean hasFragmentation, int maxLength, long currentTime) throws java.lang.Exception
- Throws:
java.lang.Exception
-
removeNow
private boolean removeNow(S session)
-
clearWriteRequestQueue
private void clearWriteRequestQueue(S session)
-
fireMessageSent
private void fireMessageSent(S session, WriteRequest req)
-
process
private void process() throws java.lang.Exception- Throws:
java.lang.Exception
-
process
private void process(S session)
Deal with session ready for the read or write operations, or both.
-
-