Class MemoryCache
java.lang.Object
io.helidon.webserver.staticcontent.MemoryCache
- All Implemented Interfaces:
RuntimeType.Api<MemoryCacheConfig>
Memory cache to allow in-memory storage of static content, rather than reading it from file system each time the
resource is requested.
-
Method Summary
Modifier and TypeMethodDescriptionstatic MemoryCacheConfig.Builder
builder()
A new builder to configure and create a memory cache.static MemoryCache
create()
Create an in-memory cache with zero capacity.static MemoryCache
create
(MemoryCacheConfig config) Create a new memory cache from its configuration.static MemoryCache
create
(Consumer<MemoryCacheConfig.Builder> consumer) Create a new memory cache customizing its configuration.The prototype as it was received when creating this runtime object instance.
-
Method Details
-
builder
A new builder to configure and create a memory cache.- Returns:
- a new fluent API builder
-
create
Create a new memory cache from its configuration.- Parameters:
config
- memory cache configuration- Returns:
- a new configured memory cache
-
create
Create a new memory cache customizing its configuration.- Parameters:
consumer
- configuration consumer- Returns:
- a new configured memory cache
-
create
Create an in-memory cache with zero capacity. Onlycache(StaticContentHandler, String, CachedHandlerInMemory)
will be stored in it, as these are considered required cache records. All calls tocache(StaticContentHandler, String, int, java.util.function.Supplier)
will return empty.- Returns:
- a new memory cache with capacity set to zero
-
prototype
Description copied from interface:RuntimeType.Api
The prototype as it was received when creating this runtime object instance.- Specified by:
prototype
in interfaceRuntimeType.Api<MemoryCacheConfig>
- Returns:
- prototype object used to create this instance
-