Class ClasspathScriptsRepository
- java.lang.Object
-
- de.hybris.platform.scripting.engine.repository.impl.AbstractScriptsRepository
-
- de.hybris.platform.scripting.engine.repository.impl.ClasspathScriptsRepository
-
- All Implemented Interfaces:
CacheableScriptsRepository,ScriptsRepository
- Direct Known Subclasses:
TestClasspathScriptsRepository
public class ClasspathScriptsRepository extends AbstractScriptsRepository implements CacheableScriptsRepository
This repository does lookup for scripts in the current classpath.The format of URI for script:
classpath://path/to/script.groovy classpath://path/to/file.bsh classpath://path/to/file.js
Any scripts which are intended to be used by this repository must have proper file extension according to the Script Type.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringtenantId
-
Constructor Summary
Constructors Constructor Description ClasspathScriptsRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CacheKeycreateCacheKey(java.lang.String protocol, java.lang.String path)Creates cache key based on given protocol and script path.voidinit()ScriptContentlookupScript(CacheKey cacheKey)Lookup for ScriptContent based on the information provided by the CacheKey object.ScriptContentlookupScript(java.lang.String protocol, java.lang.String path)Lookup script in the repository by protocol and path.-
Methods inherited from class de.hybris.platform.scripting.engine.repository.impl.AbstractScriptsRepository
getSupportedProtocols, setSupportedProtocols
-
-
-
-
Method Detail
-
init
@PostConstruct public void init()
-
lookupScript
public ScriptContent lookupScript(java.lang.String protocol, java.lang.String path)
Description copied from interface:ScriptsRepositoryLookup script in the repository by protocol and path.- Specified by:
lookupScriptin interfaceScriptsRepository- Parameters:
protocol- native protocol for the given repository.path- path of the Script in the given repository.- Returns:
- ScriptContent object
-
lookupScript
public ScriptContent lookupScript(CacheKey cacheKey)
Description copied from interface:CacheableScriptsRepositoryLookup for ScriptContent based on the information provided by the CacheKey object.- Specified by:
lookupScriptin interfaceCacheableScriptsRepository
-
createCacheKey
public CacheKey createCacheKey(java.lang.String protocol, java.lang.String path)
Description copied from interface:CacheableScriptsRepositoryCreates cache key based on given protocol and script path.- Specified by:
createCacheKeyin interfaceCacheableScriptsRepository
-
-