Interface SessionFactory<DC,MV,AV,SC>
- Type Parameters:
DC- the deployment context typeMV- the meta-data value typeAV- the attributes value typeSC- the session context type
- All Superinterfaces:
AutoCloseable, BiCacheEntryCreator<String, MV, AV, Map.Entry<Instant, Optional<Duration>>>, BiCacheEntryLocator<String,MV, AV>, CacheEntryCreator<String, Map.Entry<MV, AV>, Map.Entry<Instant, Optional<Duration>>>, CacheEntryLocator<String, Map.Entry<MV, AV>>, CacheEntryRemover<String>, ImmutableSessionFactory<MV, AV>, ImmutableSessionFactoryConfiguration<MV, AV>, SessionFactoryConfiguration<DC, MV, AV, SC>
- All Known Implementing Classes:
CompositeSessionFactory, HotRodSessionFactory
public interface SessionFactory<DC,MV,AV,SC>
extends ImmutableSessionFactory<MV,AV>, SessionFactoryConfiguration<DC,MV,AV,SC>, BiCacheEntryCreator<String, MV, AV, Map.Entry<Instant, Optional<Duration>>>, CacheEntryRemover<String>, AutoCloseable
Factory for creating sessions. Encapsulates the cache mapping strategy for sessions.
- Author:
- Paul Ferraro
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidclose()default Map.Entry<CompletionStage<MV>, CompletionStage<AV>> Creates a value in the cache, if it does not already exist.Creates a session from the specified identifier, metadata, attributes, and context.default CompletionStage<Void> purgeAsync(String id) Removes the specified entry from the cache.default CompletionStage<Void> removeAsync(String id) Removes the specified entry from the cache.Methods inherited from interface BiCacheEntryCreator
createValueAsyncMethods inherited from interface BiCacheEntryLocator
findValueAsync, tryValueAsyncMethods inherited from interface CacheEntryCreator
createValueMethods inherited from interface CacheEntryLocator
findValue, tryValueMethods inherited from interface CacheEntryRemover
purge, removeMethods inherited from interface ImmutableSessionFactory
createImmutableSession, createImmutableSession, findEntry, tryEntryMethods inherited from interface ImmutableSessionFactoryConfiguration
getCachePropertiesMethods inherited from interface SessionFactoryConfiguration
getSessionAttributesFactory, getSessionContextFactory, getSessionMetaDataFactory
-
Method Details
-
createEntry
default Map.Entry<CompletionStage<MV>, CompletionStage<AV>> createEntry(String id, Map.Entry<Instant, Optional<Duration>> context) Description copied from interface:BiCacheEntryCreatorCreates a value in the cache, if it does not already exist.- Specified by:
createEntryin interfaceBiCacheEntryCreator<DC,MV, AV, SC> - Parameters:
id- the cache entry identifier.context- the creation context- Returns:
- the new value, or the existing value the cache entry already exists.
-
removeAsync
Description copied from interface:CacheEntryRemoverRemoves the specified entry from the cache.- Specified by:
removeAsyncin interfaceCacheEntryRemover<DC>- Parameters:
id- the cache entry identifier.- Returns:
- true, if the entry was removed.
-
purgeAsync
Description copied from interface:CacheEntryRemoverRemoves the specified entry from the cache.- Specified by:
purgeAsyncin interfaceCacheEntryRemover<DC>- Parameters:
id- the cache entry identifier.- Returns:
- true, if the entry was removed.
-
createSession
Creates a session from the specified identifier, metadata, attributes, and context.- Parameters:
id- a session identifierentry- a map entry containing the metadata and attributes of the sessioncontext- the session context- Returns:
- a session from the specified identifier, metadata, attributes, and context.
-
close
default void close()- Specified by:
closein interfaceAutoCloseable
-