de.grogra.persistence
Class Transaction

java.lang.Object
  extended by java.io.OutputStream
      extended by de.grogra.util.OutputQueue
          extended by de.grogra.util.HierarchicalQueue
              extended by de.grogra.persistence.XAQueue
                  extended by de.grogra.persistence.Transaction
All Implemented Interfaces:
PersistenceOutput, java.io.Closeable, java.io.DataOutput, java.io.Flushable, java.io.ObjectOutput
Direct Known Subclasses:
GraphTransaction

public abstract class Transaction
extends XAQueue


Nested Class Summary
static interface Transaction.Consumer
           
static class Transaction.Data
           
static interface Transaction.ExtendedConsumer
           
static class Transaction.Key
           
 class Transaction.Reader
           
 
Nested classes/interfaces inherited from class de.grogra.util.HierarchicalQueue
HierarchicalQueue.Cursor
 
Field Summary
static int INSERT_BOOLEAN
           
static int INSERT_BYTE
           
static int INSERT_CHAR
           
static int INSERT_DOUBLE
           
static int INSERT_FLOAT
           
static int INSERT_INT
           
static int INSERT_LONG
           
static int INSERT_OBJECT
           
static int INSERT_SHORT
           
static int MAKE_PERSISTENT
           
static int MAKE_TRANSIENT
           
static int MIN_UNUSED_ITEM
           
static int READ_DATA
           
static int REMOVE_BOOLEAN
           
static int REMOVE_BYTE
           
static int REMOVE_CHAR
           
static int REMOVE_DOUBLE
           
static int REMOVE_FLOAT
           
static int REMOVE_INT
           
static int REMOVE_LONG
           
static int REMOVE_OBJECT
           
static int REMOVE_SHORT
           
static int SET_BOOLEAN
           
static int SET_BYTE
           
static int SET_CHAR
           
static int SET_DOUBLE
           
static int SET_FLOAT
           
static int SET_INT
           
static int SET_LONG
           
static int SET_OBJECT
           
static int SET_SHORT
           
static int UNDO_TRANSACTION
           
 
Fields inherited from class de.grogra.persistence.XAQueue
cache, manager
 
Fields inherited from class de.grogra.util.HierarchicalQueue
BEGIN_LEVEL, IS_FINISHED, ITEM_AND_BITS_MASK, ITEM_MASK, MAX_UNUSED_BIT, MIN_UNUSED_BIT, NEXT_EXISTS, out
 
Constructor Summary
protected Transaction(PersistenceManager manager, java.lang.Thread thread)
           
 
Method Summary
 void begin(boolean readOnly)
           
 void beginApply()
           
 void close()
           
 void commit()
           
 void commitAll()
           
protected  Transaction.Data createData()
           
abstract  Transaction.Reader createReader()
           
 void endApply()
           
 void finishSet()
           
 void finishSet(XAQueue.Reader reader)
           
 void fireSharedObjectModified(Shareable object)
           
 int getActiveCount()
           
 long getId()
           
 Transaction.Key getKey()
           
 long getUserId()
           
 boolean hasModified()
           
 boolean isActive()
           
static boolean isApplying(Transaction t)
           
protected  boolean isLoggingSuppressed()
           
 boolean isModified(java.lang.Object object, PersistenceField field, int[] indices)
           
