Scala Library
|
|
abstract
class
CachedFileStorage(private
file1 : java.io.File)
extends
java.lang.Thread with
LoggedMutable storage of immutable xml trees. Everything is kept in memory, with a thread periodically checking for changes and writing to file. To ensure atomicity, two files are used, filename1 and '$'+filename1. The implementation switches between the two, deleting the older one after a complete dump of the database has been written.
Value Summary | |
protected var
|
dirty
: Boolean
this storage modified since last modification check
|
protected val
|
interval
: Int
period between modification checks, in milliseconds
|
Method Summary | |
abstract def
|
+=
(e : Node) : Unit
adds a node, setting this.dirty to true as a side effect
|
abstract def
|
-=
(e : Node) : Unit
removes a tree, setting this.dirty to true as a side effect
|
def
|
flush
: Unit
forces writing of contents to the file, even if there has not been any update.
|
protected def
|
initialNodes
: Iterator[Node]
finds and loads the storage file. subclasses should call this method
prior to any other, but only once, to obtain the initial sequence of nodes.
|
abstract def
|
nodes
: Iterator[Node]
returns an iterator over the nodes in this storage
|
override def
|
run
: Unit
run method of the thread. remember to use start() to start a thread, not run.
|
Methods inherited from Logged | |
log |
Methods inherited from AnyRef | |
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Value Details |
protected
var
dirty : Boolean
protected
val
interval : Int
Method Details |
override
def
run : Unit
def
flush : Unit
Scala Library
|
|