|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Stateful
A Stateful object uses member variables to store state
information during method calls. Thus, concurrently invoking the object's
method is not possible, synchronization or locking is necessary. A stateful
object is similar to a cloneable object, only that creating a copy here
is for reading only, and a read/write lock is available (the write lock is
held when copying).
If synchronization implemented with a read/write lock,
a copy of the state is needed for read concurrent readers. Such a read copy
of the state can be created by calling createReadCopy(ReadWriteLock).
| Method Summary | |
|---|---|
Object |
createReadCopy(ReadWriteLock lock)
Returns a read copy of this stateful object. |
| Method Detail |
|---|
Object createReadCopy(ReadWriteLock lock)
throws IOException
The submitted read/write lock can be used later on e.g. for lazy opening of additional files. When this method is invoked, the write lock of the submitted read/write lock is held.
lock - A read/write lock, the write lock is held. The lock,
however, might also be used for other functionality of the
returned read copy, for instance, if the read copy has to
be put in sync with the main object.
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||