static boolean isNotApplying(Transaction t)
           
 void logInsertBoolean(PersistenceCapable o, PersistenceField field, int[] indices, boolean newValue)
           
 void logInsertByte(PersistenceCapable o, PersistenceField field, int[] indices, byte newValue)
           
 void logInsertChar(PersistenceCapable o, PersistenceField field, int[] indices, char newValue)
           
 void logInsertDouble(PersistenceCapable o, PersistenceField field, int[] indices, double newValue)
           
 void logInsertFloat(PersistenceCapable o, PersistenceField field, int[] indices, float newValue)
           
 void logInsertInt(PersistenceCapable o, PersistenceField field, int[] indices, int newValue)
           
 void logInsertLong(PersistenceCapable o, PersistenceField field, int[] indices, long newValue)
           
 void logInsertObject(PersistenceCapable o, PersistenceField field, int[] indices, java.lang.Object newValue)
           
 void logInsertShort(PersistenceCapable o, PersistenceField field, int[] indices, short newValue)
           
 void logMakePersistent(PersistenceCapable o)
           
 void logMakeTransient(PersistenceCapable o)
           
 void logReadData(PersistenceCapable o, boolean onRollback)
           
 void logRemoveBoolean(PersistenceCapable o, PersistenceField field, int[] indices, boolean oldValue)
           
 void logRemoveByte(PersistenceCapable o, PersistenceField field, int[] indices, byte oldValue)
           
 void logRemoveChar(PersistenceCapable o, PersistenceField field, int[] indices, char oldValue)
           
 void logRemoveDouble(PersistenceCapable o, PersistenceField field, int[] indices, double oldValue)
           
 void logRemoveFloat(PersistenceCapable o, PersistenceField field, int[] indices, float oldValue)
           
 void logRemoveInt(PersistenceCapable o, PersistenceField field, int[] indices, int oldValue)
           
 void logRemoveLong(PersistenceCapable o, PersistenceField field, int[] indices, long oldValue)
           
 void logRemoveObject(PersistenceCapable o, PersistenceField field, int[] indices, java.lang.Object oldValue)
           
 void logRemoveShort(PersistenceCapable o, PersistenceField field, int[] indices, short oldValue)
           
 void logSetBoolean(PersistenceCapable o, PersistenceField field, int[] indices, boolean oldValue, boolean newValue)
           
 void logSetByte(PersistenceCapable o, PersistenceField field, int[] indices, byte oldValue, byte newValue)
           
 void logSetChar(PersistenceCapable o, PersistenceField field, int[] indices, char oldValue, char newValue)
           
 void logSetDouble(PersistenceCapable o, PersistenceField field, int[] indices, double oldValue, double newValue)
           
 void logSetFloat(PersistenceCapable o, PersistenceField field, int[] indices, float oldValue, float newValue)
           
 void logSetInt(PersistenceCapable o, PersistenceField field, int[] indices, int oldValue, int newValue)
           
 void logSetLong(PersistenceCapable o, PersistenceField field, int[] indices, long oldValue, long newValue)
           
 void logSetObject(PersistenceCapable o, PersistenceField field, int[] indices, java.lang.Object oldValue, java.lang.Object newValue)
           
 void logSetShort(PersistenceCapable o, PersistenceField field, int[] indices, short oldValue, short newValue)
           
 void logUndo(Transaction t)
           
 Transaction makeActive()
           
 void markModified(java.lang.Object object, PersistenceField field, int[] indices)
           
 void prepareLogSetBoolean(PersistenceCapable o, PersistenceField field, int[] indices, boolean oldValue)
           
 void prepareLogSetByte(PersistenceCapable o, PersistenceField field, int[] indices, byte oldValue)
           
 void prepareLogSetChar(PersistenceCapable o, PersistenceField field, int[] indices, char oldValue)
           
 void prepareLogSetDouble(PersistenceCapable o, PersistenceField field, int[] indices, double oldValue)
           
 void prepareLogSetFloat(PersistenceCapable o, PersistenceField field, int[] indices, float oldValue)
           
 void prepareLogSetInt(PersistenceCapable o, PersistenceField field, int[] indices, int oldValue)
           
 void prepareLogSetLong(PersistenceCapable o, PersistenceField field, int[] indices, long oldValue)
           
 void prepareLogSetObject(PersistenceCapable o, PersistenceField field, int[] indices, java.lang.Object oldValue)
           
 void prepareLogSetShort(PersistenceCapable o, PersistenceField field, int[] indices, short oldValue)
           
 void prepareSetBoolean(PersistenceCapable pc, PersistenceField field, int[] indices)
           
 void prepareSetByte(PersistenceCapable pc, PersistenceField field, int[] indices)
           
 void prepareSetChar(PersistenceCapable pc, PersistenceField field, int[] indices)
           
 void prepareSetDouble(PersistenceCapable pc, PersistenceField field, int[] indices)
           
 void prepareSetFloat(PersistenceCapable pc, PersistenceField field, int[] indices)
           
 void prepareSetInt(PersistenceCapable pc, PersistenceField field, int[] indices)
           
 void prepareSetLong(PersistenceCapable pc, PersistenceField field, int[] indices)
           
 void prepareSetObject(PersistenceCapable pc, PersistenceField field, int[] indices)
           
 void prepareSetShort(PersistenceCapable pc, PersistenceField field, int[] indices)
           
 void restore(HierarchicalQueue.Data data)
           
 void rollback()
           
 void rollbackAll()
           
