View Javadoc
1   /*
2    * Copyright (C) 2005-2015 Schlichtherle IT Services.
3    * All rights reserved. Use is subject to license terms.
4    */
5   package net.java.truevfs.kernel.spec;
6   
7   import java.util.ServiceConfigurationError;
8   import javax.annotation.CheckForNull;
9   import net.java.truecommons.shed.ImplementationsShouldExtend;
10  
11  /**
12   * Queries the scheme of the mount point of the given file system model in
13   * order to lookup the appropriate file system driver which is then used to
14   * create the requested thread-safe file system controller.
15   * <p>
16   * Implementations should be immutable.
17   *
18   * @see    FsDriver
19   * @author Christian Schlichtherle
20   */
21  @ImplementationsShouldExtend(FsAbstractCompositeDriver.class)
22  public interface FsCompositeDriver
23  extends FsModel.Factory<FsManager>, FsController.Factory<FsManager> {
24  
25      /**
26       * {@inheritDoc}
27       * <p>
28       * The file system model gets created by using a
29       * {@link FsDriver file system driver} which gets looked up by querying the
30       * scheme of the given mount point with the
31       * expression {@code mountPoint.getScheme()}.
32       *
33       * @throws ServiceConfigurationError if no appropriate file system driver
34       *         is known for the scheme of the given mount point.
35       */
36      @Override FsModel newModel(
37              FsManager context,
38              FsMountPoint mountPoint,
39              @CheckForNull FsModel parent);
40  
41      /**
42       * {@inheritDoc}
43       * <p>
44       * The file system controller gets created by using a
45       * {@link FsDriver file system driver} which gets looked up by querying the
46       * scheme of the mount point of the given file system model with the
47       * expression {@code model.getMountPoint().getScheme()}.
48       *
49       * @throws ServiceConfigurationError if no appropriate file system driver
50       *         is known for the scheme of the mount point of the given model.
51       */
52      @Override FsController newController(
53              FsManager context,
54              FsModel model,
55              @CheckForNull FsController parent)
56      throws ServiceConfigurationError;
57  }