T - type of objects this factory creates.K - type of SharedResourceKey this factory uses.public interface SharedResourceFactory<T,K extends SharedResourceKey,S extends ScopeType<S>>
ScopeInstance specific objects.| Modifier and Type | Method and Description |
|---|---|
SharedResourceFactoryResponse<T> |
createResource(SharedResourcesBroker<S> broker,
ScopedConfigView<S,K> config)
Requests an object for the provided
SharedResourceKey, with the provided configuration. |
S |
getAutoScope(SharedResourcesBroker<S> broker,
ConfigView<S,K> config) |
String |
getName() |
String getName()
SharedResourceFactoryResponse<T> createResource(SharedResourcesBroker<S> broker, ScopedConfigView<S,K> config) throws NotConfiguredException
SharedResourceKey, with the provided configuration.
The factory can return a variety of responses:
* ResourceEntry: a newly built resource of type T for the input key and scope.
* ResourceCoordinate: the coordinates (factory, key, scope) of another resource of type T that
should be used instead (this allows, for example, to use a different factory, or always return a global scoped object.)NotConfiguredExceptionS getAutoScope(SharedResourcesBroker<S> broker, ConfigView<S,K> config)
ScopeType at which an auto scoped resource should be created. A good default is to return
broker.selfScope()