Class AbstractPollingIoProcessor.Processor

java.lang.Object
org.apache.mina.core.polling.AbstractPollingIoProcessor.Processor
All Implemented Interfaces:
Runnable
Enclosing class:
AbstractPollingIoProcessor<S extends AbstractIoSession>

private class AbstractPollingIoProcessor.Processor extends Object implements Runnable
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 Details

    • Processor

      private Processor()
  • Method Details

    • run

      public void run()
      Specified by:
      run in interface 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 Exception
      Throws:
      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:
      true if 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 Exception
      Throws:
      Exception
    • writeBuffer

      private int writeBuffer(S session, WriteRequest req, boolean hasFragmentation, int maxLength, long currentTime) throws Exception
      Throws:
      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 Exception
      Throws:
      Exception
    • process

      private void process(S session)
      Deal with session ready for the read or write operations, or both.