fr.dyade.aaa.util
Class NTransaction.LogFile

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.ByteArrayOutputStream
          extended by fr.dyade.aaa.util.NTransaction.LogFile
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable
Enclosing class:
NTransaction

static final class NTransaction.LogFile
extends java.io.ByteArrayOutputStream


Field Summary
(package private)  int commitCount
          Number of commit operation since starting up.
(package private)  int current
          Current file pointer in log
private static byte[] emptyUTFString
           
(package private)  int garbageCount
          Number of garbage operation since starting up.
(package private)  long garbageTime
          Cumulated time of garbage operations since starting up.
(package private)  long garbageTimeOut
          Maximum delay between 2 garbages.
(package private)  long lastGarbageTime
          Date of last garbage.
private  java.io.File lockFile
          Coherence lock file
private static java.lang.String LockPathname
          Coherence lock filename
(package private)  java.util.Hashtable log
          Log of all operations already committed but not reported on disk.
(package private)  java.io.RandomAccessFile logFile
          log file
(package private)  int logMemorySize
           
private  Repository repository
           
 
Fields inherited from class java.io.ByteArrayOutputStream
buf, count
 
Constructor Summary
NTransaction.LogFile(java.io.File dir, Repository repository)
           
 
Method Summary
(package private)  void commit(java.util.Hashtable ctxlog)
          Reports all buffered operations in logs.
private  void garbage()
          Reports all logged operations on disk.
(package private)  int getLogFileSize()
          Returns the size of disk log in bytes.
(package private)  void stop()
           
(package private)  void writeInt(int v)
           
(package private)  void writeUTF(java.lang.String str)
           
 
Methods inherited from class java.io.ByteArrayOutputStream
close, reset, size, toByteArray, toString, toString, toString, write, write, writeTo
 
Methods inherited from class java.io.OutputStream
flush, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

java.util.Hashtable log
Log of all operations already committed but not reported on disk.


logFile

java.io.RandomAccessFile logFile
log file


current

int current
Current file pointer in log


commitCount

int commitCount
Number of commit operation since starting up.


garbageCount

int garbageCount
Number of garbage operation since starting up.


garbageTime

long garbageTime
Cumulated time of garbage operations since starting up.


lastGarbageTime

long lastGarbageTime
Date of last garbage.


garbageTimeOut

long garbageTimeOut
Maximum delay between 2 garbages.


LockPathname

private static final java.lang.String LockPathname
Coherence lock filename

See Also:
Constant Field Values

lockFile

private java.io.File lockFile
Coherence lock file


repository

private Repository repository

emptyUTFString

private static final byte[] emptyUTFString

logMemorySize

int logMemorySize
Constructor Detail

NTransaction.LogFile

NTransaction.LogFile(java.io.File dir,
                     Repository repository)
               throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getLogFileSize

int getLogFileSize()
Returns the size of disk log in bytes.

Returns:
The size of disk log in bytes.

writeUTF

void writeUTF(java.lang.String str)

writeInt

void writeInt(int v)

commit

void commit(java.util.Hashtable ctxlog)
      throws java.io.IOException
Reports all buffered operations in logs.

Throws:
java.io.IOException

garbage

private final void garbage()
                    throws java.io.IOException
Reports all logged operations on disk.

Throws:
java.io.IOException

stop

void stop()


Copyright © 2010 ScalAgent D.T.. All Rights Reserved.