public class ConfigurationBuilder
extends java.lang.Object
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-implbuild()
.Modifier and Type | Field and Description |
---|---|
private java.lang.Iterable<java.lang.ClassLoader> |
classLoaders
ClassLoader s used for extension loading, adding resources, etc |
private java.util.concurrent.ExecutorService |
executorService
ExecutorService used for all asynchronous operations |
private static java.lang.String |
EXTENSION_LOADER_IMPL
Implementation class name of the default
ExtensionLoader to be used |
private ExtensionLoader |
extensionLoader
Loader mapping archive types to the appropriate underlying implementation
|
private static java.util.logging.Logger |
log
Logger
|
Constructor and Description |
---|
ConfigurationBuilder()
Creates a new builder initialized to defaults (null) values.
|
Modifier and Type | Method and Description |
---|---|
Configuration |
build()
Builds a new
Configuration using the properties contained in this builder. |
ConfigurationBuilder |
classLoaders(java.lang.Iterable<java.lang.ClassLoader> classLoaders)
Sets the
ClassLoader used in resolving extension implementations by the ExtensionLoader ; other
tasks requiring a CL by the Archive |
(package private) ExtensionLoader |
createDefaultExtensionLoader()
Obtains the default
ExtensionLoader to be used if none is specified |
ConfigurationBuilder |
executorService(java.util.concurrent.ExecutorService executorService)
Sets the
ExecutorService to be used, returning this instance |
ConfigurationBuilder |
extensionLoader(ExtensionLoader extensionLoader)
Sets the
ExtensionLoader to be used, returning this instance |
java.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.
|
private static final java.util.logging.Logger log
private static final java.lang.String EXTENSION_LOADER_IMPL
ExtensionLoader
to be usedprivate ExtensionLoader extensionLoader
private java.util.concurrent.ExecutorService executorService
ExecutorService
used for all asynchronous operationsprivate java.lang.Iterable<java.lang.ClassLoader> classLoaders
ClassLoader
s used for extension loading, adding resources, etcpublic ConfigurationBuilder()
build()
.public ExtensionLoader getExtensionLoader()
public java.util.concurrent.ExecutorService getExecutorService()
public java.lang.Iterable<java.lang.ClassLoader> getClassLoaders()
public ConfigurationBuilder extensionLoader(ExtensionLoader extensionLoader)
ExtensionLoader
to be used, returning this instanceextensionLoader
- public ConfigurationBuilder executorService(java.util.concurrent.ExecutorService executorService)
ExecutorService
to be used, returning this instanceexecutorService
- public ConfigurationBuilder classLoaders(java.lang.Iterable<java.lang.ClassLoader> classLoaders)
ClassLoader
used in resolving extension implementations by the ExtensionLoader
; other
tasks requiring a CL by the Archive
classLoaders
- public Configuration build()
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.void setDefaults()
ExtensionLoader createDefaultExtensionLoader()
ExtensionLoader
to be used if none is specified