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.ProvidercreateStore in interface Store.ProviderstoreConfig - 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.ProviderStore 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.ProviderresourceTypes - the set of ResourceTypes 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 resourceTypesprotected 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.ProviderreleaseStore in interface Store.Providerresource - the store to releasepublic void initStore(Store<?,?> resource)
Store.ProviderinitStore in interface Store.Providerresource - the store to initializepublic void start(ServiceProvider<Service> serviceProvider)
ServiceServiceProvider.
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.