public abstract class AbstractWrapperStoreProvider extends java.lang.Object implements Store.Provider
Modifier | Constructor and Description |
---|---|
protected |
AbstractWrapperStoreProvider(java.lang.Class<? extends ServiceConfiguration<?,?>>... requiredConfigurationTypes) |
Modifier and Type | Method and Description |
---|---|
<K,V> Store<K,V> |
createStore(Store.Configuration<K,V> storeConfig,
ServiceConfiguration<?,?>... serviceConfigs)
Creates a new Store instance
|
protected Store.Provider |
getUnderlyingStoreProvider(java.util.Set<ResourceType<?>> resources,
java.util.List<ServiceConfiguration<?,?>> configs) |
void |
initStore(Store<?,?> resource)
Informs this Provider, a Store it created is being initialized
|
int |
rank(java.util.Set<ResourceType<?>> resourceTypes,
java.util.Collection<ServiceConfiguration<?,?>> serviceConfigs)
Gets the internal ranking for the
Store instances provided by this Provider of the store's
ability to handle the specified resources. |
void |
releaseStore(Store<?,?> resource)
Informs this Provider, a Store it created is being disposed (i.e.
|
void |
start(ServiceProvider<Service> serviceProvider)
Start this service using the provided configuration and
ServiceProvider . |
void |
stop()
Stops this service.
|
protected abstract <K,V> Store<K,V> |
wrap(Store<K,V> store,
Store.Configuration<K,V> storeConfig,
ServiceConfiguration<?,?>... serviceConfigs) |
protected int |
wrapperPriority() |
protected abstract int |
wrapperRank() |
@SafeVarargs protected AbstractWrapperStoreProvider(java.lang.Class<? extends ServiceConfiguration<?,?>>... requiredConfigurationTypes)
public <K,V> Store<K,V> createStore(Store.Configuration<K,V> storeConfig, ServiceConfiguration<?,?>... serviceConfigs)
Store.Provider
createStore
in interface Store.Provider
storeConfig
- the basic configuration for the StoreserviceConfigs
- the configurations the Provider may need to configure the Storeprotected Store.Provider getUnderlyingStoreProvider(java.util.Set<ResourceType<?>> resources, java.util.List<ServiceConfiguration<?,?>> configs)
public int rank(java.util.Set<ResourceType<?>> resourceTypes, java.util.Collection<ServiceConfiguration<?,?>> serviceConfigs)
Store.Provider
Store
instances provided by this Provider
of the store's
ability to handle the specified resources. A higher rank value indicates a more capable Store
.rank
in interface Store.Provider
resourceTypes
- the set of ResourceType
s for the store to handleserviceConfigs
- the collection of ServiceConfiguration
instances that may contribute
to the rankingStore
created by this Provider
to handle the resource types specified by resourceTypes
; a rank of 0 indicates the store
can not handle all types specified in resourceTypes
protected abstract int wrapperRank()
protected int wrapperPriority()
protected abstract <K,V> Store<K,V> wrap(Store<K,V> store, Store.Configuration<K,V> storeConfig, ServiceConfiguration<?,?>... serviceConfigs)
public void releaseStore(Store<?,?> resource)
Store.Provider
releaseStore
in interface Store.Provider
resource
- the store to releasepublic void initStore(Store<?,?> resource)
Store.Provider
initStore
in interface Store.Provider
resource
- the store to initializepublic void start(ServiceProvider<Service> serviceProvider)
Service
ServiceProvider
.
The service provider allows a service to retrieve and use other services.
A Service
retrieved at this stage may not yet be started. The recommended usage pattern therefore, is to keep a
reference to the dependent Service
but use it only when specific methods are invoked on subtypes.