@NotThreadSafe @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public final class FsCachingController extends FsDecoratingConcurrentModelController<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 class |
FsCachingController.EntryController
A cache for the contents of an individual file system entry.
|
private static class |
FsCachingController.EntrySocketFactory |
private class |
FsCachingController.Input |
private class |
FsCachingController.Output |
| Modifier and Type | Field and Description |
|---|---|
private static BitField<FsSyncOption> |
ABORT_CHANGES_OPTIONS |
private Map<FsEntryName,FsCachingController.EntryController> |
controllers |
private static FsCachingController.EntrySocketFactory |
ENTRY_SOCKET_FACTORY |
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,
BitField<FsOutputOption> options)
Removes the named file system entry from the file system.
|
private void |
unlink0(FsEntryName name,
BitField<FsOutputOption> options) |
assertNotReadLockedByCurrentThread, assertWriteLockedByCurrentThread, isWriteLockedByCurrentThread, readLock, writeLockgetClosedIcon, getEntry, getOpenIcon, getParent, isExecutable, isReadable, isReadOnly, isWritable, setReadOnly, setTime, setTime, toStringgetModel, getMountPoint, isTouched, setTouchedequals, hashCode, syncprivate static final BitField<FsSyncOption> ABORT_CHANGES_OPTIONS
private final Map<FsEntryName,FsCachingController.EntryController> controllers
private static final FsCachingController.EntrySocketFactory ENTRY_SOCKET_FACTORY
private final IOPool<?> pool
private static final IOCache.Strategy STRATEGY
public FsCachingController(FsController<? extends FsConcurrentModel> controller, IOPool<?> pool)
controller - the decorated concurrent file system controller.pool - the pool of temporary entries to hold the copied entry data.private <X extends IOException> void beforeSync(BitField<FsSyncOption> options, ExceptionHandler<? super FsSyncException,X> handler) throws X extends IOException
X extends IOExceptionpublic 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 FsOutputOption.CREATE_PARENTS is set, any missing
parent directories will be created and linked into the 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 <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 IOExceptionpublic void unlink(FsEntryName name, BitField<FsOutputOption> options) throws IOException
FsControllerunlink in class FsDecoratingController<FsConcurrentModel,FsController<? extends FsConcurrentModel>>name - the file system entry name.options - output options for this operation.IOException - On any I/O error.private void unlink0(FsEntryName name, BitField<FsOutputOption> options) throws IOException
IOExceptionCopyright © 2004-2011 Schlichtherle IT Services. All Rights Reserved.