crystalspace.jbind.impl
Class csNOM

java.lang.Object
  extended bycrystalspace.jbind.impl.csNOM

public final class csNOM
extends java.lang.Object

csNativeObjectManager

This class is responsible for managing new SCF object pointer and translate them into java object. It tracks also every object that has a corresponding native object, upon shutdown of the jvm, it will free them.

It will free also SCF object upon call to csInitializer.DestroyApplication.

Author:
Quentin Anciaux

Method Summary
 void addJavaObjectNativeObjectLink(iJPointer javaPointer, iPointer nativePointer)
          Link a java interface with the native peer implementation
static void addJavaObjectNativeObjectLinkS(iJPointer javaPointer, iPointer nativePointer)
          Link a java interface with the native peer implementation
 void addNativeObject(iPointer pointer)
          Add a reference to a newly created native object.
static void addNativeObjectS(iPointer pointer)
          Add a reference to a newly created native object.
 void destroySCFObjects()
          DecRef all the alive SCF objects
static void destroySCFObjectsS()
          DecRef all the alive SCF objects
 void dump()
           
static void dumpS()
           
 iPointer getFirstNativeObject(iJPointer javaPointer)
          This method return the first native implementation for a java interface.
static iPointer getFirstNativeObjectS(iJPointer javaPointer)
          This method return the first native implementation for a java interface.
static csNOM getHandle()
          return the handle to the singleton
 iPointer getImpl(long iInterfaceID, iPointer nPointer)
          Return the java peer object corresponding to the given interface.
 iPointer getImpl(java.lang.String interfaceName, iPointer nPointer)
          Return the java peer object corresponding to the given interface.
 iPointer getImplPool(java.lang.String interfaceName, iPointer nPointer)
          Try to return a pooled java peer object for the given interface, with the given native pointer.
static iPointer getImplPoolS(java.lang.String interfaceName, iPointer nPointer)
          Try to return a pooled java peer object for the given interface, with the given native pointer.
static iPointer getImplS(long iInterfaceID, iPointer nPointer)
          Return the java peer object corresponding to the given interface.
static iPointer getImplS(java.lang.String interfaceName, iPointer nPointer)
          Return the java peer object corresponding to the given interface.
 iPointer[] getNativeObject(iJPointer javaPointer)
          This method return all the native implementation for a java interface.
 iPointer getNativeObjectForInterface(iJPointer javaPointer, java.lang.Class cClass)
          This method return all the native implementation for a java interface.
static iPointer getNativeObjectForInterfaceS(iJPointer javaPointer, java.lang.Class cClass)
          This method return all the native implementation for a java interface.
static iPointer[] getNativeObjectS(iJPointer javaPointer)
          This method return all the native implementation for a java interface.
 void setAsAvailable(java.lang.String interfaceName, iPointer nPointer)
          Set the java peer object for the given interface available for reuse.
static void setAsAvailableS(java.lang.String interfaceName, iPointer nPointer)
          Set the java peer object for the given interface available for reuse.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getHandle

public static csNOM getHandle()
return the handle to the singleton

Returns:

getImplPoolS

public static iPointer getImplPoolS(java.lang.String interfaceName,
                                    iPointer nPointer)
Try to return a pooled java peer object for the given interface, with the given native pointer.

Parameters:
interfaceName -
nPointer -
Returns:
null if not found.

getImplPool

public iPointer getImplPool(java.lang.String interfaceName,
                            iPointer nPointer)
Try to return a pooled java peer object for the given interface, with the given native pointer.

Parameters:
interfaceName -
nPointer -
Returns:
null if not found.

addJavaObjectNativeObjectLinkS

public static void addJavaObjectNativeObjectLinkS(iJPointer javaPointer,
                                                  iPointer nativePointer)
Link a java interface with the native peer implementation

Parameters:
javaPointer -
nativePointer -

addJavaObjectNativeObjectLink

public void addJavaObjectNativeObjectLink(iJPointer javaPointer,
                                          iPointer nativePointer)
Link a java interface with the native peer implementation

Parameters:
javaPointer -
nativePointer -

getNativeObjectS

public static iPointer[] getNativeObjectS(iJPointer javaPointer)
This method return all the native implementation for a java interface.

Parameters:
javaPointer -
Returns:

getNativeObject

public iPointer[] getNativeObject(iJPointer javaPointer)
This method return all the native implementation for a java interface.

Parameters:
javaPointer -
Returns:

getNativeObjectForInterfaceS

public static iPointer getNativeObjectForInterfaceS(iJPointer javaPointer,
                                                    java.lang.Class cClass)
This method return all the native implementation for a java interface.

Parameters:
javaPointer -
Returns:

getNativeObjectForInterface

public iPointer getNativeObjectForInterface(iJPointer javaPointer,
                                            java.lang.Class cClass)
This method return all the native implementation for a java interface.

Parameters:
javaPointer -
Returns:

getFirstNativeObjectS

public static iPointer getFirstNativeObjectS(iJPointer javaPointer)
This method return the first native implementation for a java interface.

Parameters:
javaPointer -
Returns:

getFirstNativeObject

public iPointer getFirstNativeObject(iJPointer javaPointer)
This method return the first native implementation for a java interface.

Parameters:
javaPointer -
Returns:

addNativeObjectS

public static void addNativeObjectS(iPointer pointer)
Add a reference to a newly created native object.

Parameters:
pointer -

addNativeObject

public void addNativeObject(iPointer pointer)
Add a reference to a newly created native object.

Parameters:
pointer -

setAsAvailableS

public static void setAsAvailableS(java.lang.String interfaceName,
                                   iPointer nPointer)
Set the java peer object for the given interface available for reuse.

Parameters:
interfaceName -
nPointer -

setAsAvailable

public void setAsAvailable(java.lang.String interfaceName,
                           iPointer nPointer)
Set the java peer object for the given interface available for reuse.

Parameters:
interfaceName -
nPointer -

destroySCFObjectsS

public static void destroySCFObjectsS()
DecRef all the alive SCF objects


destroySCFObjects

public void destroySCFObjects()
DecRef all the alive SCF objects


getImplS

public static iPointer getImplS(long iInterfaceID,
                                iPointer nPointer)
Return the java peer object corresponding to the given interface.

Parameters:
iInterfaceID -
nPointer -
Returns:
null if not found.

getImpl

public iPointer getImpl(long iInterfaceID,
                        iPointer nPointer)
Return the java peer object corresponding to the given interface.

Parameters:
iInterfaceID -
nPointer -
Returns:
null if not found.

getImplS

public static iPointer getImplS(java.lang.String interfaceName,
                                iPointer nPointer)
Return the java peer object corresponding to the given interface.

Parameters:
interfaceName -
nPointer -
Returns:
null if not found.

getImpl

public iPointer getImpl(java.lang.String interfaceName,
                        iPointer nPointer)
Return the java peer object corresponding to the given interface.

Parameters:
interfaceName -
nPointer -
Returns:
null if not found.

dumpS

public static void dumpS()

dump

public void dump()