Interface SessionFactory<C,MV,AV,SC>
- Type Parameters:
C- the session manager context typeMV- the meta-data value typeAV- the attributes value typeSC- the session context type
- All Superinterfaces:
AutoCloseable,BiCacheEntryCreator<String,,MV, AV, Duration> BiCacheEntryLocator<String,,MV, AV> CacheEntryCreator<String,,Map.Entry<MV, AV>, Duration> CacheEntryLocator<String,,Map.Entry<MV, AV>> CacheEntryRemover<String>,ImmutableSessionFactory<MV,AV>
- All Known Implementing Classes:
CompositeSessionFactory,HotRodSessionFactory
public interface SessionFactory<C,MV,AV,SC>
extends ImmutableSessionFactory<MV,AV>, BiCacheEntryCreator<String,MV,AV,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>> createEntry(String id, Duration context) Creates a value in the cache, if it does not already exist.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 org.wildfly.clustering.cache.BiCacheEntryCreator
createValueAsyncMethods inherited from interface org.wildfly.clustering.cache.BiCacheEntryLocator
findValueAsync, tryValueAsyncMethods inherited from interface org.wildfly.clustering.cache.CacheEntryCreator
createValueMethods inherited from interface org.wildfly.clustering.cache.CacheEntryLocator
findValue, tryValueMethods inherited from interface org.wildfly.clustering.cache.CacheEntryRemover
purge, removeMethods inherited from interface org.wildfly.clustering.session.cache.ImmutableSessionFactory
createImmutableSession, createImmutableSession, findEntry, getCacheProperties, tryEntry
-
Method Details
-
getMetaDataFactory
SessionMetaDataFactory<MV> getMetaDataFactory()- Specified by:
getMetaDataFactoryin interfaceImmutableSessionFactory<C,MV>
-
getAttributesFactory
SessionAttributesFactory<C,AV> getAttributesFactory()- Specified by:
getAttributesFactoryin interfaceImmutableSessionFactory<C,MV>
-
getContextFactory
-
createEntry
Description copied from interface:BiCacheEntryCreatorCreates a value in the cache, if it does not already exist.- Specified by:
createEntryin interfaceBiCacheEntryCreator<C,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<C>- 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<C>- Parameters:
id- the cache entry identifier.- Returns:
- true, if the entry was removed.
-
createSession
-
close
default void close()- Specified by:
closein interfaceAutoCloseable
-