public abstract class RegistrySpecAction extends Object implements Action<RegistrySpec>, RegistrySpec
| Constructor and Description |
|---|
RegistrySpecAction() |
| Modifier and Type | Method and Description |
|---|---|
<O> RegistrySpec |
add(Class<? super O> type,
O object)
Adds a registry entry that is available by the given type.
|
<O> RegistrySpec |
add(Class<O> type,
Factory<? extends O> factory)
Adds a lazily created entry to the registry.
|
RegistrySpec |
add(Object object)
Adds a registry entry.
|
protected abstract void |
execute()
Implementations can naturally use the
RegistrySpec DSL for the duration of this method. |
void |
execute(RegistrySpec registrySpec)
Delegates to
execute(), using the given registrySpec for delegation. |
protected RegistrySpec |
getRegistrySpec() |
protected RegistrySpec getRegistrySpec() throws IllegalStateException
IllegalStateExceptionpublic final void execute(RegistrySpec registrySpec) throws Exception
execute(), using the given registrySpec for delegation.execute in interface Action<RegistrySpec>registrySpec - the registry specException - Any thrown by execute()protected abstract void execute()
throws Exception
RegistrySpec DSL for the duration of this method.Exception - Any exception thrown while adding to the registrypublic <O> RegistrySpec add(Class<? super O> type, O object)
RegistrySpecadd in interface RegistrySpecO - the public type of the registry entrytype - the public type of the registry entryobject - the actual registry entrypublic RegistrySpec add(Object object)
RegistrySpecadd in interface RegistrySpecobject - the object to add to the registrypublic <O> RegistrySpec add(Class<O> type, Factory<? extends O> factory)
RegistrySpecThe factory will be invoked exactly once, when a query is made to the registry of a compatible type of the given type.
add in interface RegistrySpecO - the public type of the registry entrytype - the public type of the registry entryfactory - the factory for creating the object when needed