com.coi.tools.os.izpack
Class COIOSHelper

java.lang.Object
  extended by com.coi.tools.os.izpack.COIOSHelper

public class COIOSHelper
extends java.lang.Object

Base class to handle multiple native methods of multiple classes in one shared library. This is a singelton class.

Author:
Klaus Bartz

Field Summary
private static boolean destroyed
           
private  boolean failed
           
private static COIOSHelper self
           
private static int used
           
 
Constructor Summary
private COIOSHelper()
          Default constructor, do not use
 
Method Summary
 void addDependant(NativeLibraryClient dependant)
          Add a NativeLibraryClient as dependant to this object.
 void freeLibrary(java.lang.String name)
           
private  void FreeLibrary(java.lang.String name)
          This method is used to free the library at the end of progam execution.
static COIOSHelper getInstance()
          Returns the one existent object of this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

self

private static COIOSHelper self

used

private static int used

destroyed

private static boolean destroyed

failed

private boolean failed
Constructor Detail

COIOSHelper

private COIOSHelper()
Default constructor, do not use

Method Detail

FreeLibrary

private void FreeLibrary(java.lang.String name)
This method is used to free the library at the end of progam execution. After this call, any instance of this class will not be usable any more!

Parameters:
name - the name of the library to free. Use only the name and extension but not the path.

getInstance

public static COIOSHelper getInstance()
Returns the one existent object of this class.

Returns:
the one existent object of this class

freeLibrary

public void freeLibrary(java.lang.String name)
Parameters:
name -

addDependant

public void addDependant(NativeLibraryClient dependant)
                  throws java.lang.Exception
Add a NativeLibraryClient as dependant to this object. The method tries to load the shared library COIOSHelper which should contain native methods for the dependant.

Parameters:
dependant - to be added
Throws:
java.lang.Exception - if loadLibrary for the needed lib fails