public class ToolingApplicationClassLoaderBuilder extends AbstractArtifactClassLoaderBuilder<ToolingApplicationClassLoaderBuilder>
ArtifactClassLoader builder for class loaders required by Application artifacts for Tooling.
The main different between this kind of applications vs the ones deployed through the deployment service is that
Tooling has to access the ArtifactClassLoader and it should be simple for Tooling to dispose resources, therefore
a ToolingArtifactClassLoader is created by this builder.artifactDescriptor, artifactPluginClassLoaders, logger| Constructor and Description |
|---|
ToolingApplicationClassLoaderBuilder(DeployableArtifactClassLoaderFactory<ApplicationDescriptor> artifactClassLoaderFactory,
RegionPluginClassLoadersFactory pluginClassLoadersFactory)
Creates a new builder for creating
Application artifacts. |
| Modifier and Type | Method and Description |
|---|---|
ToolingArtifactClassLoader |
build()
Creates a new
ArtifactClassLoader using the provided configuration. |
protected ArtifactClassLoader |
createArtifactClassLoader(String artifactId,
RegionClassLoader regionClassLoader)
Creates the class loader for the artifact being built.
|
protected RegionClassLoader |
createRegionClassLoader(String artifactId,
ArtifactDescriptor artifactDescriptor,
ClassLoader parentClassLoader,
ClassLoaderLookupPolicy parentLookupPolicy)
Template method to build different implementations of a
RegionClassLoader |
static String |
getApplicationId(String applicationName) |
static String |
getApplicationId(String applicationName,
String domainId) |
protected String |
getArtifactId(ArtifactDescriptor artifactDescriptor) |
protected ArtifactClassLoader |
getParentClassLoader()
Implementation must redefine this method and it should provide the root class loader which is going to be used as parent
class loader for every other class loader created by this builder.
|
protected ClassLoaderLookupPolicy |
getParentLookupPolicy(ArtifactClassLoader parentClassLoader) |
ToolingApplicationClassLoaderBuilder |
setDomainParentClassLoader(ArtifactClassLoader domainArtifactClassLoader) |
ToolingApplicationClassLoaderBuilder |
setParentClassLoader(ArtifactClassLoader parentClassLoader) |
addArtifactPluginDescriptors, setArtifactDescriptor, setArtifactIdpublic ToolingApplicationClassLoaderBuilder(DeployableArtifactClassLoaderFactory<ApplicationDescriptor> artifactClassLoaderFactory, RegionPluginClassLoadersFactory pluginClassLoadersFactory)
Application artifacts.
The domainRepository is used to locate the domain that this application belongs to and the
artifactClassLoaderBuilder is used for building the common parts of artifacts.
artifactClassLoaderFactory - factory for the classloader specific to the artifact resource and classespluginClassLoadersFactory - creates the class loaders for the plugins included in the application's region. Non nullpublic ToolingArtifactClassLoader build() throws IOException
ArtifactClassLoader using the provided configuration. It will create the proper class loader hierarchy
and filters so application classes, resources, plugins and it's domain resources are resolve correctly.build in class AbstractArtifactClassLoaderBuilder<ToolingApplicationClassLoaderBuilder>MuleDeployableArtifactClassLoader created from the provided configuration.IOException - exception cause when it was not possible to access the file provided as dependenciesprotected ArtifactClassLoader createArtifactClassLoader(String artifactId, RegionClassLoader regionClassLoader)
AbstractArtifactClassLoaderBuildercreateArtifactClassLoader in class AbstractArtifactClassLoaderBuilder<ToolingApplicationClassLoaderBuilder>artifactId - identifies the artifact being created. Non empty.regionClassLoader - class loader containing the artifact and dependant class loaders. Non null.protected String getArtifactId(ArtifactDescriptor artifactDescriptor)
getArtifactId in class AbstractArtifactClassLoaderBuilder<ToolingApplicationClassLoaderBuilder>public ToolingApplicationClassLoaderBuilder setParentClassLoader(ArtifactClassLoader parentClassLoader)
parentClassLoader - parent class loader for the artifact class loader that should have all the URLs needed from
tooling side when loading the ExtensionModel. Among those, there will be mule-api, extensions-api,
extensions-support and so on.public ToolingApplicationClassLoaderBuilder setDomainParentClassLoader(ArtifactClassLoader domainArtifactClassLoader)
domainArtifactClassLoader - domain parent class loader for the artifact class loader. It will check for plugins to define
the parent lookup policy if a domain parent artifact class loader has been set.protected ClassLoaderLookupPolicy getParentLookupPolicy(ArtifactClassLoader parentClassLoader)
getParentLookupPolicy in class AbstractArtifactClassLoaderBuilder<ToolingApplicationClassLoaderBuilder>parentClassLoader - parent class loader for the creates artifact class loaderprotected ArtifactClassLoader getParentClassLoader()
AbstractArtifactClassLoaderBuildergetParentClassLoader in class AbstractArtifactClassLoaderBuilder<ToolingApplicationClassLoaderBuilder>protected RegionClassLoader createRegionClassLoader(String artifactId, ArtifactDescriptor artifactDescriptor, ClassLoader parentClassLoader, ClassLoaderLookupPolicy parentLookupPolicy)
AbstractArtifactClassLoaderBuilderRegionClassLoadercreateRegionClassLoader in class AbstractArtifactClassLoaderBuilder<ToolingApplicationClassLoaderBuilder>RegionClassLoaderpublic static String getApplicationId(String applicationName)
applicationName - name of the application. Non empty.Copyright © 2003–2019 MuleSoft, Inc.. All rights reserved.