@NotThreadSafe @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public final class FsCachingController extends FsDecoratingController<FsConcurrentModel,FsController<? extends FsConcurrentModel>>
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.
| Modifier and Type | Class and Description |
|---|---|
private static class |
FsCachingController.CacheEntry
Hides backing store entries.
|
private class |
FsCachingController.EntryCache
A cache for the contents of an individual file system entry.
|
private class |
FsCachingController.Input |
private class |
FsCachingController.Output |
| Modifier and Type | Field and Description |
|---|---|
private Map<FsEntryName,FsCachingController.EntryCache> |
caches |
private IOPool<?> |
pool |
private static IOCache.Strategy |
STRATEGY |
delegate| Constructor and Description |
|---|
FsCachingController(FsController<? extends FsConcurrentModel> controller,
IOPool<?> pool)
Constructs a new content caching file system controller.
|
| Modifier and Type | Method and Description |
|---|---|
private <X extends IOException> |
beforeSync(BitField<FsSyncOption> options,
ExceptionHandler<? super FsSyncException,X> handler) |
InputSocket<?> |
getInputSocket(FsEntryName name,
BitField<FsInputOption> options)
Returns an input socket for reading the contents of the file system
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. |
<X extends IOException> |
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,
releases the associated resources (e.g. target archive files) for
access by third parties (e.g. other processes), cleans up any temporary
allocated resources (e.g. temporary files) and purges any cached data.
|
void |
unlink(FsEntryName name) |
getClosedIcon, getEntry, getModel, getOpenIcon, getParent, isReadable, isReadOnly, isWritable, setReadOnly, setTime, toStringequals, hashCode, syncprivate static final IOCache.Strategy STRATEGY
private final IOPool<?> pool
private final Map<FsEntryName,FsCachingController.EntryCache> caches
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.public InputSocket<?> getInputSocket(FsEntryName name, BitField<FsInputOption> options)
FsControllergetInputSocket in class FsDecoratingController<FsConcurrentModel,FsController<? extends FsConcurrentModel>>name - the file system entry name.options - the input options.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.options - a bit field of output options.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 - on any I/O error, including but not limited to these
reasons:
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>>IOExceptionpublic <X extends IOException> void sync(BitField<FsSyncOption> options, ExceptionHandler<? super FsSyncException,X> handler) throws X extends IOException
FsControllersync in class FsDecoratingController<FsConcurrentModel,FsController<? extends FsConcurrentModel>>X - The type of the IOException to throw at the
discretion of the exception handler.options - a bit field of synchronization options.handler - the exception handling strategy for consuming input
FsSyncExceptions and/or assembling output
IOExceptions.X extends IOExceptionprivate <X extends IOException> void beforeSync(BitField<FsSyncOption> options, ExceptionHandler<? super FsSyncException,X> handler) throws X extends IOException
X extends IOExceptionCopyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.