ANILib, the Asynchronous Native Interface Library, is an add-on package for this Virtual Machine. It provides an API for using native threads in this VM for executing long running native methods.ANILib was previously included as an bundled component of this VM. In this release, we have separated out the ANILib functionality into a separate package to improve maintainability and achieve a more modular software design.
This is version 1.0.1 of ANILib.
This version of ANILib has built-in support for 3 platforms:
win32_i386linux_i386linux_armThe source code has been structured so that it will be easy to add support for other platforms.
To build ANILib for your selected platform, you need to follow these steps. (Note the instructions assumes you're building for
linux_i386.)
- First, you need to build the VM. This can be done by setting up the
JVMWorkSpaceenvironment variable, and then executing thegnumakecommand inside$(JVMWorkSpace)/build/linux_i386.
- Change to the
build/linux_i386subdirectory of the ANILib source distribution, and execute thegnumakecommand. This produces the following output files:
build/linux_i386/product/cldc_vm_anibuild/linux_i386/product/libani.abuild/linux_i386/test_classes/SocketTest.class
- By default, the
productvariant of ANILib is produced. If you wish to build for other variants, please use commands such as:
gnumake BUILD=debuggnumake BUILD=releasegnumake BUILD=product
ANILib comes with a sample program,SocketTest, which tests the capabilities of a sample socket protocol. To Execute it, try these commands:Please read the comments incd build/linux_i386
./product/cldc_vm_ani -cp test_classes SocketTest -host www.sun.comsrc/tests/SocketTest.javafor a complete list of options provided by SocketTest for testing different features in ANILib.
To use theANI_XXX()functions exported by ANILib, simply link withlibani.a(orani.libfor thewin32_i386platform).
This version of ANILib adds a new API function,ANI_Initialize(), which must be called before you use any other ANI functions.Also, when your program is about exit, please call
ANI_Dispose()to free up resources allocated by ANILib.When compiling your code, please use the
src/share/ani.hheader file included in this ANILib source distribution.