Polygene™
Introduction
Tutorials
Javadoc
Samples
Core
Libraries
Extensions
Tools
Glossary 

Detailed Application Model

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 IDArtifact IDVersion

org.apache.polygene.tools

org.apache.polygene.tool.model-detail

3.0.0


Usage

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();
}
  1. Given an application assembler,
  2. and a Polygene runtime,
  3. create the ApplicationModel.
  4. Use the createApplicationDetailDescriptor() static method to create a detailed application model object.
  5. Use its toJson() method to get a detailed report of the application model.
  6. Continue with regular application activation.

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":[
  ]
}