Package com.scaleout.client
Class ServiceEvents
java.lang.Object
com.scaleout.client.ServiceEvents
Manages event callback registration for
Cache
instances.-
Method Summary
Modifier and TypeMethodDescriptionstatic <K,
V> void setEraseObjectHandler
(Cache<K, V> cache, CacheEntryEraseHandler<K, V> eraseHandler) Sets aCacheEntryEraseHandler
for the target cache.static <K,
V> void setExpirationHandler
(Cache<K, V> cache, CacheEntryExpirationHandler<K, V> listener) Sets aCacheEntryExpirationHandler
for the targetCache
.static <K,
V> void setLoadObjectHandler
(Cache<K, V> cache, ValueFactory<K, V> valueFactory) Sets aValueFactory
for loading objects into the targetCache
.static <K,
V> void setStoreObjectHandler
(Cache<K, V> cache, CacheEntryStoreHandler<K, V> storeHandler) Sets aCacheEntryStoreHandler
for the target cache.
-
Method Details
-
setExpirationHandler
public static <K,V> void setExpirationHandler(Cache<K, V> cache, CacheEntryExpirationHandler<K, throws ServiceEventsExceptionV> listener) Sets aCacheEntryExpirationHandler
for the targetCache
.- Type Parameters:
K
- the key type.V
- the value type.- Parameters:
cache
- the target cache.listener
- the expiration listener.- Throws:
ServiceEventsException
- if an exception occurs while setting the expiration listener.
-
setLoadObjectHandler
public static <K,V> void setLoadObjectHandler(Cache<K, V> cache, ValueFactory<K, throws ServiceEventsExceptionV> valueFactory) Sets aValueFactory
for loading objects into the targetCache
.- Type Parameters:
K
- the key type.V
- the value type.- Parameters:
cache
- the target cache.valueFactory
- the value factory callback.- Throws:
ServiceEventsException
- if an exception occurs while setting the value factory.
-
setStoreObjectHandler
public static <K,V> void setStoreObjectHandler(Cache<K, V> cache, CacheEntryStoreHandler<K, throws ServiceEventsExceptionV> storeHandler) Sets aCacheEntryStoreHandler
for the target cache.- Type Parameters:
K
- the key type.V
- the value type.- Parameters:
cache
- the target cache.storeHandler
- the store handler callback.- Throws:
ServiceEventsException
- if an exception occurs while setting the store handler.
-
setEraseObjectHandler
public static <K,V> void setEraseObjectHandler(Cache<K, V> cache, CacheEntryEraseHandler<K, throws ServiceEventsExceptionV> eraseHandler) Sets aCacheEntryEraseHandler
for the target cache.- Type Parameters:
K
- the key type.V
- the value type.- Parameters:
cache
- the target cache.eraseHandler
- the eraseHandler callback.- Throws:
ServiceEventsException
- if an exception occurs while setting the eraseHandler.
-