@NotThreadSafe @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public final class FsResourceController extends FsDecoratingConcurrentModelController<FsController<? extends FsConcurrentModel>>
FsResourceAccountant| Modifier and Type | Class and Description |
|---|---|
private class |
FsResourceController.AccountedInputStream |
private class |
FsResourceController.AccountedOutputStream |
private class |
FsResourceController.AccountedReadOnlyFile |
private class |
FsResourceController.AccountedSeekableByteChannel |
private static class |
FsResourceController.AccountingSocketFactory |
private class |
FsResourceController.Input |
private class |
FsResourceController.Nio2Input |
private class |
FsResourceController.Nio2Output |
private class |
FsResourceController.Output |
| Modifier and Type | Field and Description |
|---|---|
private FsResourceAccountant |
accountant |
private static FsResourceController.AccountingSocketFactory |
ACCOUNTING_SOCKET_FACTORY |
delegate| Constructor and Description |
|---|
FsResourceController(FsController<? extends FsConcurrentModel> controller)
Constructs a new file system resource controller.
|
| Modifier and Type | Method and Description |
|---|---|
private <X extends IOException> |
closeAllResources(ExceptionHandler<? super FsSyncException,X> handler)
Closes and disconnects all entry streams of the output and input
archive.
|
private FsResourceAccountant |
getAccountant() |
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.
|
<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.
|
private <X extends IOException> |
waitOtherThreads(BitField<FsSyncOption> options,
ExceptionHandler<? super FsSyncException,X> handler)
Waits for all entry input and output resources to close or forces
them to close, dependending on the
options. |
assertNotReadLockedByCurrentThread, assertWriteLockedByCurrentThread, isWriteLockedByCurrentThread, readLock, writeLockgetClosedIcon, getEntry, getOpenIcon, getParent, isExecutable, isReadable, isReadOnly, isWritable, mknod, setReadOnly, setTime, setTime, toString, unlinkgetModel, getMountPoint, isTouched, setTouchedequals, hashCode, sync@CheckForNull private FsResourceAccountant accountant
private static final FsResourceController.AccountingSocketFactory ACCOUNTING_SOCKET_FACTORY
public FsResourceController(FsController<? extends FsConcurrentModel> controller)
controller - the decorated concurrent file system controller.private <X extends IOException> void closeAllResources(ExceptionHandler<? super FsSyncException,X> handler) throws X extends IOException
X - The type of the IOException to throw at the
discretion of the exception handler.handler - the exception handling strategy for consuming input
FsSyncExceptions and/or assembling output
IOExceptions.IOException - at the discretion of the exception handler
upon the occurence of an FsSyncException.private FsResourceAccountant getAccountant()
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 <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 waitOtherThreads(BitField<FsSyncOption> options, ExceptionHandler<? super FsSyncException,X> handler) throws X extends IOException
options.
Mind that this method deliberately handles entry input and output
resources in an equal manner because
FsResourceAccountant.waitOtherThreads(long) WILL NOT WORK if any two
resource accountants share the same lock!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.IOException - at the discretion of the exception handler
upon the occurence of an FsSyncException.Copyright © 2004-2011 Schlichtherle IT Services. All Rights Reserved.