Class ConfigurationBuilder

java.lang.Object
org.jboss.shrinkwrap.api.ConfigurationBuilder

public class ConfigurationBuilder extends Object
Mutable construction object for new instances of Configuration. Provides defaults for each property if not specified (null) according to the following:
  • executorService - Stay null, none is required and ShrinkWrap will create its own and destroy it when done as needed
  • extensionLoader - A new instance of the service extension loader from shrinkwrap-impl
Not thread-safe. When done altering properties here, a new configuration may be constructed by calling upon build().
Version:
$Revision: $
  • Field Details

  • Constructor Details

    • ConfigurationBuilder

      public ConfigurationBuilder()
      Creates a new builder initialized to defaults (null) values. Any properties not explicitly provided by the user will be defaulted during build().
  • Method Details

    • getExtensionLoader

      public ExtensionLoader getExtensionLoader()
      Returns:
      the extensionLoader
    • getExecutorService

      public ExecutorService getExecutorService()
      Returns:
      the executorService
    • getClassLoaders

      public Iterable<ClassLoader> getClassLoaders()
      Returns:
    • extensionLoader

      public ConfigurationBuilder extensionLoader(ExtensionLoader extensionLoader)
      Sets the ExtensionLoader to be used, returning this instance
      Parameters:
      extensionLoader -
      Returns:
    • executorService

      public ConfigurationBuilder executorService(ExecutorService executorService)
      Sets the ExecutorService to be used, returning this instance
      Parameters:
      executorService -
      Returns:
    • classLoaders

      public ConfigurationBuilder classLoaders(Iterable<ClassLoader> classLoaders)
      Sets the ClassLoader used in resolving extension implementations by the ExtensionLoader; other tasks requiring a CL by the Archive
      Parameters:
      classLoaders -
      Returns:
    • build

      public Configuration build()
      Builds a new Configuration using the properties contained in this builder. In the case a property has not been specified, it will be defaulted according to the rules set forth in this ConfigurationBuilder's contract.
      Returns:
    • setDefaults

      void setDefaults()
      Sets properties to their default values if they haven't been explicitly provided by the user. If no ClassLoaders are specified, use the TCCL.
    • createDefaultExtensionLoader

      ExtensionLoader createDefaultExtensionLoader()
      Obtains the default ExtensionLoader to be used if none is specified
      Returns: