摘要 |
A variety of mechanisms are disclosed for a dynamically binding native methods in an interpreted bytecode program to functions that are contained in compiled code, such as a dynamically linked library. In one implementation, a shared function is specified by means of a naming convention that is appropriate for the bytecode interpreted program, such as a package of classes. When a native method is to be resolved during loading of a class, the name of the package is examined to see if the method resides in a shared library. If so, it is loaded using techniques that are specific to the compiled code in which the library exists. In another embodiment, a designated base class, or interface, is used to identify the method by which the shared library is to be loaded. In a third type of implementation, a given method requests a class to specify which libraries it needs to be linked to, as it is being loaded, after which the libraries are loaded and the class methods are linked to them.
|