Package org.jboss.shrinkwrap.api
Class ConfigurationBuilder
- java.lang.Object
-
- org.jboss.shrinkwrap.api.ConfigurationBuilder
-
public class ConfigurationBuilder extends java.lang.Object
Mutable construction object for new instances ofConfiguration
. 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 neededextensionLoader
- A new instance of the service extension loader from shrinkwrap-impl
build()
.- Version:
- $Revision: $
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Iterable<java.lang.ClassLoader>
classLoaders
ClassLoader
s used for extension loading, adding resources, etcprivate java.util.concurrent.ExecutorService
executorService
ExecutorService
used for all asynchronous operationsprivate static java.lang.String
EXTENSION_LOADER_IMPL
Implementation class name of the defaultExtensionLoader
to be usedprivate ExtensionLoader
extensionLoader
Loader mapping archive types to the appropriate underlying implementationprivate static java.util.logging.Logger
log
Logger
-
Constructor Summary
Constructors Constructor Description ConfigurationBuilder()
Creates a new builder initialized to defaults (null) values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Configuration
build()
Builds a newConfiguration
using the properties contained in this builder.ConfigurationBuilder
classLoaders(java.lang.Iterable<java.lang.ClassLoader> classLoaders)
Sets theClassLoader
used in resolving extension implementations by theExtensionLoader
; other tasks requiring a CL by theArchive
(package private) ExtensionLoader
createDefaultExtensionLoader()
Obtains the defaultExtensionLoader
to be used if none is specifiedConfigurationBuilder
executorService(java.util.concurrent.ExecutorService executorService)
Sets theExecutorService
to be used, returning this instanceConfigurationBuilder
extensionLoader(ExtensionLoader extensionLoader)
Sets theExtensionLoader
to be used, returning this instancejava.lang.Iterable<java.lang.ClassLoader>
getClassLoaders()
java.util.concurrent.ExecutorService
getExecutorService()
ExtensionLoader
getExtensionLoader()
(package private) void
setDefaults()
Sets properties to their default values if they haven't been explicitly provided by the user.
-
-
-
Field Detail
-
log
private static final java.util.logging.Logger log
Logger
-
EXTENSION_LOADER_IMPL
private static final java.lang.String EXTENSION_LOADER_IMPL
Implementation class name of the defaultExtensionLoader
to be used- See Also:
- Constant Field Values
-
extensionLoader
private ExtensionLoader extensionLoader
Loader mapping archive types to the appropriate underlying implementation
-
executorService
private java.util.concurrent.ExecutorService executorService
ExecutorService
used for all asynchronous operations
-
classLoaders
private java.lang.Iterable<java.lang.ClassLoader> classLoaders
ClassLoader
s used for extension loading, adding resources, etc
-
-
Constructor Detail
-
ConfigurationBuilder
public ConfigurationBuilder()
Creates a new builder initialized to defaults (null) values. Any properties not explicitly provided by the user will be defaulted duringbuild()
.
-
-
Method Detail
-
getExtensionLoader
public ExtensionLoader getExtensionLoader()
- Returns:
- the extensionLoader
-
getExecutorService
public java.util.concurrent.ExecutorService getExecutorService()
- Returns:
- the executorService
-
getClassLoaders
public java.lang.Iterable<java.lang.ClassLoader> getClassLoaders()
- Returns:
-
extensionLoader
public ConfigurationBuilder extensionLoader(ExtensionLoader extensionLoader)
Sets theExtensionLoader
to be used, returning this instance- Parameters:
extensionLoader
-- Returns:
-
executorService
public ConfigurationBuilder executorService(java.util.concurrent.ExecutorService executorService)
Sets theExecutorService
to be used, returning this instance- Parameters:
executorService
-- Returns:
-
classLoaders
public ConfigurationBuilder classLoaders(java.lang.Iterable<java.lang.ClassLoader> classLoaders)
Sets theClassLoader
used in resolving extension implementations by theExtensionLoader
; other tasks requiring a CL by theArchive
- Parameters:
classLoaders
-- Returns:
-
build
public Configuration build()
Builds a newConfiguration
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 thisConfigurationBuilder
'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 defaultExtensionLoader
to be used if none is specified- Returns:
-
-