org.qi4j.bootstrap

## Class SingletonAssembler

- java.lang.Object
- - org.qi4j.bootstrap.SingletonAssembler

- All Implemented Interfaces:
    Assembler

      public abstract class SingletonAssembler
      extends 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

    Constructors
    Constructor and Description
    `SingletonAssembler()` Creates a Zest Runtime instance containing one Layer with one Module.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Application` | `application()`
    `protected void` | `beforeActivation(Application application)`
    `Module` | `module()`
    `Qi4j` | `runtime()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.qi4j.bootstrap.Assembler

      `assemble`

- - ### Constructor Detail

    - #### SingletonAssembler

          public SingletonAssembler()
                             throws AssemblyException,
                                    ActivationException

      Creates a Zest 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` - If the automatic `activate()` method is throwing this Exception..

  - ### Method Detail

    - #### runtime

          public final Qi4j runtime()

    - #### application

          public final Application application()

    - #### module

          public final Module module()

    - #### beforeActivation

          protected void beforeActivation(Application application)
                                   throws Exception

      Throws:
        `Exception`