The CB2 core, which includes the most fundamental services such as application context, business level and database access level implementations.
A CB2-based application usually maintains two application-wide singletons
that represent the Application Context and the Business Level Manager. All
other services are accessed through these two basic objects. For example,
a simple console application could have the following in its main
method:
public static void main(String [] args) throws Exception { ApplicationContext appCtx = null; BLManager blManager = null; try { appCtx = new ApplicationContext("myApp", ""); blManager = new BLManager(appCtx); ... } finally { if(blManager != null) blManager.destroy(); if(appCtx != null) appCtx.destroy(); } }
Note that if your application is using some Presentation Level framework,
such as the Apache Struts based PL framework that comes with CB2 library
(see com.boylesoftware.cb2.presentation.servlet
package), you
don't have to worry about creating, maintaining and destroying Application
Context and BL Manager objects - the framework does it for your
application.