Class BslContentCacheManagerImpl
java.lang.Object
com.e1c.langtool.v8.dt.bsl.i18n.internal.cache.BslContentCacheManagerImpl
- All Implemented Interfaces:
IManagedService,BslContentCacheManager
@LifecycleService(name="BslContentCacheManager")
public class BslContentCacheManagerImpl
extends Object
implements BslContentCacheManager
Cache manager holds cached bsl content in MapDB store. The store evicts and removes every time when project is
closed or stoped on IDE shutdown.
-
Field Summary
Fields inherited from interface com.e1c.langtool.v8.dt.bsl.i18n.cache.BslContentCacheManager
SERVICE_NAME -
Constructor Summary
ConstructorsConstructorDescriptionBslContentCacheManagerImpl(IStorageSettingsManager storageSettingsManager, ITranslationStorageManager storageManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()voidaddListener(IBslCacheInvalidationListener listener) Adds the listener that will be notified of cache invalidation event by file.voidvoiddispose(ProjectContext lifecycleContext) get(org.eclipse.core.resources.IFile file) Retrieve cached content for givenfile.voidinit(ProjectContext projectContext) voidinvalidate(org.eclipse.core.resources.IFile file) Invalidate cache for givenfile.voidStorecontentassociated withfile.voidremoveListener(IBslCacheInvalidationListener listener) Removes the cache invalidation listener.
-
Constructor Details
-
BslContentCacheManagerImpl
@Inject public BslContentCacheManagerImpl(IStorageSettingsManager storageSettingsManager, ITranslationStorageManager storageManager)
-
-
Method Details
-
init
-
dispose
-
get
Description copied from interface:BslContentCacheManagerRetrieve cached content for givenfile. If cache has no content for given file thennullwill be returned.- Specified by:
getin interfaceBslContentCacheManager- Parameters:
file- the file for whitch retrive cached content, cannot benull- Returns:
- Cached content or
nullif no content found in cache.
-
invalidate
public void invalidate(org.eclipse.core.resources.IFile file) Description copied from interface:BslContentCacheManagerInvalidate cache for givenfile.- Specified by:
invalidatein interfaceBslContentCacheManager- Parameters:
file- File to be invalidated, cannot benull
-
put
Description copied from interface:BslContentCacheManagerStorecontentassociated withfile.- Specified by:
putin interfaceBslContentCacheManager- Parameters:
file- File to be added to the cache, cannot benullcontent- Cached file content, cannot benull
-
addListener
Description copied from interface:BslContentCacheManagerAdds the listener that will be notified of cache invalidation event by file.- Specified by:
addListenerin interfaceBslContentCacheManager- Parameters:
listener- the listener, cannot benull
-
removeListener
Description copied from interface:BslContentCacheManagerRemoves the cache invalidation listener.- Specified by:
removeListenerin interfaceBslContentCacheManager- Parameters:
listener- the listener, cannot benull
-
activate
public void activate()- Specified by:
activatein interfaceIManagedService
-
deactivate
public void deactivate()- Specified by:
deactivatein interfaceIManagedService
-