com.jniwrapper.util
Class AppletHelper

java.lang.Object
  extended by com.jniwrapper.util.AppletHelper

public class AppletHelper
extends java.lang.Object

This class is helper for Java applets that use JNIWrapper library.

You can call native functions from dll libraries after start of JNIWrapper library.

Since:
2.5

Constructor Summary
protected AppletHelper()
           
 
Method Summary
static AppletHelper getInstance()
           
 void init(java.applet.Applet applet)
          Initializes native code integration for applets.
 void init(java.net.URL nativeLibUrl)
          Downloads and installs the native code library to the client's computer.
 void loadLibrary(java.applet.Applet applet, java.lang.String libraryName)
          This method provides the ability to load and install a custom library (which is used by the specified applet) to the client side.
protected static void setInstance(AppletHelper instance)
           
 void start()
          Starts native resource collector.
 void stop()
          Stops native resource collector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppletHelper

protected AppletHelper()
Method Detail

getInstance

public static AppletHelper getInstance()

setInstance

protected static void setInstance(AppletHelper instance)

init

public void init(java.applet.Applet applet)
          throws java.io.IOException
Initializes native code integration for applets. Downloads and installs the native code library. You should call this method in the init() method of the applet that uses JNIWrapper.

Note: This method assumes that the native code library is places into the same code base location with the applet.

Parameters:
applet - an applet instance.
Throws:
java.io.IOException

init

public void init(java.net.URL nativeLibUrl)
          throws java.io.IOException
Downloads and installs the native code library to the client's computer. You should call this method in the init() method of your applet. This method must be called before invoking any other methods of JNIWrapper classes.

Parameters:
nativeLibUrl - url of the native code library.
Throws:
java.io.IOException

start

public void start()
Starts native resource collector. You should call this method in the start() method of the applet that uses jniwrapper. This method must be called before using any other JNIWrapper classes.


stop

public void stop()
Stops native resource collector. You should call this method in the stop() method of the applet that uses jniwrapper. This method must be called when no native resources are going to be allocated by the applet.


loadLibrary

public void loadLibrary(java.applet.Applet applet,
                        java.lang.String libraryName)
                 throws java.io.IOException
This method provides the ability to load and install a custom library (which is used by the specified applet) to the client side.

Parameters:
applet - an applet that uses the specified library
libraryName - a library name to install to the client side
Throws:
java.io.IOException