com.atomikos.persistence.imp
Class StreamObjectLog

java.lang.Object
  extended by com.atomikos.persistence.imp.AbstractObjectLog
      extended by com.atomikos.persistence.imp.StreamObjectLog
All Implemented Interfaces:
ObjectLog

public class StreamObjectLog
extends AbstractObjectLog
implements ObjectLog


Constructor Summary
StreamObjectLog(LogStream logstream, long maxFlushesBetweenCheckpoints)
           
 
Method Summary
 void close()
          Closes the log after use.
 void delete(Object id)
          Deletes the given object from the log.
 void flush(Recoverable rec)
          Flushes to permanent memory.
 void flush(SystemLogImage img, boolean shouldSync)
           
 void init()
          Initializes the object log.
 Vector recover()
          Recovers all non-deleted object images flushed so far.
 Recoverable recover(Object id)
          Recovers the instance with given ID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamObjectLog

public StreamObjectLog(LogStream logstream,
                       long maxFlushesBetweenCheckpoints)
Method Detail

init

public void init()
          throws LogException
Description copied from interface: ObjectLog
Initializes the object log. To be called as the first method.

Specified by:
init in interface ObjectLog
Throws:
LogException - If error occurs.
See Also:
ObjectLog

recover

public Vector recover()
               throws LogException
Description copied from interface: ObjectLog
Recovers all non-deleted object images flushed so far.

Specified by:
recover in interface ObjectLog
Returns:
Vector A list of Recoverable instances, reconstructed from their images.
Throws:
LogException
See Also:
ObjectLog

flush

public void flush(Recoverable rec)
           throws LogException
Description copied from interface: ObjectLog
Flushes to permanent memory.

Specified by:
flush in interface ObjectLog
Parameters:
rec - Recoverable instance. NOTE: if the instance has the same ObjectId as a previous one, then the latter will be overridden by this one! More precisely, history() will only return the last image for a given ObjectId.
Throws:
LogException - if it did not work.
See Also:
ObjectLog

flush

public void flush(SystemLogImage img,
                  boolean shouldSync)
           throws LogException
Specified by:
flush in class AbstractObjectLog
Throws:
LogException

recover

public Recoverable recover(Object id)
                    throws LogException
Description copied from interface: ObjectLog
Recovers the instance with given ID.

Specified by:
recover in interface ObjectLog
Parameters:
id - The id to recover. @return Recoverable The recovered logimage, null if not found. @exception LogException On failure.
Throws:
LogException
See Also:
ObjectLog

delete

public void delete(Object id)
            throws LogException
Description copied from interface: ObjectLog
Deletes the given object from the log.

Specified by:
delete in interface ObjectLog
Parameters:
id - The object UID.
Throws:
LogException - on failure.
See Also:
ObjectLog

close

public void close()
           throws LogException
Description copied from interface: ObjectLog
Closes the log after use.

Specified by:
close in interface ObjectLog
Throws:
LogException - on failure.
See Also:
ObjectLog


Copyright © 2014. All Rights Reserved.