@ThreadSafe public abstract class FsDecoratingManager extends FsAbstractManager
| Modifier and Type | Field and Description |
|---|---|
protected FsManager |
manager
The decorated file system manager.
|
| Modifier | Constructor and Description |
|---|---|
protected |
FsDecoratingManager(FsManager manager) |
| Modifier and Type | Method and Description |
|---|---|
<X extends IOException> |
accept(net.java.truecommons.shed.Filter<? super FsController> filter,
net.java.truecommons.shed.Visitor<? super FsController,X> visitor)
Invokes the given visitor on all managed file system controllers which
get accepted by the given
filter. |
FsController |
controller(FsCompositeDriver driver,
FsMountPoint mountPoint)
Returns the thread-safe file system controller for the given mount point.
|
FsController |
newController(FsArchiveDriver<? extends FsArchiveEntry> context,
FsModel model,
FsController parent)
Returns a new file system controller for the mount point of the
given file system model.
|
FsModel |
newModel(FsDriver context,
FsMountPoint mountPoint,
FsModel parent)
Returns a new file system model for the given mount point.
|
void |
sync(net.java.truecommons.shed.Filter<? super FsController> filter,
net.java.truecommons.shed.Visitor<? super FsController,FsSyncException> visitor)
Invokes the given visitor to
sync() all
managed file system controllers which get accepted by the given
filter. |
String |
toString()
Returns a string representation of this object for debugging and logging
purposes.
|
protected final FsManager manager
protected FsDecoratingManager(FsManager manager)
public <X extends IOException> void accept(net.java.truecommons.shed.Filter<? super FsController> filter, net.java.truecommons.shed.Visitor<? super FsController,X> visitor) throws X extends IOException
FsManagerfilter.
This is the engine for calls to FsManager.sync(net.java.truecommons.shed.Filter<? super net.java.truevfs.kernel.spec.FsController>, net.java.truecommons.shed.Visitor<? super net.java.truevfs.kernel.spec.FsController, net.java.truevfs.kernel.spec.FsSyncException>).filter - the filter for the managed file system controllers.visitor - the visitor for the filtered file system controllers.X extends IOExceptionpublic FsController controller(FsCompositeDriver driver, FsMountPoint mountPoint)
FsManagersynchronization.driver - the composite file system driver which shall get used to
create a new file system controller if required.mountPoint - the mount point of the file system.public FsController newController(FsArchiveDriver<? extends FsArchiveEntry> context, FsModel model, @Nullable FsController parent)
FsController.FactoryWhen called, you may assert the following precondition:
assert null == parent
? null == model.getParent()
: parent.getModel().equals(model.getParent())
context - the calling context.model - the file system model.parent - the nullable parent file system controller.public FsModel newModel(FsDriver context, FsMountPoint mountPoint, FsModel parent)
FsModel.FactoryWhen called, you may assert the following precondition:
assert null == parent
? null == mountPoint.getParent()
: parent.getMountPoint().equals(mountPoint.getParent());
context - the calling context.mountPoint - the mount point of the file system.parent - the nullable parent file system model.public void sync(net.java.truecommons.shed.Filter<? super FsController> filter, net.java.truecommons.shed.Visitor<? super FsController,FsSyncException> visitor) throws FsSyncException
FsManagersync() all
managed file system controllers which get accepted by the given
filter.
Call this method instead of FsManager.accept(net.java.truecommons.shed.Filter<? super net.java.truevfs.kernel.spec.FsController>, net.java.truecommons.shed.Visitor<? super net.java.truevfs.kernel.spec.FsController, X>) for sync()ing in
order to support processing of additional aspects such as controlling a
shutdown hook, logging statistics et al.
The implementation needs to use an FsSyncExceptionBuilder while
iterating over all managed file system controllers in order to ensure
that all controllers get synced, even if one or more controllers fail
with an FsSyncException.
sync in interface FsManagersync in class FsAbstractManagerfilter - the filter for the managed file system controllers.
If set to Filter.ACCEPT_ANY, then the implementation may
perform additional cleanup operations, e.g. remove a shutdown
hook.visitor - the visitor for syncing the filtered file system
controllers.FsSyncWarningException - if only warning conditions
apply.
This implies that the respective file system controller has been
sync()ed with constraints, e.g. if an
open archive entry stream or channel gets forcibly
close()d.FsSyncException - if any error conditions apply.Copyright © 2005–2014 Schlichtherle IT Services. All rights reserved.