Package com.e1c.langtool.collector
Interface ICollectingCacheManager
- All Superinterfaces:
IManagedService
- All Known Implementing Classes:
CollectingCacheManager
The manager service of collecting data cache for file resources.
This manager allows to manually stop and start track file changes for the project in case some external project
life-cycle.
This cache is used by default in
IFeatureValueCollectingService when collect by resources.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the cache change listener.Iterator<org.eclipse.core.runtime.IPath>allInvalidated(org.eclipse.core.resources.IProject project) All invalidated file paths of the project that may have cache data.Iterator<org.eclipse.core.runtime.IPath>allResources(org.eclipse.core.resources.IProject project) All project file paths that may have cache.voidclear(org.eclipse.core.resources.IProject project) Clear cache of the project if exist.voidcloseAndDisableTrackChanges(org.eclipse.core.resources.IProject project) Close cache resources by the project and disable track changes of files of the project.default Collection<FeatureValue>computeIfAbsent(org.eclipse.core.resources.IFile file, Function<org.eclipse.core.resources.IFile, Collection<FeatureValue>> mappingFunction) Compute full cache if it absent for the file.default Collection<FeatureValue>computeIfAbsent(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath path, BiFunction<org.eclipse.core.resources.IProject, org.eclipse.core.runtime.IPath, Collection<FeatureValue>> mappingFunction) Compute full cache if it absent for the file.default Collection<FeatureValue>computeIfAbsentInterface(org.eclipse.core.resources.IFile file, Function<org.eclipse.core.resources.IFile, Collection<FeatureValue>> mappingFunction) Compute interface cache if it absent for the file.default Collection<FeatureValue>computeIfAbsentInterface(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath path, BiFunction<org.eclipse.core.resources.IProject, org.eclipse.core.runtime.IPath, Collection<FeatureValue>> mappingFunction) Compute interface cache if it absent for the file.default Collection<FeatureValue>computeIfAbsentModel(org.eclipse.core.resources.IFile file, Function<org.eclipse.core.resources.IFile, Collection<FeatureValue>> mappingFunction) Compute model cache if it absent for the file.default Collection<FeatureValue>computeIfAbsentModel(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath path, BiFunction<org.eclipse.core.resources.IProject, org.eclipse.core.runtime.IPath, Collection<FeatureValue>> mappingFunction) Compute model cache if it absent for the file.default Collection<FeatureValue>computeIfAbsentModelComputed(org.eclipse.core.resources.IFile file, Function<org.eclipse.core.resources.IFile, Collection<FeatureValue>> mappingFunction) Compute model computed cache if it absent for the file.default Collection<FeatureValue>computeIfAbsentModelComputed(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath path, BiFunction<org.eclipse.core.resources.IProject, org.eclipse.core.runtime.IPath, Collection<FeatureValue>> mappingFunction) Compute model computed cache if it absent for the file.voidenableTrackChanges(org.eclipse.core.resources.IProject project) Enable track file changes for the project.default Collection<FeatureValue>getInterface(org.eclipse.core.resources.IFile file) Gets the interface cache for the file.getInterface(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath path) Gets the interface cache data.default Collection<FeatureValue>getModel(org.eclipse.core.resources.IFile file) Gets the model cache data.getModel(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath path) Gets the model cache data.default Collection<FeatureValue>getModelComputed(org.eclipse.core.resources.IFile file) Gets the model computed cache data.getModelComputed(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath path) Gets the model computed cache data.default booleaninvalidate(org.eclipse.core.resources.IFile file) Invalidate cache for the file.booleaninvalidate(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath path) Invalidate cache for the file path of the project.booleaninvalidateAll(org.eclipse.core.resources.IProject project) Invalidate all existing cache for files for the project.booleanisInvalidated(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath path) Checks if the file path of the project is already invalidated (marked as changed and the cache may exist but not valid).default voidputInterface(org.eclipse.core.resources.IFile file, Collection<FeatureValue> keys) Put interface cache data.voidputInterface(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath path, Collection<FeatureValue> keys) Put interface cache data.default voidputModel(org.eclipse.core.resources.IFile file, Collection<FeatureValue> keys) Put model cache data.voidputModel(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath path, Collection<FeatureValue> keys) Put model cache data.default voidputModelComputed(org.eclipse.core.resources.IFile file, Collection<FeatureValue> keys) Put model computed cache data.voidputModelComputed(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath path, Collection<FeatureValue> keys) Put model computed cache data.voidRemoves the cache change listener.Methods inherited from interface com._1c.g5.wiring.IManagedService
activate, deactivate
-
Method Details
-
addChangeListener
Adds the cache change listener. Has no effect if an identical listener is already registered for change events.- Parameters:
listener- the listener, cannot benull.
-
removeChangeListener
Removes the cache change listener. Has no effect if the listener was already removed from registration.- Parameters:
listener- the listener, cannot benull.
-
clear
void clear(org.eclipse.core.resources.IProject project) Clear cache of the project if exist. This method allows to clear any cache data including closed and disabled to track changes projects. Call firstcloseAndDisableTrackChanges(IProject)method before this method to prevent from reopening new cache after clear if needed.- Parameters:
project- the project, cannot benull.
-
enableTrackChanges
void enableTrackChanges(org.eclipse.core.resources.IProject project) Enable track file changes for the project. Cache will not be initialized immediately, but lazy opens with first call of any method.- Parameters:
project- the project, cannot benull.
-
closeAndDisableTrackChanges
void closeAndDisableTrackChanges(org.eclipse.core.resources.IProject project) Close cache resources by the project and disable track changes of files of the project. This method stop cache forever until callenableTrackChanges(IProject)or restart application. All file changes in workspace will be lost if disabled.- Parameters:
project- the project, cannot benull.
-
invalidate
default boolean invalidate(org.eclipse.core.resources.IFile file) Invalidate cache for the file. This method usually calls when file changed in workspace. Clients do not need to call this to track changes manually because this manager responsible for this.- Parameters:
file- the file, cannot benull.- Returns:
- true, if cache existed for the file
-
invalidate
boolean invalidate(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath path) Invalidate cache for the file path of the project. This method usually calls when file changed in workspace. Clients do not need to call this to track changes manually because this manager responsible for this.- Parameters:
project- the project, cannot benull.path- the project-relative file path, cannot benull.- Returns:
- true, if cache existed for the file path of the project
-
isInvalidated
boolean isInvalidated(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath path) Checks if the file path of the project is already invalidated (marked as changed and the cache may exist but not valid).- Parameters:
project- the project, cannot benull.path- the project-relative file path, cannot benull.- Returns:
- true, if the file path is already invalidated
-
invalidateAll
boolean invalidateAll(org.eclipse.core.resources.IProject project) Invalidate all existing cache for files for the project.- Parameters:
project- the project, cannot benull.- Returns:
- true, if cache exited and was invalidated successfully.
-
allInvalidated
Iterator<org.eclipse.core.runtime.IPath> allInvalidated(org.eclipse.core.resources.IProject project) All invalidated file paths of the project that may have cache data.- Parameters:
project- the project, cannot benull.- Returns:
- the iterator of invalidated paths, cannot return
null.
-
allResources
All project file paths that may have cache. Note! That this iterator does not return all project files or may return removed files.- Parameters:
project- the project, cannot benull.- Returns:
- the iterator, cannot return
null.
-
getInterface
Gets the interface cache for the file.- Parameters:
file- the file, cannot benull.- Returns:
- the interface cache, may return
nullif cache not exist.
-
getInterface
Collection<FeatureValue> getInterface(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath path) Gets the interface cache data.- Parameters:
project- the project, cannot benull.path- the path, cannot benull.- Returns:
- the interface cache, may return
nullif cache not exist.
-
putInterface
Put interface cache data.- Parameters:
file- the file, cannot benull.keys- the keys, can benullthis mean to invalidate resource and remove this cache data.
-
putInterface
void putInterface(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath path, Collection<FeatureValue> keys) Put interface cache data.- Parameters:
project- the project, cannot benull.path- the path, cannot benull.keys- the keys, can benullthis mean to invalidate resource and remove this cache data.
-
getModel
Gets the model cache data.- Parameters:
file- the file, cannot benull.- Returns:
- the model cache, may return
nullif cache not exist.
-
getModel
Collection<FeatureValue> getModel(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath path) Gets the model cache data.- Parameters:
project- the project, cannot benull.path- the path, cannot benull.- Returns:
- the model cache, may return
nullif cache not exist.
-
putModel
Put model cache data.- Parameters:
file- the file, cannot benull.keys- the keys, can benullthis mean to invalidate resource and remove this cache data.
-
putModel
void putModel(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath path, Collection<FeatureValue> keys) Put model cache data.- Parameters:
project- the project, cannot benull.path- the path, cannot benull.keys- the keys, can benullthis mean to invalidate resource and remove this cache data.
-
getModelComputed
Gets the model computed cache data.- Parameters:
file- the file, cannot benull.- Returns:
- the model computed cache, may return
nullif cache not exist.
-
getModelComputed
Collection<FeatureValue> getModelComputed(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath path) Gets the model computed cache data.- Parameters:
project- the project, cannot benull.path- the path, cannot benull.- Returns:
- the model computed cache, may return
nullif cache not exist.
-
putModelComputed
Put model computed cache data.- Parameters:
file- the file, cannot benull.keys- the keys, can benullthis mean to invalidate resource and remove this cache data.
-
putModelComputed
void putModelComputed(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath path, Collection<FeatureValue> keys) Put model computed cache data.- Parameters:
project- the project, cannot benull.path- the path, cannot benull.keys- the keys, can benullthis mean to invalidate resource and remove this cache data.
-
computeIfAbsent
default Collection<FeatureValue> computeIfAbsent(org.eclipse.core.resources.IFile file, Function<org.eclipse.core.resources.IFile, Collection<FeatureValue>> mappingFunction) Compute full cache if it absent for the file.- Parameters:
file- the file, cannot benull.mappingFunction- the mapping function, cannot benull. This function should provide full collecting data for the file. Function should not returnnullvalue and should return empty collection instead, howevernullreturned value doesn't take any effect.- Returns:
- the collection of cached data or cache computed if not exist, never returns
null.
-
computeIfAbsent
default Collection<FeatureValue> computeIfAbsent(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath path, BiFunction<org.eclipse.core.resources.IProject, org.eclipse.core.runtime.IPath, Collection<FeatureValue>> mappingFunction) Compute full cache if it absent for the file.- Parameters:
project- the project, cannot benull.path- the path, cannot benull.mappingFunction- the mapping function, cannot benull. This function should provide full collecting data for the file. Function should not returnnullvalue and should return empty collection instead, howevernullreturned value doesn't take any effect.- Returns:
- the collection of cached data or cache computed if not exist, never returns
null.
-
computeIfAbsentInterface
default Collection<FeatureValue> computeIfAbsentInterface(org.eclipse.core.resources.IFile file, Function<org.eclipse.core.resources.IFile, Collection<FeatureValue>> mappingFunction) Compute interface cache if it absent for the file.- Parameters:
file- the file, cannot benull.mappingFunction- the mapping function, cannot benull. This function should provide only interface collecting data for the file. Function should not returnnullvalue and should return empty collection instead, howevernullreturned value doesn't take any effect.- Returns:
- the collection of cached data or cache computed if not exist, never returns
null.
-
computeIfAbsentInterface
default Collection<FeatureValue> computeIfAbsentInterface(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath path, BiFunction<org.eclipse.core.resources.IProject, org.eclipse.core.runtime.IPath, Collection<FeatureValue>> mappingFunction) Compute interface cache if it absent for the file.- Parameters:
project- the project, cannot benull.path- the path, cannot benull.mappingFunction- the mapping function, cannot benull. This function should provide only interface collecting data for the file. Function should not returnnullvalue and should return empty collection instead, howevernullreturned value doesn't take any effect.- Returns:
- the collection of cached data or cache computed if not exist, never returns
null.
-
computeIfAbsentModel
default Collection<FeatureValue> computeIfAbsentModel(org.eclipse.core.resources.IFile file, Function<org.eclipse.core.resources.IFile, Collection<FeatureValue>> mappingFunction) Compute model cache if it absent for the file.- Parameters:
file- the file, cannot benull.mappingFunction- the mapping function, cannot benull. This function should provide only model collecting data for the file. Function should not returnnullvalue and should return empty collection instead, howevernullreturned value doesn't take any effect.- Returns:
- the collection of cached data or cache computed if not exist, never returns
null.
-
computeIfAbsentModel
default Collection<FeatureValue> computeIfAbsentModel(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath path, BiFunction<org.eclipse.core.resources.IProject, org.eclipse.core.runtime.IPath, Collection<FeatureValue>> mappingFunction) Compute model cache if it absent for the file.- Parameters:
project- the project, cannot benull.path- the path, cannot benull.mappingFunction- the mapping function, cannot benull. This function should provide only model collecting data for the file. Function should not returnnullvalue and should return empty collection instead, howevernullreturned value doesn't take any effect.- Returns:
- the collection of cached data or cache computed if not exist, never returns
null.
-
computeIfAbsentModelComputed
default Collection<FeatureValue> computeIfAbsentModelComputed(org.eclipse.core.resources.IFile file, Function<org.eclipse.core.resources.IFile, Collection<FeatureValue>> mappingFunction) Compute model computed cache if it absent for the file.- Parameters:
file- the file, cannot benull.mappingFunction- the mapping function, cannot benull. This function should provide model computed collecting data for the file. Function should not returnnullvalue and should return empty collection instead, howevernullreturned value doesn't take any effect.- Returns:
- the collection of cached data or cache computed if not exist, never returns
null.
-
computeIfAbsentModelComputed
default Collection<FeatureValue> computeIfAbsentModelComputed(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath path, BiFunction<org.eclipse.core.resources.IProject, org.eclipse.core.runtime.IPath, Collection<FeatureValue>> mappingFunction) Compute model computed cache if it absent for the file.- Parameters:
project- the project, cannot benull.path- the path, cannot benull.mappingFunction- the mapping function, cannot benull. This function should provide model computed collecting data for the file. Function should not returnnullvalue and should return empty collection instead, howevernullreturned value doesn't take any effect.- Returns:
- the collection of cached data or cache computed if not exist, never returns
null.
-