public class ApplicationBuilder extends Object implements org.qi4j.api.activation.ActivationEventListenerRegistration
| Constructor and Description |
|---|
ApplicationBuilder(String applicationName) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterActivation()
Called after application activation.
|
protected void |
beforeActivation()
Called before application activation.
|
protected void |
configureWithJson(JSONObject root)
Configures the application struucture from a JSON document.
|
void |
deregisterActivationEventListener(org.qi4j.api.activation.ActivationEventListener listener) |
static ApplicationBuilder |
fromJson(InputStream json)
Load an ApplicationBuilder from a JSON InputStream.
|
static ApplicationBuilder |
fromJson(JSONObject root)
Load an ApplicationBuilder from a JSONObject.
|
static ApplicationBuilder |
fromJson(String json)
Load an ApplicationBuilder from a JSON String.
|
static void |
main(String[] args)
main method that read JSON from STDIN.
|
org.qi4j.api.structure.Application |
newApplication()
Create and activate a new Application.
|
void |
registerActivationEventListener(org.qi4j.api.activation.ActivationEventListener listener) |
LayerDeclaration |
withLayer(String layerName)
Declare Layer.
|
public ApplicationBuilder(String applicationName)
public org.qi4j.api.structure.Application newApplication()
throws AssemblyException,
org.qi4j.api.activation.ActivationException
AssemblyException - if the assembly failedorg.qi4j.api.activation.ActivationException - if the activation failedprotected void beforeActivation()
protected void afterActivation()
public void registerActivationEventListener(org.qi4j.api.activation.ActivationEventListener listener)
registerActivationEventListener in interface org.qi4j.api.activation.ActivationEventListenerRegistrationpublic void deregisterActivationEventListener(org.qi4j.api.activation.ActivationEventListener listener)
deregisterActivationEventListener in interface org.qi4j.api.activation.ActivationEventListenerRegistrationpublic LayerDeclaration withLayer(String layerName)
layerName - Name of the Layerpublic static ApplicationBuilder fromJson(String json) throws JSONException, AssemblyException
json - JSON StringJSONException - if unable to read JSONAssemblyException - if unable to declare the assemblypublic static ApplicationBuilder fromJson(InputStream json) throws JSONException, AssemblyException
json - JSON inputJSONException - if unable to read JSONAssemblyException - if unable to declare the assemblypublic static ApplicationBuilder fromJson(JSONObject root) throws JSONException, AssemblyException
root - JSON objectJSONException - if unable to read JSONAssemblyException - if unable to declare the assemblyprotected void configureWithJson(JSONObject root) throws JSONException, AssemblyException
root - The JSON document root.JSONException - if the JSON document isn't valid.AssemblyException - if probelms in the Assemblers provided in the JSON document.public static void main(String[] args) throws JSONException, org.qi4j.api.activation.ActivationException, AssemblyException
Passivation exceptions are written to STDERR if any.
args - UnusedJSONException - if unable to read JSONAssemblyException - if the assembly failedorg.qi4j.api.activation.ActivationException - if the activation failed