Class LogState

java.lang.Object
org.objectweb.howl.log.LogState

class LogState extends Object
Manage state variables for the Logger instance.

state variables are saved when logger is closed.

when a logger is open, a lock file is created to record the fact that a logger is active. Whe the logger is closed, the lock file is deleted. If the system or JVM crashes before the logger is closed, the lock file will serve to notify future users of the log that recovery may be necessary.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) File
     
    (package private) Properties
     
    (package private) File
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct LogState instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    loads state variables from property file.
    (package private) void
    make state unavailable whil log is open.
    (package private) void
    saves state variables to property file.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • LogState

      LogState()
      Construct LogState instance.
  • Method Details

    • load

      void load()
      loads state variables from property file.
    • save

      void save()
      saves state variables to property file.
    • lock

      void lock()
      make state unavailable whil log is open.

      Locking the state is accomplished by creating a ".lock" file. Presence of the lock file indicates that an instance of the logger is currently open, or that a previous instance failed to close properly, perhaps due to system or JVM failure.