public class SharedResourcesBrokerImpl<S extends ScopeType<S>> extends Object implements SharedResourcesBroker<S>
SharedResourcesBroker using a DefaultBrokerCache for storing shared objects.
Instances of this broker must be created as follows:
SharedResourcesBrokerImplrootBroker = SharedResourcesBrokerFactory.createDefaultTopLevelBroker(myConfig); SharedResourcesBrokerImpl scopeBroker = topBroker.newSubscopedBuilder(scope, "scopeId").build();
| Modifier and Type | Class and Description |
|---|---|
class |
SharedResourcesBrokerImpl.SubscopedBrokerBuilder
A builder used to create a descendant
SharedResourcesBrokerImpl with the same backing DefaultBrokerCache. |
| Modifier and Type | Method and Description |
|---|---|
<T,K extends SharedResourceKey> |
bindSharedResourceAtScope(SharedResourceFactory<T,K,S> factory,
K key,
S scopeType,
T instance) |
void |
close() |
boolean |
equals(Object o) |
<K extends SharedResourceKey> |
getConfigView(S scope,
K key,
String factoryName)
Get a
ConfigView for the input scope, key, and factory. |
ScopeInstance<S> |
getScope(S scopeType) |
<T,K extends SharedResourceKey> |
getSharedResource(SharedResourceFactory<T,K,S> factory,
K key) |
<T,K extends SharedResourceKey> |
getSharedResourceAtScope(SharedResourceFactory<T,K,S> factory,
K key,
S scope) |
int |
hashCode() |
SharedResourcesBrokerImpl.SubscopedBrokerBuilder |
newSubscopedBuilder(ScopeInstance<S> subscope)
Get a builder to create a descendant
SharedResourcesBrokerImpl (i.e. |
ScopeInstance<S> |
selfScope() |
public ScopeInstance<S> selfScope()
selfScope in interface SharedResourcesBroker<S extends ScopeType<S>>public ScopeInstance<S> getScope(S scopeType) throws NoSuchScopeException
getScope in interface SharedResourcesBroker<S extends ScopeType<S>>NoSuchScopeExceptionpublic <T,K extends SharedResourceKey> T getSharedResource(SharedResourceFactory<T,K,S> factory, K key) throws NotConfiguredException
getSharedResource in interface SharedResourcesBroker<S extends ScopeType<S>>NotConfiguredExceptionpublic <T,K extends SharedResourceKey> T getSharedResourceAtScope(SharedResourceFactory<T,K,S> factory, K key, S scope) throws NotConfiguredException, NoSuchScopeException
getSharedResourceAtScope in interface SharedResourcesBroker<S extends ScopeType<S>>NotConfiguredExceptionNoSuchScopeExceptionpublic <T,K extends SharedResourceKey> void bindSharedResourceAtScope(SharedResourceFactory<T,K,S> factory, K key, S scopeType, T instance) throws NoSuchScopeException
bindSharedResourceAtScope in interface SharedResourcesBroker<S extends ScopeType<S>>NoSuchScopeExceptionpublic <K extends SharedResourceKey> KeyedScopedConfigViewImpl<S,K> getConfigView(S scope, K key, String factoryName)
ConfigView for the input scope, key, and factory.public SharedResourcesBrokerImpl.SubscopedBrokerBuilder newSubscopedBuilder(ScopeInstance<S> subscope)
SharedResourcesBrokerImpl (i.e. its leaf scope is a descendant of this
broker's leaf scope) and the same backing DefaultBrokerCache.newSubscopedBuilder in interface SharedResourcesBroker<S extends ScopeType<S>>subscope - the ScopeInstance of the new SharedResourcesBroker.SharedResourcesBrokerImpl.SubscopedBrokerBuilder.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface SharedResourcesBroker<S extends ScopeType<S>>IOException