/**
* This is the one and only application class, where everything starts.
*/
public class MyApp extends SystemApplication<BaseAppConfig> { (1)
/**
* Initialize and wire all beans.
*/
public void init() {
// 1) Retrieve the global bean context: (2)
BeanContext ctx = KosAdmin.ctx;
// 2) Instantiate all of your beans: (3)
MyClass1 myClass1 = new MyClass1();
MyClass2 myClass2 = new MyClass2();
MyClass3 myClass3 = new MyClass3();
// 3) Add all of these objects to the bean context: (4)
ctx.add(myClass1);
ctx.add(myClass2);
ctx.add(myClass3);
// 4) Inject all @Autowired fields: (5)
ctx.update();
// . . .
}
}