note
This page is being updated

Overview

IoService provides basic I/O Service and manages I/O Sessions within MINA. Its one of the most crucial part of MINA Architecture. The implementing classes of IoService and child interface, are where most of the low level I/O operations are handled.

IoService Mind Map

Lets try to see what are the responsibilities of the IoService and it implementing class AbstractIoService. Lets take a slightly different approach of first using a Ming Map and then jump into the inner working. The Mind Map was created using XMind.

Interface Details

IoService is the base interface for all the IoConnector's and IoAcceptor's that provides I/O services and manages I/O sessions. The interface has all the functions need to perform I/O related operations.

Lets take a deep dive into the various methods in the interface

  • getTransportMetadata()
  • addListener()
  • removeListener()
  • isDisposing()
  • isDisposed()
  • dispose()
  • getHandler()
  • setHandler()
  • getManagedSessions()
  • getManagedSessionCount()
  • getSessionConfig()
  • getFilterChainBuilder()
  • setFilterChainBuilder()
  • getFilterChain()
  • isActive()
  • getActivationTime()
  • broadcast()
  • setSessionDataStructureFactory()
  • getScheduledWriteBytes()
  • getScheduledWriteMessages()
  • getStatistics()

getTransportMetadata()

This method returns the Transport meta-data the Acceptor or Connector is running. The typical details include provider name (nio, apr, rxtx), connection type (connectionless/connection oriented) etc

addListener

Allows to add a IoServiceListener to listen to specific events related to Ioservice

removeListener

Removes specified IoServiceListener attached to this IoService