Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.atomikos.persistence
Interface LogStream

All Known Implementing Classes:
  FileLogStream

    public interface LogStream

The LogStream interface is an abstract definition of a stream that encapsulates a physical log. In contrast to a regular input or output stream, a log stream has both input and output facilities to the same underlying log. It also allows for checkpointing, but the client is responsible for determining the checkpoint contents. Checkpointing allows the log stream to decrease in size.

Method Summary
`void` | `close()` For proper termination: a close method.
`void` | `flushObject(Object objectToFlush, boolean shouldSync)` Flush (force) an object to the stream.
`long` | `getSize()` Get the size of the stream.
`Vector` | `recover()` Reads the log contents, and initializes the data structure.
`void` | `writeCheckpoint(Enumeration elements)` After intial recovery, it is good practice to write a checkpoint with only the most recent data.

Method Detail

### getSize

    long getSize()
                 throws LogException

  Get the size of the stream.

  Returns:
    long The size of the stream.
  Throws:
    `LogException` - On error.

### recover

    Vector recover()
                   throws LogException

  Reads the log contents, and initializes the data structure. Should be called first.

  Returns:
    Vector The read objects from the log.
  Throws:
    `LogException` - On failure.

### writeCheckpoint

    void writeCheckpoint(Enumeration elements)
                         throws LogException

  After intial recovery, it is good practice to write a checkpoint with only the most recent data. This method does that, and can also be called at random intervals during normal operation.

  Parameters:
    `elements` - The elements to keep in the log.
  Throws:
    `LogException` - On failure.

### flushObject

    void flushObject(Object objectToFlush,
                     boolean shouldSync)
                     throws LogException

  Flush (force) an object to the stream. If this method returns then the object is guaranteed to be persisted.

  Throws:
    `LogException` - On failure.

### close

    void close()
               throws LogException

  For proper termination: a close method.

  Throws:
    `LogException` - On failure.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2012. All Rights Reserved.