Package play.cache.caffeine
Interface CaffeineCacheComponents
-
- All Superinterfaces:
ConfigurationComponents
,PekkoComponents
public interface CaffeineCacheComponents extends ConfigurationComponents, PekkoComponents
Caffeine Cache Java Components for compile time injection.Usage:
public class MyComponents extends BuiltInComponentsFromContext implements CaffeineCacheComponents { public MyComponents(ApplicationLoader.Context context) { super(context); } // A service class that depends on cache APIs public CachedService someService() { // defaultCacheApi is provided by CaffeineCacheComponents return new CachedService(defaultCacheApi()); } // Another service that depends on a specific named cache public AnotherService someService() { // cacheApi provided by CaffeineCacheComponents and // "anotherService" is the name of the cache. return new CachedService(cacheApi("anotherService")); } // other methods }
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default AsyncCacheApi
cacheApi(String name)
default AsyncCacheApi
defaultCacheApi()
-
Methods inherited from interface play.components.ConfigurationComponents
config, configuration
-
Methods inherited from interface play.components.PekkoComponents
actorSystem, coordinatedShutdown, executionContext, materializer
-
-
-
-
Method Detail
-
cacheApi
default AsyncCacheApi cacheApi(String name)
-
defaultCacheApi
default AsyncCacheApi defaultCacheApi()
-
-