public class SingletonAssembler extends Object implements Assembler
Assembler.assemble(ModuleAssembly)
method.
Once the SingletonAssembler is instantiated it will have created and activated
an Application which can be accessed from application()
.
You can also easily access any resources specific for the single Module, such as the TransientBuilderFactory.Constructor and Description |
---|
SingletonAssembler()
Creates a Polygene Runtime instance containing one Layer with one Module.
|
SingletonAssembler(Assembler assemble)
Creates a Polygene Runtime instance containing one Layer with one Module.
|
Modifier and Type | Method and Description |
---|---|
Application |
application() |
void |
assemble(ModuleAssembly module)
Assemblers receive a callback to the ModuleAssembly
they are supposed to configure.
|
protected void |
beforeActivation(Application application) |
protected String |
layerName() |
Module |
module() |
protected String |
moduleName() |
protected ObjectFactory |
objectFactory() |
PolygeneAPI |
runtime() |
protected ServiceFinder |
serviceFinder() |
protected TransientBuilderFactory |
transientBuilderFactory() |
protected UnitOfWorkFactory |
unitOfWorkFactory() |
protected ValueBuilderFactory |
valueBuilderFactory() |
public SingletonAssembler(Assembler assemble) throws ActivationException
assemble
- An Assembler lambda containing the module assembly.AssemblyException
- Either if the model can not be created from the disk, or some inconsistency in
the programming model makes it impossible to create it.ActivationException
- If the automatic activate()
method is throwing this Exception..public SingletonAssembler() throws AssemblyException, ActivationException
AssemblyException
- Either if the model can not be created from the disk, or some inconsistency in
the programming model makes it impossible to create it.ActivationException
- If the automatic activate()
method is throwing this Exception..public final PolygeneAPI runtime()
public final Application application()
public final Module module()
protected String layerName()
protected String moduleName()
protected void beforeActivation(Application application) throws Exception
Exception
protected UnitOfWorkFactory unitOfWorkFactory()
protected ServiceFinder serviceFinder()
protected ValueBuilderFactory valueBuilderFactory()
protected TransientBuilderFactory transientBuilderFactory()
protected ObjectFactory objectFactory()
public void assemble(ModuleAssembly module)
Assembler
An Assembler may create new Modules by calling
ModuleAssembly.layer()
and
then LayerAssembly.module(String)
(String)}.
This allows an Assembler to bootstrap an entire Layer with
more Modules.