T
- element type of this registry@Multibinding public interface Registry<T>
DefinitionType
;
these definition can come from various sources.Modifier and Type | Interface and Description |
---|---|
static class |
Registry.InvalidDefinitionException
Thrown by a registry when the underlying bean is not successfully resolved, not valid, or not enabled.
|
static class |
Registry.NoSuchDefinitionException
Thrown by a registry when it doesn't hold an entity that is asked for.
|
Modifier and Type | Method and Description |
---|---|
Collection<T> |
getAllDefinitions()
Returns all resolvable, valid and enabled definitions.
|
Collection<DefinitionMetadata> |
getAllMetadata() |
Collection<DefinitionProvider<T>> |
getAllProviders() |
DefinitionProvider<T> |
getProvider(DefinitionMetadata id)
Gets a definition provider by its complete id object.
|
DefinitionProvider<T> |
getProvider(String referenceId)
Convenience method, where the given String is what the corresponding
DefinitionMetadata.getReferenceId() would return. |
DefinitionMetadataBuilder |
newMetadataBuilder()
Implementations of
DefinitionMetadataBuilder determine how referenceId strings for this registry are generated. |
DefinitionQuery<T> |
query()
Implementations are expected to return a subtype of DefinitionQuery that's able to callback its registry to perform the search.
|
void |
register(DefinitionProvider<T> definitionProvider) |
void |
start()
Call start() once sources have been added; addSource() should however call source.startWith(registry) so maybe not ?
|
DefinitionType |
type() |
Set<DefinitionMetadata> |
unregisterAndRegister(Collection<DefinitionMetadata> toRemove,
Collection<DefinitionProvider<T>> toAdd) |
DefinitionType type()
DefinitionMetadataBuilder newMetadataBuilder()
DefinitionMetadataBuilder
determine how referenceId strings for this registry are generated.void start()
void register(DefinitionProvider<T> definitionProvider)
Set<DefinitionMetadata> unregisterAndRegister(Collection<DefinitionMetadata> toRemove, Collection<DefinitionProvider<T>> toAdd)
DefinitionProvider<T> getProvider(DefinitionMetadata id)
DefinitionProvider<T> getProvider(String referenceId) throws Registry.NoSuchDefinitionException
DefinitionMetadata.getReferenceId()
would return.Registry.NoSuchDefinitionException
- (which is a RuntimeException) if the given reference is not known.DefinitionMetadata.getReferenceId()
Collection<DefinitionProvider<T>> getAllProviders()
Collection<T> getAllDefinitions()
Collection<DefinitionMetadata> getAllMetadata()
DefinitionQuery<T> query()
Copyright © 2003–2015 Magnolia International Ltd.. All rights reserved.