Package org.jboss.shrinkwrap.api
Class ConfigurationBuilder
java.lang.Object
org.jboss.shrinkwrap.api.ConfigurationBuilder
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 neededextensionLoader
- A new instance of the service extension loader from shrinkwrap-impl
build()
.- Version:
- $Revision: $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Iterable
<ClassLoader> ClassLoader
s used for extension loading, adding resources, etcprivate ExecutorService
ExecutorService
used for all asynchronous operationsprivate static final String
Implementation class name of the defaultExtensionLoader
to be usedprivate ExtensionLoader
Loader mapping archive types to the appropriate underlying implementationprivate static final Logger
Logger -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new builder initialized to defaults (null) values. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newConfiguration
using the properties contained in this builder.classLoaders
(Iterable<ClassLoader> classLoaders) Sets theClassLoader
used in resolving extension implementations by theExtensionLoader
; other tasks requiring a CL by theArchive
(package private) ExtensionLoader
Obtains the defaultExtensionLoader
to be used if none is specifiedexecutorService
(ExecutorService executorService) Sets theExecutorService
to be used, returning this instanceextensionLoader
(ExtensionLoader extensionLoader) Sets theExtensionLoader
to be used, returning this instance(package private) void
Sets properties to their default values if they haven't been explicitly provided by the user.
-
Field Details
-
log
Logger -
EXTENSION_LOADER_IMPL
Implementation class name of the defaultExtensionLoader
to be used- See Also:
-
extensionLoader
Loader mapping archive types to the appropriate underlying implementation -
executorService
ExecutorService
used for all asynchronous operations -
classLoaders
ClassLoader
s used for extension loading, adding resources, etc
-
-
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 duringbuild()
.
-
-
Method Details
-
getExtensionLoader
- Returns:
- the extensionLoader
-
getExecutorService
- Returns:
- the executorService
-
getClassLoaders
- Returns:
-
extensionLoader
Sets theExtensionLoader
to be used, returning this instance- Parameters:
extensionLoader
-- Returns:
-
executorService
Sets theExecutorService
to be used, returning this instance- Parameters:
executorService
-- Returns:
-
classLoaders
Sets theClassLoader
used in resolving extension implementations by theExtensionLoader
; other tasks requiring a CL by theArchive
- Parameters:
classLoaders
-- Returns:
-
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:
-