public class ArtifactContextBuilder extends Object
ArtifactContext. This is the preferred mechanism to create a ArtifactContext and a
MuleContext that can be retrieved from the ArtifactContext by calling ArtifactContext.getMuleContext()| Modifier and Type | Field and Description |
|---|---|
protected static String |
CLASS_LOADER_REPOSITORY_CANNOT_BE_NULL |
protected static String |
CLASS_LOADER_REPOSITORY_WAS_NOT_SET |
protected static String |
EXECUTION_CLASSLOADER_WAS_NOT_SET |
protected static String |
EXTENSION_MODEL_LOADER_REPOSITORY_CANNOT_BE_NULL |
protected static String |
INSTALLATION_DIRECTORY_MUST_BE_A_DIRECTORY |
protected static String |
MULE_CONTEXT_ARTIFACT_PROPERTIES_CANNOT_BE_NULL |
protected static String |
ONLY_APPLICATIONS_OR_POLICIES_ARE_ALLOWED_TO_HAVE_A_PARENT_ARTIFACT |
protected static String |
SERVICE_CONFIGURATOR_CANNOT_BE_NULL |
protected static String |
SERVICE_REPOSITORY_CANNOT_BE_NULL |
| Modifier and Type | Method and Description |
|---|---|
ArtifactContext |
build() |
protected ConfigurationBuilder |
createConfigurationBuilderFromApplicationProperties() |
static ArtifactContextBuilder |
newBuilder() |
static ArtifactContextBuilder |
newBuilder(ConfigurationBuilder... additionalBuilders) |
ArtifactContextBuilder |
setArtifactDeclaration(org.mule.runtime.app.declaration.api.ArtifactDeclaration artifactDeclaration) |
ArtifactContextBuilder |
setArtifactInstallationDirectory(File location)
Sets the file location where the artifact is installed.
|
ArtifactContextBuilder |
setArtifactName(String artifactName)
Sets a meaningful name to identify the artifact.
|
ArtifactContextBuilder |
setArtifactPlugins(List<ArtifactPlugin> artifactPlugins)
Provides a list of
ArtifactPlugin that describe all the extensions that need to be accessible by the
MuleContext to be created. |
ArtifactContextBuilder |
setArtifactProperties(Map<String,String> artifactProperties)
The artifact properties define key value pairs that can be referenced from within the configuration files.
|
ArtifactContextBuilder |
setArtifactType(ArtifactType artifactType)
The
ArtifactType defines the set of services that will be available in the MuleContext. |
ArtifactContextBuilder |
setClassLoaderRepository(ClassLoaderRepository classLoaderRepository)
Provides a
ClassLoaderRepository containing all registered class loaders on the container. |
ArtifactContextBuilder |
setConfigurationFiles(String... configurationFiles) |
ArtifactContextBuilder |
setDataFolderName(String folderName) |
ArtifactContextBuilder |
setDefaultEncoding(String defaultEncoding)
Sets the default encoding for the
MuleContext if the use did not define one explicitly within the configuration. |
ArtifactContextBuilder |
setDisableXmlValidations(boolean disableXmlValidations)
Allows to create an
ArtifactContext that will not check for XSD validations. |
ArtifactContextBuilder |
setEnableLazyInit(boolean enableLazyInit)
Allows to lazily create the artifact resources.
|
ArtifactContextBuilder |
setExecutionClassloader(ClassLoader classloader)
Sets the classloader that must be used to execute all
MuleContext tasks such as running flows, doing connection
retries, etc. |
ArtifactContextBuilder |
setExtensionManagerFactory(ExtensionManagerFactory extensionManagerFactory) |
ArtifactContextBuilder |
setExtensionModelLoaderRepository(ExtensionModelLoaderRepository extensionModelLoaderRepository)
Sets a
ExtensionModelLoaderRepository that allows to retrieve the available extension loaders. |
ArtifactContextBuilder |
setMuleContextListener(MuleContextListener muleContextListener)
Allows to set a listener that will be notified when the
MuleContext is created, initialized or configured. |
ArtifactContextBuilder |
setParentArtifact(DeployableArtifact<?> parentArtifact)
Allows to define a parent artifact which resources will be available to the context to be created.
|
ArtifactContextBuilder |
setPolicyProvider(PolicyProvider policyProvider) |
ArtifactContextBuilder |
setProperties(Optional<Properties> properties) |
ArtifactContextBuilder |
setRuntimeLockFactory(org.mule.runtime.api.lock.LockFactory runtimeLockFactory) |
ArtifactContextBuilder |
setServiceRepository(org.mule.runtime.api.service.ServiceRepository serviceRepository)
Provides a
ServiceRepository containing all the services that will be accessible from the MuleContext to be
created. |
ArtifactContextBuilder |
withServiceConfigurator(org.mule.runtime.api.config.custom.ServiceConfigurator serviceConfigurator)
Adds a service configurator to configure the created context.
|
protected static final String EXECUTION_CLASSLOADER_WAS_NOT_SET
protected static final String MULE_CONTEXT_ARTIFACT_PROPERTIES_CANNOT_BE_NULL
protected static final String INSTALLATION_DIRECTORY_MUST_BE_A_DIRECTORY
protected static final String ONLY_APPLICATIONS_OR_POLICIES_ARE_ALLOWED_TO_HAVE_A_PARENT_ARTIFACT
protected static final String SERVICE_REPOSITORY_CANNOT_BE_NULL
protected static final String EXTENSION_MODEL_LOADER_REPOSITORY_CANNOT_BE_NULL
protected static final String CLASS_LOADER_REPOSITORY_CANNOT_BE_NULL
protected static final String CLASS_LOADER_REPOSITORY_WAS_NOT_SET
protected static final String SERVICE_CONFIGURATOR_CANNOT_BE_NULL
public static ArtifactContextBuilder newBuilder()
ArtifactContext instance.public static ArtifactContextBuilder newBuilder(ConfigurationBuilder... additionalBuilders)
ArtifactContext instance.public ArtifactContextBuilder setArtifactType(ArtifactType artifactType)
ArtifactType defines the set of services that will be available in the MuleContext. For instance
ArtifactType.DOMAIN does not have any service required to execute flows.
By default ArtifactType.APP will be used, making all services available.
artifactType - artifact type for which a MuleContext must be created.public ArtifactContextBuilder setProperties(Optional<Properties> properties)
public ArtifactContextBuilder setDataFolderName(String folderName)
folderName - the folder name to use to store data in the file system related to the application.public ArtifactContextBuilder setConfigurationFiles(String... configurationFiles)
configurationFiles - set of the artifact configuration files. These must be absolute paths.public ArtifactContextBuilder setArtifactDeclaration(org.mule.runtime.app.declaration.api.ArtifactDeclaration artifactDeclaration)
artifactDeclaration - Artifact declaration.public ArtifactContextBuilder setParentArtifact(DeployableArtifact<?> parentArtifact)
Domains to define shared resources.parentArtifact - artifact parent of the one being created.public ArtifactContextBuilder setArtifactProperties(Map<String,String> artifactProperties)
artifactProperties - properties use for the artifact configurationpublic ArtifactContextBuilder setArtifactName(String artifactName)
artifactName - name to use to identify the artifact.public ArtifactContextBuilder setMuleContextListener(MuleContextListener muleContextListener)
MuleContext is created, initialized or configured.muleContextListener - listener of MuleContext notifications.public ArtifactContextBuilder setArtifactInstallationDirectory(File location)
location - directory where the artifact is installedpublic ArtifactContextBuilder setExecutionClassloader(ClassLoader classloader)
MuleContext tasks such as running flows, doing connection
retries, etc.classloader - classloader to use for executing logic within the MuleContextpublic ArtifactContextBuilder setDefaultEncoding(String defaultEncoding)
MuleContext if the use did not define one explicitly within the configuration.defaultEncoding - default encoding to use within the MuleContextpublic ArtifactContextBuilder setArtifactPlugins(List<ArtifactPlugin> artifactPlugins)
ArtifactPlugin that describe all the extensions that need to be accessible by the
MuleContext to be created. It may also be that the configuration files make use of this extensions.artifactPlugins - collection of artifact extensions that define resources as part of the MuleContext to be
created.public ArtifactContextBuilder setServiceRepository(org.mule.runtime.api.service.ServiceRepository serviceRepository)
ServiceRepository containing all the services that will be accessible from the MuleContext to be
created.serviceRepository - repository of available services. Non null.public ArtifactContextBuilder setExtensionModelLoaderRepository(ExtensionModelLoaderRepository extensionModelLoaderRepository)
ExtensionModelLoaderRepository that allows to retrieve the available extension loaders.extensionModelLoaderRepository - ExtensionModelLoaderRepository with the available extension loaders. Non null.public ArtifactContextBuilder setPolicyProvider(PolicyProvider policyProvider)
public ArtifactContextBuilder setEnableLazyInit(boolean enableLazyInit)
enableLazyInit - when true the artifact resources from the mule configuration won't be created at startup. The artifact
components from the configuration will be created on demand when requested. For instance, when using
DefaultMuleApplication.getConnectivityTestingService() and then invoking
ConnectivityTestingService.testConnection(Location) will cause the creation of the component
requested to do test connectivity, if it was not already created. when false, the application will be
created completely at startup.public ArtifactContextBuilder setDisableXmlValidations(boolean disableXmlValidations)
ArtifactContext that will not check for XSD validations.disableXmlValidations - true if the artifact context must be created without XSD validations, false otherwise.public ArtifactContextBuilder setClassLoaderRepository(ClassLoaderRepository classLoaderRepository)
ClassLoaderRepository containing all registered class loaders on the container.classLoaderRepository - repository of available class loaders. Non null.public ArtifactContextBuilder withServiceConfigurator(org.mule.runtime.api.config.custom.ServiceConfigurator serviceConfigurator)
serviceConfigurator - used to configure the create context. Non null.public ArtifactContextBuilder setRuntimeLockFactory(org.mule.runtime.api.lock.LockFactory runtimeLockFactory)
runtimeLockFactory - LockFactory for the runtime that can be shared along deployable artifacts to synchronize
access on different deployable artifacts to the same resources.public ArtifactContext build() throws org.mule.runtime.api.lifecycle.InitialisationException, ConfigurationException
MuleContext created with the provided configurationConfigurationException - when there's a problem creating the MuleContextorg.mule.runtime.api.lifecycle.InitialisationException - when a certain configuration component failed during initialisation phaseprotected ConfigurationBuilder createConfigurationBuilderFromApplicationProperties()
public ArtifactContextBuilder setExtensionManagerFactory(ExtensionManagerFactory extensionManagerFactory)
Copyright © 2003–2021 MuleSoft, Inc.. All rights reserved.