public class ExtensionModelServiceCache extends Object implements org.mule.tooling.client.api.Disposable
ExtensionModels. Supports mule-plugin release and snapshot artifacts.
It can be enabled to persist the value into disk. This can be done by setting a system property
TOOLING_CLIENT_EXTENSION_MODEL_SERVICE_CACHE_DISKSTORE_PATH to define the path were data
will be stored.
File.lastModified() value for SNAPSHOTS locally installed. Whenever a new
snapshot version is discovered any previous version, if it was written into disk, will be removed and
invalidated from the memory cache.| Modifier and Type | Field and Description |
|---|---|
static String |
METADATA_CACHE_PROPERTIES_FILE_NAME |
static String |
METADATA_KEY |
| Constructor and Description |
|---|
ExtensionModelServiceCache(String toolingVersion) |
ExtensionModelServiceCache(String toolingVersion,
boolean recordStats) |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose() |
com.google.common.cache.CacheStats |
getCacheStats() |
Optional<LoadedExtensionInformation> |
loadExtensionInformation(org.mule.maven.client.api.model.BundleDependency bundleDependency,
InternalExtensionModelService extensionModelService)
Loads an extension model from a
ArtifactDescriptor. |
Optional<LoadedExtensionInformation> |
loadExtensionInformation(File plugin,
InternalExtensionModelService extensionModelService)
Loads an extension model from a
File pointing to the plugin artifact. |
List<org.mule.runtime.api.meta.model.ExtensionModel> |
loadRuntimeExtensionModels(InternalExtensionModelService extensionModelService)
Loads the core extension model.
|
public static final String METADATA_KEY
public static final String METADATA_CACHE_PROPERTIES_FILE_NAME
public ExtensionModelServiceCache(String toolingVersion)
public ExtensionModelServiceCache(String toolingVersion, boolean recordStats)
public Optional<LoadedExtensionInformation> loadExtensionInformation(org.mule.maven.client.api.model.BundleDependency bundleDependency, InternalExtensionModelService extensionModelService)
ArtifactDescriptor.
It uses a cache, so it will only call the extensionModelService if there's a cache miss.
bundleDependency - the plugin BundleDependencyextensionModelService - the service to use to load the ExtensionModel in case of a cache missLoadedExtensionInformation, empty if the plugin does not have an extension modelpublic Optional<LoadedExtensionInformation> loadExtensionInformation(File plugin, InternalExtensionModelService extensionModelService)
File pointing to the plugin artifact.
It uses a cache, so it will only call the extensionModelService if there's a cache miss.
plugin - the plugin descriptorextensionModelService - the service to use to load the ExtensionModel in case of a cache missLoadedExtensionInformation, empty if the plugin does not have an extension modelpublic List<org.mule.runtime.api.meta.model.ExtensionModel> loadRuntimeExtensionModels(InternalExtensionModelService extensionModelService)
extensionModelService - the service to use to load the ExtensionModel in case of a cache misspublic void dispose()
dispose in interface org.mule.tooling.client.api.Disposablepublic com.google.common.cache.CacheStats getCacheStats()
Copyright © 2019 MuleSoft, Inc.. All rights reserved.