Class EmbeddedFileSystem.Builder

  • Enclosing class:
    EmbeddedFileSystem

    public static class EmbeddedFileSystem.Builder
    extends Object
    EmbeddedFileSystem builder class. Clients must use one these builder instances to create an EmbeddedFileSystem instance.
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • autoDelete

        public EmbeddedFileSystem.Builder autoDelete​(boolean b)
        Sets the auto delete flag. If on, the embedded file system backing store will be deleted once the embedded server is shutdown.
        Parameters:
        b - true to delete the instance root directory on server shutdown
        Returns:
        itself
      • configurationFile

        public EmbeddedFileSystem.Builder configurationFile​(File f)
        Sets the location of the read-only domain.xml configuration file. The file can be named anything but must have a valid domain.xml content. Any management operation will not be written to the file.
        Parameters:
        f - location of the configuration file
        Returns:
        itself
      • configurationFile

        public EmbeddedFileSystem.Builder configurationFile​(File f,
                                                            boolean readOnly)
        Sets the location of the domain.xml configuration file. The file can be named anything but must have a valid domain.xml content.
        Parameters:
        f - location of the configuration file
        readOnly - true if the file is readonly, false if management operations should be persisted.
        Returns:
        itself
      • installRoot

        public EmbeddedFileSystem.Builder installRoot​(File f)
        Sets the installation directory, using the installation module directory content as the application server classpath. The classloader used to load this class will be the parent class loader to the embedded server classloader which will use the modules located in the passed installation directory.
        Parameters:
        f - location of the glassfish installation
        Returns:
        itself
      • installRoot

        public EmbeddedFileSystem.Builder installRoot​(File f,
                                                      boolean cookedMode)
        Sets the installation directory and direct whether or not to use the installation's module directory content in the embedded server classpath. If cookMode is on, the embedded server will be loaded using the classloader used to load this class.
        Parameters:
        f - location of the installation
        cookedMode - true to use this class classloader, false to create a new classloader with the installation modules directory content.
        Returns:
        itself
      • instanceRoot

        public EmbeddedFileSystem.Builder instanceRoot​(File f)
        Sets the location of the domain directory used to load this instance of the embedded server.
        Parameters:
        f - location of the domain directory
        Returns:
        itself
      • build

        public EmbeddedFileSystem build()
        Builds a configured embedded file system instance that can be used to configure an embedded server.
        Returns:
        an immutable configured instance of an EmbeddedFileSystem