org.apache.mina.api

## Interface IoHandler

All Known Implementing Classes:
  AbstractIoHandler

    public interface IoHandler

Handle all the I/O events generated by a `IoService`.

You should handle your business logic in an IoHandler implementation.

The `IoFilter` is dedicated to message transformation, but the IoHandler is mean to be the core of your business logic.

If you need to implement blocking code in your `IoHandler`, then you need to add a `IoHandlerExecutor` in the enclosing `IoService`.

### Method Summary

Methods
`void` `exceptionCaught(IoSession session, Exception cause)` Invoked when any runtime exception is thrown during session processing (filters, unexpected error, etc..).
`void` `messageReceived(IoSession session, Object message)` Invoked when a message is received.
`void` `messageSent(IoSession session, Object message)` Invoked when a high level message was written to the low level O/S buffer.
`void` `serviceActivated(IoService service)` Invoked when a new service is activated by an `IoService`.
`void` `serviceInactivated(IoService service)` Invoked when a service is inactivated by an `IoService`.
`void` `sessionClosed(IoSession session)` Invoked when a connection is closed.
`void` `sessionIdle(IoSession session, IdleStatus status)` Invoked with the related `IdleStatus` when a connection becomes idle.
`void` `sessionOpened(IoSession session)` Invoked when a connection has been opened.

### Method Detail

#### sessionOpened

    void sessionOpened(IoSession session)

Invoked when a connection has been opened.

Parameters:
  `session` - `IoSession` associated with the invocation

#### sessionClosed

    void sessionClosed(IoSession session)

Invoked when a connection is closed.

Parameters:
  `session` - `IoSession` associated with the invocation

#### sessionIdle

    void sessionIdle(IoSession session,
                   IdleStatus status)

Invoked with the related `IdleStatus` when a connection becomes idle.

Parameters:
  `session` - `IoSession` associated with the invocation

#### messageReceived

    void messageReceived(IoSession session,
                       Object message)

Invoked when a message is received.

Parameters:
  `session` - `IoSession` associated with the invocation
  `message` - the incoming message to process

#### messageSent

    void messageSent(IoSession session,
                   Object message)

Invoked when a high level message was written to the low level O/S buffer.

Parameters:
  `session` - `IoSession` associated with the invocation
  `message` - the incoming message to process

#### serviceActivated

    void serviceActivated(IoService service)

Invoked when a new service is activated by an `IoService`.

Parameters:
  `service` - the `IoService`

#### serviceInactivated

    void serviceInactivated(IoService service)

Invoked when a service is inactivated by an `IoService`.

Parameters:
  `service` - the `IoService`

#### exceptionCaught

    void exceptionCaught(IoSession session,
                       Exception cause)

Invoked when any runtime exception is thrown during session processing (filters, unexpected error, etc..).

Parameters:
  `session` - the session related to the exception
  `cause` - the caught exception