|
TrueZIP Kernel 7.0-rc2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.schlichtherle.truezip.fs.FsController<M>
de.schlichtherle.truezip.fs.FsDecoratingController<FsConcurrentModel,FsController<? extends FsConcurrentModel>>
de.schlichtherle.truezip.fs.FsCachingController
@NotThreadSafe @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public final class FsCachingController
A content caching file system controller implements a combined caching and buffering strategy for entry data. Decorating a concurrent file system controller with this class has the following effects:
input socket with the input option
FsInputOption.CACHE or the method
output socket with the output option
FsOutputOption.CACHE.
synced.
synced - this is a
write back strategy.
| Nested Class Summary | |
|---|---|
private static class |
FsCachingController.CacheEntry
A proxy entry for hiding socket connections. |
private class |
FsCachingController.EntryCache
A cache for the contents of an individual file system entry. |
private class |
FsCachingController.Input
|
private class |
FsCachingController.Output
|
| Field Summary | |
|---|---|
private Map<FsEntryName,FsCachingController.EntryCache> |
caches
|
private IOPool<?> |
pool
|
private static IOCache.Strategy |
STRATEGY
|
| Fields inherited from class de.schlichtherle.truezip.fs.FsDecoratingController |
|---|
delegate |
| Constructor Summary | |
|---|---|
FsCachingController(FsController<? extends FsConcurrentModel> controller,
IOPool<?> pool)
Constructs a new content caching file system controller. |
|
| Method Summary | ||
|---|---|---|
private
|
beforeSync(BitField<FsSyncOption> options,
ExceptionHandler<? super FsSyncException,X> handler)
|
|
FsEntry |
getEntry(FsEntryName name)
|
|
InputSocket<?> |
getInputSocket(FsEntryName name,
BitField<FsInputOption> options)
Returns an input socket for reading the contents of the entry addressed by the given name from the file system. |
|
OutputSocket<?> |
getOutputSocket(FsEntryName name,
BitField<FsOutputOption> options,
Entry template)
Returns an output socket for writing the contents of the entry addressed by the given name to the file system. |
|
void |
mknod(FsEntryName name,
Entry.Type type,
BitField<FsOutputOption> options,
Entry template)
Creates or replaces and finally links a chain of one or more entries for the given entry name into the file system. |
|
|
sync(BitField<FsSyncOption> options,
ExceptionHandler<? super FsSyncException,X> handler)
Commits all unsynchronized changes to the contents of this file system to its parent file system. |
|
void |
unlink(FsEntryName name)
|
|
| Methods inherited from class de.schlichtherle.truezip.fs.FsDecoratingController |
|---|
getClosedIcon, getModel, getOpenIcon, getParent, isReadable, isReadOnly, isWritable, setReadOnly, setTime, toString |
| Methods inherited from class de.schlichtherle.truezip.fs.FsController |
|---|
equals, hashCode, sync |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final IOCache.Strategy STRATEGY
private final IOPool<?> pool
private final Map<FsEntryName,FsCachingController.EntryCache> caches
| Constructor Detail |
|---|
public FsCachingController(FsController<? extends FsConcurrentModel> controller,
IOPool<?> pool)
controller - the decorated file system controller.pool - the pool of temporary entries to hold the copied entry data.| Method Detail |
|---|
public FsEntry getEntry(FsEntryName name)
throws IOException
getEntry in class FsDecoratingController<FsConcurrentModel,FsController<? extends FsConcurrentModel>>IOException
public InputSocket<?> getInputSocket(FsEntryName name,
BitField<FsInputOption> options)
FsController
getInputSocket in class FsDecoratingController<FsConcurrentModel,FsController<? extends FsConcurrentModel>>name - a file system entry name.
InputSocket.
public OutputSocket<?> getOutputSocket(FsEntryName name,
BitField<FsOutputOption> options,
Entry template)
FsControllertemplate is not null, then the output entry shall
have as many of its properties copied as reasonable, e.g. the last
modification time.
getOutputSocket in class FsDecoratingController<FsConcurrentModel,FsController<? extends FsConcurrentModel>>name - a file system entry name.template - a nullable template for the properties of the output
entry.
OutputSocket.
public void mknod(FsEntryName name,
Entry.Type type,
BitField<FsOutputOption> options,
Entry template)
throws IOException
FsControllername into the file system.
mknod in class FsDecoratingController<FsConcurrentModel,FsController<? extends FsConcurrentModel>>name - the file system entry name.type - the file system entry type.options - the file system output options.
If CREATE_PARENTS is set, any missing parent directories
will be created and linked into this file system with its last
modification time set to the system's current time.template - if not null, then the file system entry
at the end of the chain shall inherit as much properties from
this entry as possible - with the exception of its name and type.
IOException - for some other I/O related reason, including but
not exclusively upon one or more of the following conditions:
name contains characters which are not
supported by the file system.
FsOutputOption.EXCLUSIVE is set or the entry is a
directory.
createParents is
false.
public void unlink(FsEntryName name)
throws IOException
unlink in class FsDecoratingController<FsConcurrentModel,FsController<? extends FsConcurrentModel>>IOException
public <X extends IOException> void sync(BitField<FsSyncOption> options,
ExceptionHandler<? super FsSyncException,X> handler)
throws X extends IOException
FsController
sync in class FsDecoratingController<FsConcurrentModel,FsController<? extends FsConcurrentModel>>X - the type of the IOException to throw at the
discretion of the exception handler.options - the synchronization options.handler - the exception handling strategy for dealing with one or
more input FsSyncExceptions which may trigger an X.
X extends IOException
private <X extends IOException> void beforeSync(BitField<FsSyncOption> options,
ExceptionHandler<? super FsSyncException,X> handler)
throws X extends IOException
X extends IOException
|
TrueZIP Kernel 7.0-rc2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||