public class ForwardingStoreService extends Object implements StoreService
StoreService
which creates primitive stores which delegate to another, generic store.StoreService
Constructor and Description |
---|
ForwardingStoreService(StoreService toForward)
Constructs the service.
|
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).
|
StoreService |
getOriginal()
Gets the original, generic capable, service.
|
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.
|
int |
order()
Returns an arbitrary order for this service.
|
<K extends Comparable<K>,V> |
provideGenericStore(Class<K> keyClass,
Class<V> valueClass)
This is called to provide a new store instance for the provided configuration.
|
<V> LongObjStore<V> |
provideLongObjStore(Class<V> valueClass)
This is called to provide a new store instance with a long key and object values.
|
public ForwardingStoreService(StoreService toForward)
toForward
- The generic store service to forward to.public StoreService getOriginal()
public int order()
StoreService
Integer.MAX_VALUE
= lowest priority, Integer.MIN_VALUE
= highest priority.order
in interface StoreService
public boolean hasGenericStores()
StoreService
hasGenericStores
in interface StoreService
Store
public <K extends Comparable<K>,V> Store<K,V> provideGenericStore(Class<K> keyClass, Class<V> valueClass)
StoreService
provideGenericStore
in interface StoreService
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.public boolean hasLongObjStores()
StoreService
hasLongObjStores
in interface StoreService
LongObjStore
public <V> LongObjStore<V> provideLongObjStore(Class<V> valueClass)
StoreService
provideLongObjStore
in interface StoreService
V
- The value type, these follow
JavaBean conventions.valueClass
- The class of the values.public void init(StoreContext context)
StoreService
init
in interface StoreService
context
- Some context about the environment which this service is being utilized in.public Mono<Void> dispose()
StoreService
dispose
in interface StoreService