The network application developed based on Apache MINA has a similar architecture. The schema is given in Figure 1.
Figure 1. Architecture of Web applications based on Apache MINA
As shown in Figure 1, the Apache MINA-based network application has three levels, namely I/O service, I/O filter, and I/O Processor:
I/O services: I/O services are used to perform actual I/O operations. Apache MINA has provided a range of I/O services that support different protocols, such as TCP/IP, UDP/IP, serial ports, and intra-VM pipelines. Developers can also implement their own I/O services.
I/O filters: The I/O service is capable of transmitting byte streams, whereas upper-level applications require specific objects and data structures. The I/O filter is used to accomplish the conversion between the two. Another important function of the I/O filter is to process the input and output data to meet the crosscutting requirements. Multiple I/O filters are concatenated together to form an I/O filter chain.
I/O processors: I/O processors are used to perform specific business logic. Performs a specific processing on the received message.
Creating a complete Apache MINA-based Web application requires building these three levels separately. Apache MINA has provided a number of implementations for I/O services and I/O filters, so these two levels can be used in most cases with an existing implementation. I/O processors are generally required to be implemented on their own, due to their specific business relevance.
The architecture of the Apache MINA network application