com.jniwrapper
Class DataBufferFactory

java.lang.Object
  |
  +--com.jniwrapper.DataBufferFactory

public abstract class DataBufferFactory
extends java.lang.Object

Abstract base for factory classes that produce instances of appropriate DataBuffer implementation. The class also implements Singleton pattern and performs initialization of factory instance of required class depending on the JRE version and settings.

See Also:
PROPERTY_UNSAFE

Field Summary
static java.lang.String PROPERTY_SAFEMEM
          If this system property is set JNI Wrapper will perform all native memory accesses using fail-safe native methods that throw java exceptions instead of crashing the JVM on illegal memory accesses.
static java.lang.String PROPERTY_UNSAFE
          If this system property is defined JNI Wrapper will try to access native memory using sun.misc.Unsafe class which usually results in better performance.
 
Constructor Summary
protected DataBufferFactory()
           
 
Method Summary
abstract  MemoryBuffer allocateMemoryBuffer(int length)
           
abstract  DataBuffer createArrayBuffer(byte[] data)
           
abstract  MemoryBuffer createExternMemoryBuffer(long handle, int length)
           
static DataBufferFactory getInstance()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_UNSAFE

public static final java.lang.String PROPERTY_UNSAFE
If this system property is defined JNI Wrapper will try to access native memory using sun.misc.Unsafe class which usually results in better performance.

See Also:
Constant Field Values

PROPERTY_SAFEMEM

public static final java.lang.String PROPERTY_SAFEMEM
If this system property is set JNI Wrapper will perform all native memory accesses using fail-safe native methods that throw java exceptions instead of crashing the JVM on illegal memory accesses.

See Also:
Constant Field Values
Constructor Detail

DataBufferFactory

protected DataBufferFactory()
Method Detail

getInstance

public static DataBufferFactory getInstance()

createArrayBuffer

public abstract DataBuffer createArrayBuffer(byte[] data)

allocateMemoryBuffer

public abstract MemoryBuffer allocateMemoryBuffer(int length)

createExternMemoryBuffer

public abstract MemoryBuffer createExternMemoryBuffer(long handle,
                                                      int length)