org.postgresql.pljava.internal
Class NativeStruct

java.lang.Object
  extended by org.postgresql.pljava.internal.NativeStruct
Direct Known Subclasses:
ErrorData, ExecutionPlan, HeapTupleHeader, LargeObject, Portal, Relation, Savepoint, SPI, SPITupleTable, TriggerData, Tuple, TupleDesc, TupleTable, TupleTableSlot, TypeMap

public abstract class NativeStruct
extends java.lang.Object

The NativeStruct maintains a pointer to a piece of memory allocated with a life cycle that spans a call from the PostgreSQL function manager (using palloc()). Since Java uses a garbage collector and since an object in the Java domain might survive longer than memory allocated using palloc(), some code must assert that pointers from Java objects to such memory is cleared when the function manager call ends. This code resides in the JNI part of the Pl/Java package.


Constructor Summary
NativeStruct()
           
 
Method Summary
protected  long getNative()
           
 void invalidate()
          Invalidates this structure and frees up memory allocated for this structure (if any).
 boolean isValid()
          Returns true if native structure pointer is still valid.
protected  void releasePointer()
          Invalidates this structure without freeing up memory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NativeStruct

public NativeStruct()
Method Detail

isValid

public boolean isValid()
Returns true if native structure pointer is still valid.


invalidate

public void invalidate()
Invalidates this structure and frees up memory allocated for this structure (if any).


getNative

protected final long getNative()

releasePointer

protected void releasePointer()
Invalidates this structure without freeing up memory.



Copyright (c) 2003, 2004, 2005 TADA AB - Taby Sweden. Distributed under the terms shown in COPYRIGHT