For troubleshooting it can be handy to log the application model, or write it to some file, when activating an application.
This library is what Envisage Tool uses under the hood.
Table 72. Artifact
Group ID | Artifact ID | Version |
---|---|---|
org.apache.polygene.tools | org.apache.polygene.tool.model-detail | 3.0.0 |
On application bootstrap:
ApplicationAssembler assembler = // (1) [...snip...] Energy4Java polygene = new Energy4Java(); // (2) ApplicationDescriptor model = polygene.newApplicationModel( assembler ); // (3) ApplicationDetailDescriptor detailedModel = createApplicationDetailDescriptor( model ); // (4) System.out.println( detailedModel.toJson().toString() ); // (5) Application application = model.newInstance( polygene.spi() ); // (6) try { application.activate(); [...snip...] } finally { application.passivate(); }
ApplicationModel
.
createApplicationDetailDescriptor()
static method to create a detailed application model object.
toJson()
method to get a detailed report of the application model.
Here is what a sample JSON dump looks like:
{ "name":"my-app", "version":"1.0", "mode":"staging", "layers":[ { "name":"network", "modules":[ { "name":"http", "services":[ { "type":"org.apache.polygene.tools.model.DocumentationSupport$HttpService", "visibility":"module", "types":[ "org.apache.polygene.tools.model.DocumentationSupport$HttpService", "org.apache.polygene.api.service.ServiceComposite" ], "mixins":[ { "mixin":"org.apache.polygene.api.identity.HasIdentity$HasIdentityMixin", "constructors":[ { "name":"org.apache.polygene.api.identity.HasIdentity_HasIdentityMixin_Stub" } ], "injection":{ } } ] }, { "type":"org.apache.polygene.api.unitofwork.UnitOfWorkFactory", "visibility":"module", "types":[ "org.apache.polygene.api.unitofwork.UnitOfWorkFactory", "org.apache.polygene.api.service.ServiceComposite" ], "mixins":[ { "mixin":"org.apache.polygene.runtime.unitofwork.UnitOfWorkFactoryMixin", "constructors":[ { "name":"org.apache.polygene.runtime.unitofwork.UnitOfWorkFactoryMixin_Stub" } ], "injection":{ } }, { "mixin":"org.apache.polygene.api.identity.HasIdentity$HasIdentityMixin", "constructors":[ { "name":"org.apache.polygene.api.identity.HasIdentity_HasIdentityMixin_Stub" } ], "injection":{ } } ] } ], "activators":[ ] } ], "usedLayers":[ "application" ], "activators":[ ] }, { "name":"application", "modules":[ { "name":"domain", "services":[ { "type":"org.apache.polygene.api.unitofwork.UnitOfWorkFactory", "visibility":"module", "types":[ "org.apache.polygene.api.unitofwork.UnitOfWorkFactory", "org.apache.polygene.api.service.ServiceComposite" ], "mixins":[ { "mixin":"org.apache.polygene.runtime.unitofwork.UnitOfWorkFactoryMixin", "constructors":[ { "name":"org.apache.polygene.runtime.unitofwork.UnitOfWorkFactoryMixin_Stub" } ], "injection":{ } }, { "mixin":"org.apache.polygene.api.identity.HasIdentity$HasIdentityMixin", "constructors":[ { "name":"org.apache.polygene.api.identity.HasIdentity_HasIdentityMixin_Stub" } ], "injection":{ } } ] } ], "activators":[ ] } ], "usedLayers":[ ], "activators":[ ] } ], "activators":[ ] }