org.scijava.nativelib
Class WebappJniExtractor

java.lang.Object
  extended by org.scijava.nativelib.BaseJniExtractor
      extended by org.scijava.nativelib.WebappJniExtractor
All Implemented Interfaces:
JniExtractor

public class WebappJniExtractor
extends BaseJniExtractor

JniExtractor suitable for multiple application deployments on the same virtual machine (such as webapps)

Designed to avoid the restriction that jni library can be loaded by at most one classloader at a time.

Works by extracting each library to a different location for each classloader.

WARNING: This can expose strange and wonderful bugs in jni code. These bugs generally stem from transitive dependencies of the jni library and can be solved by linking these dependencies statically to form a single library

Author:
markjh

Constructor Summary
WebappJniExtractor(String classloaderName)
           
 
Method Summary
protected  void finalize()
           
 File getJniDir()
          this is where JNI libraries are extracted to (e.g.
 File getNativeDir()
          this is where native dependencies are extracted to (e.g.
 
Methods inherited from class org.scijava.nativelib.BaseJniExtractor
extractJni, extractRegistered
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebappJniExtractor

public WebappJniExtractor(String classloaderName)
                   throws IOException
Parameters:
classloaderName - is a friendly name for your classloader which will be embedded in the directory name of the classloader-specific subdirectory which will be created.
Throws:
IOException
Method Detail

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

getJniDir

public File getJniDir()
Description copied from class: BaseJniExtractor
this is where JNI libraries are extracted to (e.g. tmplib/classloaderName.1234567890000.0/).

Specified by:
getJniDir in class BaseJniExtractor
Returns:
jni working dir

getNativeDir

public File getNativeDir()
Description copied from class: BaseJniExtractor
this is where native dependencies are extracted to (e.g. tmplib/).

Specified by:
getNativeDir in class BaseJniExtractor
Returns:
native working dir


Copyright © 2010–2014 SciJava. All rights reserved.