Class HotRodUserContextFactory<PC,PV,TC>
java.lang.Object
org.wildfly.clustering.session.infinispan.remote.user.HotRodUserContextFactory<PC,PV,TC>
- Type Parameters:
PC- the persistent context typePV- the marshalled persistent context typeTC- the transient context type
- All Implemented Interfaces:
CacheEntryCreator<String, UserContext<PV,TC>, PC>, CacheEntryLocator<String, UserContext<PV, TC>>, CacheEntryRemover<String>, UserContextFactory<UserContext<PV, TC>, PC, TC>
public class HotRodUserContextFactory<PC,PV,TC>
extends Object
implements UserContextFactory<UserContext<PV,TC>, PC, TC>
The user context factory.
- Author:
- Paul Ferraro
-
Constructor Summary
ConstructorsConstructorDescriptionHotRodUserContextFactory(RemoteCacheConfiguration configuration, Marshaller<PC, PV> marshaller, Supplier<TC> contextFactory) Creates a user context factory -
Method Summary
Modifier and TypeMethodDescriptioncreateUserContext(UserContext<PV, TC> entry) Creates a user context from the specified cache valuecreateValueAsync(String id, PC context) Creates a value in the cache, if it does not already exist.findValueAsync(String id) Locates the value in the cache with the specified identifier.removeAsync(String id) Removes the specified entry from the cache.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CacheEntryCreator
createValueMethods inherited from interface CacheEntryLocator
findValue, tryValue, tryValueAsyncMethods inherited from interface CacheEntryRemover
purge, purgeAsync, remove
-
Constructor Details
-
HotRodUserContextFactory
public HotRodUserContextFactory(RemoteCacheConfiguration configuration, Marshaller<PC, PV> marshaller, Supplier<TC> contextFactory) Creates a user context factory- Parameters:
configuration- the configuration of the associated cachemarshaller- the marshaller for the persistent context of the usercontextFactory- the user context factory
-
-
Method Details
-
createValueAsync
Description copied from interface:CacheEntryCreatorCreates a value in the cache, if it does not already exist.- Specified by:
createValueAsyncin interfaceCacheEntryCreator<PC,PV, TC> - Parameters:
id- the cache entry identifier.context- the context of the created value- Returns:
- the new value, or the existing value the cache entry already exists.
-
findValueAsync
Description copied from interface:CacheEntryLocatorLocates the value in the cache with the specified identifier.- Specified by:
findValueAsyncin interfaceCacheEntryLocator<PC,PV> - Parameters:
id- the cache entry identifier- Returns:
- the value of the cache entry, or null if not found.
-
removeAsync
Description copied from interface:CacheEntryRemoverRemoves the specified entry from the cache.- Specified by:
removeAsyncin interfaceCacheEntryRemover<PC>- Parameters:
id- the cache entry identifier.- Returns:
- true, if the entry was removed.
-
createUserContext
Description copied from interface:UserContextFactoryCreates a user context from the specified cache value- Specified by:
createUserContextin interfaceUserContextFactory<PC,PV, TC> - Parameters:
entry- the cache value containing the user context- Returns:
- a user context from the specified cache value
-