Posts

Showing posts from August, 2012

Nesting Application Modules at Runtime

You can nest application module on the fly. Following code snippet illustrates the APIs for nesting application module at runtime. Note that nested AM shares same transaction context with the calling AM.

//In application module implementation class public void nestAMIfRequiredAndInvokeMethod() { ApplicationModuleImpl hrAM = null; boolean generatedLocally = false; try { //Check whether the HRAppModule is already nested hrAM =(ApplicationModuleImpl)getDBTransaction().getRootApplicationModule().findApplicationModule("HRAppModule"); //create a new instance of the HRAppModule, if not nested already if (hrAM == null) { hrAM = (ApplicationModuleImpl)this.getDBTransaction().createApplicationModule("demo.HRAppModule"); generatedLocally = true; } //Invoke business methods if (hrAM != null) { hrAM.doSomething(…

Disclaimer

The views expressed on this blog are my own and do not necessarily reflect the views of my employer.