protected  void setModified()
           
 void setReadOnly()
           
 void setUserId(long userId)
           
 void unmarkModified()
           
 
Methods inherited from class de.grogra.persistence.XAQueue
beginArray, beginField, beginFields, beginManaged, clear, endArray, endField, endFields, endManaged, getPersistenceManager, setNested, writeComponentSeparator, writeName, writeNullObject, writeObject, writePersistentObjectReference, writeSharedObjectReference, writeString, writeStringObject
 
Methods inherited from class de.grogra.util.HierarchicalQueue
beginLevel, beginSkipBlock, cloneData, discardLevel, endLevel, endSkipBlock, getCursor, getData, hasItems, hasItemsInCurrentLevel, moveTo, setItemSize, writeItem, writeObject, writeObjectInStream
 
Methods inherited from class de.grogra.util.OutputQueue
dump, flush, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeObjectInQueue, writeShort, writeUTF
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.grogra.persistence.PersistenceOutput
writeBoolean, writeByte, writeChar, writeDouble, writeFloat, writeInt, writeLong, writeShort
 
Methods inherited from interface java.io.ObjectOutput
flush, write, write, write
 
Methods inherited from interface java.io.DataOutput
writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
 

Field Detail

INSERT_BOOLEAN

public static final int INSERT_BOOLEAN
See Also:
Constant Field Values

INSERT_BYTE

public static final int INSERT_BYTE
See Also:
Constant Field Values

INSERT_CHAR

public static final int INSERT_CHAR
See Also:
Constant Field Values

INSERT_DOUBLE

public static final int INSERT_DOUBLE
See Also:
Constant Field Values

INSERT_FLOAT

public static final int INSERT_FLOAT
See Also:
Constant Field Values

INSERT_INT

public static final int INSERT_INT
See Also:
Constant Field Values

INSERT_LONG

public static final int INSERT_LONG
See Also:
Constant Field Values

INSERT_OBJECT

public static final int INSERT_OBJECT
See Also:
Constant Field Values

INSERT_SHORT

public static final int INSERT_SHORT
See Also:
Constant Field Values

MAKE_PERSISTENT

public static final int MAKE_PERSISTENT
See Also:
Constant Field Values

MAKE_TRANSIENT

public static final int MAKE_TRANSIENT
See Also:
Constant Field Values

MIN_UNUSED_ITEM

public static final int MIN_UNUSED_ITEM
See Also:
Constant Field Values

READ_DATA

public static final int READ_DATA
See Also:
Constant Field Values

REMOVE_BOOLEAN

public static final int REMOVE_BOOLEAN
See Also:
Constant Field Values

REMOVE_BYTE

public static final int REMOVE_BYTE
See Also:
Constant Field Values

REMOVE_CHAR

public static final int REMOVE_CHAR
See Also:
Constant Field Values

REMOVE_DOUBLE

public static final int REMOVE_DOUBLE
See Also:
Constant Field Values

REMOVE_FLOAT

public static final int REMOVE_FLOAT
See Also:
Constant Field Values

REMOVE_INT

public static final int REMOVE_INT
See Also:
Constant Field Values

REMOVE_LONG

public static final int REMOVE_LONG
See Also:
Constant Field Values

REMOVE_OBJECT

public static final int REMOVE_OBJECT
See Also:
Constant Field Values

REMOVE_SHORT

public static final int REMOVE_SHORT
See Also:
Constant Field Values

SET_BOOLEAN

public static final int SET_BOOLEAN
See Also:
Constant Field Values

SET_BYTE

public static final int SET_BYTE
See Also:
Constant Field Values

SET_CHAR

public static final int SET_CHAR
See Also:
Constant Field Values

SET_DOUBLE

public static final int SET_DOUBLE
See Also:
Constant Field Values

SET_FLOAT

public static final int SET_FLOAT
See Also:
Constant Field Values

SET_INT

public static final int SET_INT
See Also:
Constant Field Values

SET_LONG

public static final int SET_LONG
See Also:
Constant Field Values

SET_OBJECT

public static final int SET_OBJECT
See Also:
Constant Field Values

SET_SHORT

public static final int SET_SHORT
See Also:
Constant Field Values

UNDO_TRANSACTION

public static final int UNDO_TRANSACTION
See Also:
Constant Field Values
Constructor Detail

Transaction

