Tomcat AprEndPoint Architecture
Tomcat AprEndPoint Architecture
What APR means? It's funll name is Apache Portable Runtime Libraries. It's programed by C, it's goal is to provide a OS interface libraries for applications which is cross-platform.
The AprEndPoint call the JNI API to implement NIO. JNI means Java Native Interface, it can help Java program call the interface from other language. We can also see many JNI cases in the JDK. The native method is that.
What's the difference between JNI API and Java API about NIO? We know JVM is also programed by C/C++. Java API is program -> JVM -> C/C++ In JVM -> OS, but JNI API is more direct interact with OS. That means if we frequently interact with OS, JNI API would helps us improve performance.
For example, socket communication, specially, if your web application uses TLS to encrypt the transfer. It leads many interaction between shake hand.
What is the AprEndPoint workflow? It is very similar to NioEndPoint. Let's see.


浙公网安备 33010602011771号