Class XmlTransformerCacheService
java.lang.Object
fr.paris.lutece.portal.service.html.XmlTransformerCacheService
- All Implemented Interfaces:
CacheableService<String,,String> LuteceService
@ApplicationScoped
public class XmlTransformerCacheService
extends Object
implements CacheableService<String,String>
XmlTransformerCacheService
- Since:
- v 3.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidenableCache(boolean bEnable) Enables or disables the cache.intGets the number of items currently in the cache.getInfos()Returns cache information.getKeys()Gets all keys in the cache.getName()Returns the Service namevoidinitializedService(jakarta.servlet.ServletContext context) This method observes the initialization of theApplicationScopedcontext and registers an instance ofXmlTransformerCacheServicewith theCacheService.booleanGets the current cache status.booleanCan the cache be reset by automatic caches resetsvoidResets the cache.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface fr.paris.lutece.portal.service.cache.CacheableService
getMaxElements, getMemorySize, getTimeToLive
-
Constructor Details
-
XmlTransformerCacheService
public XmlTransformerCacheService()
-
-
Method Details
-
getName
Returns the Service name- Specified by:
getNamein interfaceLuteceService- Returns:
- The name as a String
-
isCacheEnable
public boolean isCacheEnable()Gets the current cache status.- Specified by:
isCacheEnablein interfaceCacheableService<String,String> - Returns:
- true if the cache is enabled, otherwise false
-
getCacheSize
public int getCacheSize()Gets the number of items currently in the cache.- Specified by:
getCacheSizein interfaceCacheableService<String,String> - Returns:
- the number of items currently in the cache
-
resetCache
public void resetCache()Resets the cache.- Specified by:
resetCachein interfaceCacheableService<String,String>
-
enableCache
public void enableCache(boolean bEnable) Enables or disables the cache.- Specified by:
enableCachein interfaceCacheableService<String,String> - Parameters:
bEnable- true to enable, false to disable
-
getKeys
Gets all keys in the cache.- Specified by:
getKeysin interfaceCacheableService<String,String> - Returns:
- a list of all keys in the cache
-
getInfos
Returns cache information.- Specified by:
getInfosin interfaceCacheableService<String,String> - Returns:
- cache information
-
initializedService
public void initializedService(@Observes @Initialized(jakarta.enterprise.context.ApplicationScoped.class) jakarta.servlet.ServletContext context) This method observes the initialization of theApplicationScopedcontext and registers an instance ofXmlTransformerCacheServicewith theCacheService.This method is triggered automatically by CDI when the
ApplicationScopedcontext is initialized, which typically occurs during the startup of the application server.- Parameters:
context- theServletContextthat is initialized. This parameter is observed and injected automatically by CDI when theApplicationScopedcontext is initialized.
-
isPreventGlobalReset
public boolean isPreventGlobalReset()Description copied from interface:CacheableServiceCan the cache be reset by automatic caches resets- Specified by:
isPreventGlobalResetin interfaceCacheableService<String,String> - Returns:
- true is the cache can be reset by automatic / massive caches resets, false otherwise
-