protected Transaction(PersistenceManager manager,
                      java.lang.Thread thread)
Method Detail

begin

public void begin(boolean readOnly)

beginApply

public void beginApply()

close

public void close()
Specified by:
close in interface java.io.Closeable
Specified by:
close in interface java.io.ObjectOutput
Overrides:
close in class OutputQueue

commit

public void commit()

commitAll

public final void commitAll()

createData

protected Transaction.Data createData()
Overrides:
createData in class XAQueue

createReader

public abstract Transaction.Reader createReader()

endApply

public void endApply()

finishSet

public void finishSet()

finishSet

public void finishSet(XAQueue.Reader reader)

fireSharedObjectModified

public void fireSharedObjectModified(Shareable object)

getActiveCount

public int getActiveCount()

getId

public final long getId()

getKey

public final Transaction.Key getKey()

getUserId

public final long getUserId()

hasModified

public boolean hasModified()

isActive

public boolean isActive()

isApplying

public static boolean isApplying(Transaction t)

isLoggingSuppressed

protected boolean isLoggingSuppressed()

isModified

public boolean isModified(java.lang.Object object,
                          PersistenceField field,
                          int[] indices)

isNotApplying

public static boolean isNotApplying(Transaction t)

logInsertBoolean

public void logInsertBoolean(PersistenceCapable o,
                             PersistenceField field,
                             int[] indices,
                             boolean newValue)

logInsertByte

public void logInsertByte(PersistenceCapable o,
                          PersistenceField field,
                          int[] indices,
                          byte newValue)

logInsertChar

public void logInsertChar(PersistenceCapable o,
                          PersistenceField field,
                          int[] indices,
                          char newValue)

logInsertDouble

public void logInsertDouble(PersistenceCapable o,
                            PersistenceField field,
                            int[] indices,
                            double newValue)

logInsertFloat

public void logInsertFloat(PersistenceCapable o,
                           PersistenceField field,
                           int[] indices,
                           float newValue)

logInsertInt

public void logInsertInt(PersistenceCapable o,
                         PersistenceField field,
                         int[] indices,
                         int newValue)

logInsertLong

public void logInsertLong(PersistenceCapable o,
                          PersistenceField field,
                          int[] indices,
                          long newValue)

logInsertObject

public void logInsertObject(PersistenceCapable o,
                            PersistenceField field,
                            int[] indices,
                            java.lang.Object newValue)

logInsertShort

public void logInsertShort(PersistenceCapable o,
                           PersistenceField field,
                           int[] indices,
                           short newValue)

logMakePersistent

public void logMakePersistent(PersistenceCapable o)

logMakeTransient

public void logMakeTransient(PersistenceCapable o)

logReadData

public void logReadData(PersistenceCapable o,
                        boolean onRollback)

logRemoveBoolean

public void logRemoveBoolean(PersistenceCapable o,
                             PersistenceField field,
                             int[] indices,
                             boolean oldValue)

logRemoveByte

public void logRemoveByte(PersistenceCapable o,
                          PersistenceField field,
                          int[] indices,
                          byte oldValue)

logRemoveChar

public void logRemoveChar(PersistenceCapable o,
                          PersistenceField field,
                          int[] indices,
                          char oldValue)

logRemoveDouble

public void logRemoveDouble(PersistenceCapable o,
                            PersistenceField field,
                            int[] indices,
                            double oldValue)

logRemoveFloat

public void logRemoveFloat(PersistenceCapable o,
                           PersistenceField field,
                           int[] indices,
                           float oldValue)

logRemoveInt

public void logRemoveInt(PersistenceCapable o,
                         PersistenceField field,
                         int[] indices,
                         int oldValue)

logRemoveLong

public void logRemoveLong(PersistenceCapable o,
                          PersistenceField field,
                          int[] indices,
                          long oldValue)

logRemoveObject

public void logRemoveObject(PersistenceCapable o,
                            PersistenceField field,
                            int[] indices,
                            java.lang.Object oldValue)

logRemoveShort

public void logRemoveShort(PersistenceCapable o,
                           PersistenceField field,
                           int[] indices,
                           short oldValue)

logSetBoolean

public void logSetBoolean(PersistenceCapable o,
                          PersistenceField field,
                          int[] indices,
                          boolean oldValue,
                          boolean newValue)

logSetByte

