@Service
public interface StoreService
StoreServiceLoader
as a Java service.ServiceLoader
,
Servicer,
StoreServiceLoader
,
NoOpStoreService
Modifier and Type | Method and Description |
---|---|
Mono<Void> |
dispose()
This is a lifecycle method called to signal that a store should dispose of any resources due to
an abrupt close (hard reconnect or disconnect).
|
boolean |
hasGenericStores()
This is used to check if this service can provide generic stores.
|
boolean |
hasLongObjStores()
This is used to check if this service can provide long-object stores.
|
void |
init(StoreContext context)
This is a lifecycle method called to signal that a store should allocate any necessary resources.
|
default int |
order()
Returns an arbitrary order for this service.
|
<K extends Comparable<K>,V extends Serializable> |
provideGenericStore(Class<K> keyClass,
Class<V> valueClass)
This is called to provide a new store instance for the provided configuration.
|
<V extends Serializable> |
provideLongObjStore(Class<V> valueClass)
This is called to provide a new store instance with a long key and object values.
|
default int order()
Integer.MAX_VALUE
= lowest priority, Integer.MIN_VALUE
= highest priority.boolean hasGenericStores()
Store
<K extends Comparable<K>,V extends Serializable> Store<K,V> provideGenericStore(Class<K> keyClass, Class<V> valueClass)
K
- The key type which provides a 1:1 mapping to the value type. This type is also expected to be
Comparable
in order to allow for range operations.V
- The value type, these follow
JavaBean conventions.keyClass
- The class of the keys.valueClass
- The class of the values.boolean hasLongObjStores()
LongObjStore
<V extends Serializable> LongObjStore<V> provideLongObjStore(Class<V> valueClass)
V
- The value type, these follow
JavaBean conventions.valueClass
- The class of the values.void init(StoreContext context)
context
- Some context about the environment which this service is being utilized in.