org.bridj
Class JNI

java.lang.Object
  extended by org.bridj.JNI

Deprecated. These methods can cause serious issues (segmentation fault, system crashes) if used without care : there are little to no checks performed on the arguments.

@Deprecated
public class JNI
extends Object

Low-level calls to JNI and to BridJ's native library.

Author:
ochafik

Constructor Summary
JNI()
          Deprecated.  
 
Method Summary
static void callSinglePointerArgVoidFunction(long functionPointer, long pointerArg, int callMode)
          Deprecated.  
static void deleteGlobalRef(long reference)
          Deprecated. Delete a global reference created by newGlobalRef(java.lang.Object)
static void deleteWeakGlobalRef(long reference)
          Deprecated. Delete a weak global reference created by newWeakGlobalRef(java.lang.Object)
static long getDirectBufferAddress(Buffer b)
          Deprecated. Get the native address pointed to by a direct buffer.
static long getDirectBufferCapacity(Buffer b)
          Deprecated. Get the capacity in bytes of a direct buffer.
static long getEnv()
          Deprecated. 
static Pointer<?> getGlobalPointer(Object object)
          Deprecated.  
static long getJVM()
          Deprecated. 
static ByteBuffer newDirectByteBuffer(long address, long capacity)
          Deprecated. Wrap a native address as a direct byte buffer of the specified byte capacity.
static long newGlobalRef(Object object)
          Deprecated. Create a JNI global reference to a Java object : long value that can be safely passed to C programs and stored, which prevent the object from being garbage-collected and which validity runs until deleteGlobalRef(long) is called
static long newWeakGlobalRef(Object object)
          Deprecated. Create a JNI weak global reference to a Java object : long value that can be safely passed to C programs and stored, which validity runs until deleteWeakGlobalRef(long) is called.
static Object refToObject(long refPeer)
          Deprecated. 
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JNI

public JNI()
Deprecated. 
Method Detail

getEnv

@Deprecated
public static long getEnv()
Deprecated. 


getJVM

@Deprecated
public static long getJVM()
Deprecated. 


refToObject

@Deprecated
public static Object refToObject(long refPeer)
Deprecated. 


newGlobalRef

public static long newGlobalRef(Object object)
Deprecated. 
Create a JNI global reference to a Java object : long value that can be safely passed to C programs and stored, which prevent the object from being garbage-collected and which validity runs until deleteGlobalRef(long) is called


deleteGlobalRef

public static void deleteGlobalRef(long reference)
Deprecated. 
Delete a global reference created by newGlobalRef(java.lang.Object)


getGlobalPointer

public static Pointer<?> getGlobalPointer(Object object)
Deprecated. 

newWeakGlobalRef

public static long newWeakGlobalRef(Object object)
Deprecated. 
Create a JNI weak global reference to a Java object : long value that can be safely passed to C programs and stored, which validity runs until deleteWeakGlobalRef(long) is called.
Unlike global references, weak global references don't prevent objects from being garbage-collected.


deleteWeakGlobalRef

public static void deleteWeakGlobalRef(long reference)
Deprecated. 
Delete a weak global reference created by newWeakGlobalRef(java.lang.Object)


newDirectByteBuffer

public static ByteBuffer newDirectByteBuffer(long address,
                                             long capacity)
Deprecated. 
Wrap a native address as a direct byte buffer of the specified byte capacity.
Memory is not reclaimed when the buffer is garbage-collected.


getDirectBufferAddress

public static long getDirectBufferAddress(Buffer b)
Deprecated. 
Get the native address pointed to by a direct buffer.


getDirectBufferCapacity

public static long getDirectBufferCapacity(Buffer b)
Deprecated. 
Get the capacity in bytes of a direct buffer.


callSinglePointerArgVoidFunction

public static void callSinglePointerArgVoidFunction(long functionPointer,
                                                    long pointerArg,
                                                    int callMode)
Deprecated. 


Copyright © 2009-2012. All Rights Reserved.