public void logSetByte(PersistenceCapable o,
                       PersistenceField field,
                       int[] indices,
                       byte oldValue,
                       byte newValue)

logSetChar

public void logSetChar(PersistenceCapable o,
                       PersistenceField field,
                       int[] indices,
                       char oldValue,
                       char newValue)

logSetDouble

public void logSetDouble(PersistenceCapable o,
                         PersistenceField field,
                         int[] indices,
                         double oldValue,
                         double newValue)

logSetFloat

public void logSetFloat(PersistenceCapable o,
                        PersistenceField field,
                        int[] indices,
                        float oldValue,
                        float newValue)

logSetInt

public void logSetInt(PersistenceCapable o,
                      PersistenceField field,
                      int[] indices,
                      int oldValue,
                      int newValue)

logSetLong

public void logSetLong(PersistenceCapable o,
                       PersistenceField field,
                       int[] indices,
                       long oldValue,
                       long newValue)

logSetObject

public void logSetObject(PersistenceCapable o,
                         PersistenceField field,
                         int[] indices,
                         java.lang.Object oldValue,
                         java.lang.Object newValue)

logSetShort

public void logSetShort(PersistenceCapable o,
                        PersistenceField field,
                        int[] indices,
                        short oldValue,
                        short newValue)

logUndo

public void logUndo(Transaction t)

makeActive

public Transaction makeActive()

markModified

public void markModified(java.lang.Object object,
                         PersistenceField field,
                         int[] indices)

prepareLogSetBoolean

public void prepareLogSetBoolean(PersistenceCapable o,
                                 PersistenceField field,
                                 int[] indices,
                                 boolean oldValue)

prepareLogSetByte

public void prepareLogSetByte(PersistenceCapable o,
                              PersistenceField field,
                              int[] indices,
                              byte oldValue)

prepareLogSetChar

public void prepareLogSetChar(PersistenceCapable o,
                              PersistenceField field,
                              int[] indices,
                              char oldValue)

prepareLogSetDouble

public void prepareLogSetDouble(PersistenceCapable o,
                                PersistenceField field,
                                int[] indices,
                                double oldValue)

prepareLogSetFloat

public void prepareLogSetFloat(PersistenceCapable o,
                               PersistenceField field,
                               int[] indices,
                               float oldValue)

prepareLogSetInt

public void prepareLogSetInt(PersistenceCapable o,
                             PersistenceField field,
                             int[] indices,
                             int oldValue)

prepareLogSetLong

public void prepareLogSetLong(PersistenceCapable o,
                              PersistenceField field,
                              int[] indices,
                              long oldValue)

prepareLogSetObject

public void prepareLogSetObject(PersistenceCapable o,
                                PersistenceField field,
                                int[] indices,
                                java.lang.Object oldValue)

prepareLogSetShort

public void prepareLogSetShort(PersistenceCapable o,
                               PersistenceField field,
                               int[] indices,
                               short oldValue)

prepareSetBoolean

public void prepareSetBoolean(PersistenceCapable pc,
                              PersistenceField field,
                              int[] indices)

prepareSetByte

public void prepareSetByte(PersistenceCapable pc,
                           PersistenceField field,
                           int[] indices)

prepareSetChar

public void prepareSetChar(PersistenceCapable pc,
                           PersistenceField field,
                           int[] indices)

prepareSetDouble

public void prepareSetDouble(PersistenceCapable pc,
                             PersistenceField field,
                             int[] indices)

prepareSetFloat

public void prepareSetFloat(PersistenceCapable pc,
                            PersistenceField field,
                            int[] indices)

prepareSetInt

public void prepareSetInt(PersistenceCapable pc,
                          PersistenceField field,
                          int[] indices)

prepareSetLong

public void prepareSetLong(PersistenceCapable pc,
                           PersistenceField field,
                           int[] indices)

prepareSetObject

public void prepareSetObject(PersistenceCapable pc,
                             PersistenceField field,
                             int[] indices)

prepareSetShort

public void prepareSetShort(PersistenceCapable pc,
                            PersistenceField field,
                            int[] indices)

restore

public void restore(HierarchicalQueue.Data data)
Overrides:
restore in class HierarchicalQueue

rollback

public void rollback()

rollbackAll

public final void rollbackAll()

setModified

protected void setModified()

setReadOnly

public final void setReadOnly()

setUserId

public final void setUserId(long userId)

unmarkModified

public void unmarkModified()