@ThreadSafe @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public abstract class FsManager extends Object implements Iterable<FsController<?>>
Sub-classes must be thread-safe, too.
| Modifier and Type | Class and Description |
|---|---|
private static interface |
FsManager.Visitor
A visitor for file system controllers.
|
| Modifier and Type | Field and Description |
|---|---|
static BitField<FsSyncOption> |
UMOUNT
Equivalent to
BitField.of(FsSyncOption.FORCE_CLOSE_INPUT, FsSyncOption.FORCE_CLOSE_OUTPUT, FsSyncOption.CLEAR_CACHE). |
| Constructor and Description |
|---|
FsManager() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object that)
Two file system managers are considered equal if and only if they are
identical.
|
abstract FsController<?> |
getController(FsMountPoint mountPoint,
FsCompositeDriver driver)
Returns a thread-safe file system controller for the given mount point.
|
abstract int |
getSize()
Returns the number of federated file systems managed by this instance.
|
int |
hashCode()
Returns a hash code which is consistent with
equals(java.lang.Object). |
abstract Iterator<FsController<?>> |
iterator()
Returns an iterator for the controller of all federated file systems
managed by this instance.
|
void |
sync(BitField<FsSyncOption> options)
Commits all unsynchronized changes to the contents of all federated file
systems managed by this instance to their respective 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.
|
<X extends IOException> |
sync(BitField<FsSyncOption> options,
ExceptionHandler<? super IOException,X> handler)
Commits all unsynchronized changes to the contents of all federated file
systems managed by this instance to their respective 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.
|
String |
toString()
Returns a string representation of this object for debugging and logging
purposes.
|
private <X extends IOException> |
visit(FsManager.Visitor visitor,
ExceptionHandler<? super IOException,X> handler)
Visits the controller of all federated file systems managed by this
instance.
|
public static final BitField<FsSyncOption> UMOUNT
BitField.of(FsSyncOption.FORCE_CLOSE_INPUT, FsSyncOption.FORCE_CLOSE_OUTPUT, FsSyncOption.CLEAR_CACHE).public final boolean equals(Object that)
public abstract FsController<?> getController(FsMountPoint mountPoint, FsCompositeDriver driver)
synchronization
operations.mountPoint - the mount point of the file system.driver - the file system composite driver which shall get used to
create a new file system controller if required.public abstract int getSize()
public final int hashCode()
equals(java.lang.Object).
This can't get overriden.public abstract Iterator<FsController<?>> iterator()
Important: The iterated file system controllers must be ordered so that all file systems appear before any of their parent file systems.
iterator in interface Iterable<FsController<?>>public final void sync(BitField<FsSyncOption> options) throws FsSyncException
This method calls sync(options, builder), where builder is
an instance of FsSyncExceptionBuilder.
If the call succeeds, the builder's AbstractExceptionBuilder.check()
method is called to check out any FsSyncWarningException, too.
options - a bit field of synchronization options.FsSyncException - if committing the changes fails for any reason.IllegalArgumentException - if the combination of synchronization
options is illegal, e.g. if FORCE_CLOSE_INPUT is cleared
and FORCE_CLOSE_OUTPUT is set or if the synchronization
option ABORT_CHANGES is set.public <X extends IOException> void sync(BitField<FsSyncOption> options, ExceptionHandler<? super IOException,X> handler) throws X extends IOException
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
IOExceptions and/or assembling output
IOExceptions.IOException - at the discretion of the exception handler
upon the occurence of an IOException.IllegalArgumentException - if the combination of synchronization
options is illegal, e.g. if
FsSyncOption.FORCE_CLOSE_INPUT is cleared and
FsSyncOption.FORCE_CLOSE_OUTPUT is set or if the
synchronization option FsSyncOption.ABORT_CHANGES is set.public String toString()
private <X extends IOException> void visit(FsManager.Visitor visitor, ExceptionHandler<? super IOException,X> handler) throws X extends IOException
X - The type of the IOException to throw at the
discretion of the exception handler.visitor - the visitor.handler - the exception handling strategy for consuming input
IOExceptions and/or assembling output IOException.IOException - at the discretion of the exception handler
upon the occurence of an IOException.Copyright © 2004-2011 Schlichtherle IT Services. All Rights Reserved.