public abstract class LayeredApplicationAssembler extends Object implements ApplicationAssembler
Modifier and Type | Field and Description |
---|---|
protected Application |
application |
protected String |
name |
protected String |
version |
Constructor and Description |
---|
LayeredApplicationAssembler(String name,
String version,
Application.Mode mode) |
Modifier and Type | Method and Description |
---|---|
Application |
application() |
ApplicationAssembly |
assemble(ApplicationAssemblyFactory applicationFactory) |
protected abstract void |
assembleLayers(ApplicationAssembly assembly)
Called from the constructor to assemble the layers in the applcation.
|
protected <T extends LayerAssembler> |
assemblerOf(Class<T> layerAssemblerClass) |
ApplicationAssembly |
assembly() |
protected LayerAssembly |
createLayer(Class<? extends LayerAssembler> layerAssemblerClass) |
protected void |
instantiateApplication(Energy4Java qi4j,
ApplicationDescriptor model)
This method is called from the constructor to instantiate the Zest application from the application model.
|
protected void |
onModelCreated(ApplicationDescriptor model)
This method is called after the Application Model has been created, before the instantiation of the Zest
application.
|
void |
start() |
void |
stop() |
protected Application application
protected String name
protected String version
public LayeredApplicationAssembler(String name, String version, Application.Mode mode) throws AssemblyException
AssemblyException
public ApplicationAssembly assembly()
protected void instantiateApplication(Energy4Java qi4j, ApplicationDescriptor model)
The default implementation simply calls;
application = model.newInstance( qi4j.spi() );
qi4j
- The Zest runtime engine.model
- The application model descriptor.protected void onModelCreated(ApplicationDescriptor model)
The default implementation does nothing. Applications may have advanced features to inspect or modify the model prior to instantiation, and this is the place where such advanced manipulation is expected to take place.
model
- public Application application()
public void start() throws ActivationException
ActivationException
public void stop() throws PassivationException
PassivationException
public ApplicationAssembly assemble(ApplicationAssemblyFactory applicationFactory) throws AssemblyException
assemble
in interface ApplicationAssembler
AssemblyException
protected LayerAssembly createLayer(Class<? extends LayerAssembler> layerAssemblerClass) throws IllegalArgumentException
IllegalArgumentException
protected <T extends LayerAssembler> T assemblerOf(Class<T> layerAssemblerClass)
protected abstract void assembleLayers(ApplicationAssembly assembly) throws AssemblyException
This method must be implemented, and is typically a list of LayerAssmebler instantitations, followed
by LayerAssembly.uses(LayerAssembly...)
declarations.
AssemblyException