com.jniwrapper
Class DataBufferFactory

java.lang.Object
  extended by 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 a 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, JNIWrapper 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, JNIWrapper will try to access native memory using the sun.misc.Unsafe class, which usually results in better performance.
 
Constructor Summary
protected DataBufferFactory()
           
 
Method Summary
abstract  MemoryBuffer allocateMemoryBuffer(int length)
           
abstract  MemoryBuffer allocateParameterBuffer(int length)
           
abstract  DataBuffer createArrayBuffer(byte[] data)
           
abstract  MemoryBuffer createExternMemoryBuffer(long handle, int length)
           
abstract  MemoryBuffer createExternPrarameterBuffer(long handle, int length)
           
abstract  DataBuffer createParameterBuffer(byte[] data)
           
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, JNIWrapper will try to access native memory using the 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, JNIWrapper 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)

createParameterBuffer

public abstract DataBuffer createParameterBuffer(byte[] data)

allocateMemoryBuffer

public abstract MemoryBuffer allocateMemoryBuffer(int length)

allocateParameterBuffer

public abstract MemoryBuffer allocateParameterBuffer(int length)

createExternMemoryBuffer

public abstract MemoryBuffer createExternMemoryBuffer(long handle,
                                                      int length)

createExternPrarameterBuffer

public abstract MemoryBuffer createExternPrarameterBuffer(long handle,
                                                          int length)