TrueZIP Kernel 7.0-rc1

de.schlichtherle.truezip.fs
Class FsConcurrentModel

java.lang.Object
  extended by de.schlichtherle.truezip.fs.FsModel
      extended by de.schlichtherle.truezip.fs.FsConcurrentModel

@ThreadSafe
@DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class)
public class FsConcurrentModel
extends FsModel

Supports multiple concurrent reader threads.

Author:
Christian Schlichtherle
See Also:
FsConcurrentController

Field Summary
private  ReentrantReadWriteLock lock
           
 
Constructor Summary
FsConcurrentModel(FsMountPoint mountPoint)
           
FsConcurrentModel(FsMountPoint mountPoint, FsModel parent)
           
 
Method Summary
 void assertNotReadLockedByCurrentThread(FsNotWriteLockedException ex)
           
 void assertWriteLockedByCurrentThread()
           
 ReentrantReadWriteLock.ReadLock readLock()
           
 ReentrantReadWriteLock.WriteLock writeLock()
           
 
Methods inherited from class de.schlichtherle.truezip.fs.FsModel
addFileSystemTouchedListener, equals, getFileSystemTouchedListeners, getMountPoint, getParent, hashCode, isTouched, removeFileSystemTouchedListener, setTouched, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

lock

private final ReentrantReadWriteLock lock
Constructor Detail

FsConcurrentModel

public FsConcurrentModel(FsMountPoint mountPoint)

FsConcurrentModel

public FsConcurrentModel(FsMountPoint mountPoint,
                         @CheckForNull
                         FsModel parent)
Method Detail

readLock

public final ReentrantReadWriteLock.ReadLock readLock()

writeLock

public final ReentrantReadWriteLock.WriteLock writeLock()

assertWriteLockedByCurrentThread

public final void assertWriteLockedByCurrentThread()
                                            throws FsNotWriteLockedException
Throws:
FsNotWriteLockedException - if the write lock is not held by the current thread.

assertNotReadLockedByCurrentThread

public final void assertNotReadLockedByCurrentThread(FsNotWriteLockedException ex)
                                              throws FsNotWriteLockedException
Throws:
FsNotWriteLockedException - if the read lock is held by the current thread.

TrueZIP Kernel 7.0-rc1

Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.