M - type of the artifact model that owns the descriptorT - type of descriptor being createdpublic abstract class AbstractArtifactDescriptorFactory<M extends org.mule.runtime.api.deployment.meta.AbstractMuleArtifactModel,T extends ArtifactDescriptor> extends Object implements ArtifactDescriptorFactory<T>
| Modifier and Type | Field and Description |
|---|---|
static String |
ARTIFACT_DESCRIPTOR_DOES_NOT_EXISTS_ERROR |
protected DescriptorLoaderRepository |
descriptorLoaderRepository |
| Constructor and Description |
|---|
AbstractArtifactDescriptorFactory(DescriptorLoaderRepository descriptorLoaderRepository)
Creates a new factory
|
| Modifier and Type | Method and Description |
|---|---|
T |
create(File artifactFolder)
Creates an artifact descriptor from a folder.
|
protected abstract T |
createArtifactDescriptor(File artifactLocation,
String name) |
protected abstract void |
doDescriptorConfig(M artifactModel,
T descriptor,
File artifactLocation)
Allows subclasses to customize descriptor based on the provided model
|
protected abstract ArtifactType |
getArtifactType() |
protected abstract org.mule.runtime.api.deployment.persistence.AbstractMuleArtifactModelJsonSerializer<M> |
getMuleArtifactModelJsonSerializer() |
static String |
invalidBundleDescriptorLoaderIdError(File artifactFolder,
org.mule.runtime.api.deployment.meta.MuleArtifactLoaderDescriptor bundleDescriptorLoader) |
static String |
invalidClassLoaderModelIdError(File artifactFolder,
org.mule.runtime.api.deployment.meta.MuleArtifactLoaderDescriptor classLoaderModelLoaderDescriptor) |
protected T |
loadFromJsonDescriptor(File artifactLocation,
M artifactModel)
Loads a descriptor from an artifact model
|
protected M |
loadModelFromJson(String jsonString)
Generates an artifact model from a given JSON descriptor
|
public static final String ARTIFACT_DESCRIPTOR_DOES_NOT_EXISTS_ERROR
protected final DescriptorLoaderRepository descriptorLoaderRepository
public AbstractArtifactDescriptorFactory(DescriptorLoaderRepository descriptorLoaderRepository)
descriptorLoaderRepository - contains all the ClassLoaderModelLoader registered on the container. Non nullpublic T create(File artifactFolder) throws ArtifactDescriptorCreateException
ArtifactDescriptorFactorycreate in interface ArtifactDescriptorFactory<T extends ArtifactDescriptor>artifactFolder - an existing folder containing artifact filesArtifactDescriptorCreateException - if the factory is not able to create a descriptor from the folder.protected abstract ArtifactType getArtifactType()
protected final T loadFromJsonDescriptor(File artifactLocation, M artifactModel)
artifactLocation - folder where the artifact is located, it can be a folder or file depending on the artifact type.artifactModel - model representing the artifact.protected M loadModelFromJson(String jsonString)
jsonString - artifact descriptor in JSON formatprotected abstract org.mule.runtime.api.deployment.persistence.AbstractMuleArtifactModelJsonSerializer<M> getMuleArtifactModelJsonSerializer()
protected abstract void doDescriptorConfig(M artifactModel, T descriptor, File artifactLocation)
artifactModel - artifact model created from the JSON descriptordescriptor - descriptor created from the model and configured with common attributesartifactLocation - folder where the artifact is located, it can be a folder or file depending on the artifact type.protected abstract T createArtifactDescriptor(File artifactLocation, String name)
artifactLocation - folder where the artifact is located, it can be a folder or file depending on the artifact type.name - name for the created artifactpublic static String invalidClassLoaderModelIdError(File artifactFolder, org.mule.runtime.api.deployment.meta.MuleArtifactLoaderDescriptor classLoaderModelLoaderDescriptor)
Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.