org.qi4j.bootstrap
Class SingletonAssembler
java.lang.Object
org.qi4j.bootstrap.SingletonAssembler
- All Implemented Interfaces:
- Assembler
public abstract class SingletonAssembler
- extends java.lang.Object
- implements Assembler
Base class for Assembler that creates an Application
with one Layer and one Module. Create a subclass of this
and implement the 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 Summary |
SingletonAssembler()
Creates a Qi4j Runtime instance containing one Layer with one Module. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SingletonAssembler
public SingletonAssembler()
throws AssemblyException,
ActivationException
- Creates a Qi4j Runtime instance containing one Layer with one Module.
The Layer will be named "Layer 1" and the Module will be named "Module 1". It is possible to add
additional layers and modules via the Assembler interface that must be implemented in the subclass of this
class.
- Throws:
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
runtime
public final Qi4j runtime()
application
public final Application application()
module
public final Module module()
beforeActivation
protected void beforeActivation(Application application)
throws java.lang.Exception
- Throws:
java.lang.Exception