com.sun.jaw.impl.agent.services.loader.rmi
Class NetLibLoader

java.lang.Object
  |
  +--com.sun.jaw.impl.agent.services.loader.rmi.NetLibLoader

public class NetLibLoader
extends java.lang.Object
implements java.io.Serializable

The LibraryLoader class loads native dynamic libraries. These libraries are usually associated with native methods.

First we try to download the library from the class server and load it. If the library cannot be found in the class server then the VM searches the library along the path specified as the java.library.path property.

The library path used by default for locating libraries is specified in the following order:

  1. The value of the libpath property in the object name you give to the service.
  2. The value of the jaw.net.library.path property.
  3. The return value of getTmpDir() in class DefaultPaths.

The server attempts to locate the library in:

For example:

See Also:
Serialized Form

Constructor Summary
NetLibLoader(ObjectName name)
          Create a new instance of NetLibLoader.
 
Method Summary
 java.lang.String findLibrary(NetClassServer server, java.lang.String libname)
          Returns the absolute path name of a native library.
 java.lang.String getClassVersion()
          Returns the version of this class.
 java.util.Vector getLibPaths()
          Returns the current library path used by this library loader to locally store the libraries coming from the Class Server before they are loaded.
 void setLibPaths(java.util.Vector newValue)
          Sets the current library path used by this library loader to locally store the libraries coming from the Class Server before they are loaded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetLibLoader

public NetLibLoader(ObjectName name)
Create a new instance of NetLibLoader.

The library path to look for libraries can be provided when creating the library loader, if not provided, the default one will be used.

Method Detail

findLibrary

public java.lang.String findLibrary(NetClassServer server,
                                    java.lang.String libname)
Returns the absolute path name of a native library. The VM invokes this method to locate the native libraries that belong to classes loaded with this class loader. Libraries are searched in the class server associated to this class loader using first just the native library name and if not found the native library name together with the architecture-specific path name (OSName/OSArch/OSVersion/lib/nativelibname), i.e.

the library stat on Solaris SPARC 5.7 will be searched under the library path specified by the class server as:

  1. <libpath>/libstat.so
  2. <libpath>/SunOS/sparc/5.7/lib/libstat.so
the library stat on Windows NT 4.0 will be searched in the class server as:
  1. <libpath>/stat.dll
  2. <libpath>/WindowsNT/x86/4.0/lib/stat.dll

If this method returns null, i.e. the library was not found in the class server associated to this class loader, the VM searches the library along the path specified as the java.library.path property.

Parameters:
libname - The library name.
Returns:
The absolute path of the native library.

getLibPaths

public java.util.Vector getLibPaths()
Returns the current library path used by this library loader to locally store the libraries coming from the Class Server before they are loaded.
Returns:
a Vector of paths.

setLibPaths

public void setLibPaths(java.util.Vector newValue)
Sets the current library path used by this library loader to locally store the libraries coming from the Class Server before they are loaded.
Parameters:
newValue - The new Vector of paths to use.

getClassVersion

public java.lang.String getClassVersion()
Returns the version of this class.
Returns:
String representing the version of this class.