class MyBean extends BeanContextChildSupport {
protected void initializeBeanContextResources() {
super.initializeBeanContextResources();
BeanContextServices bcs = (BeanContextServices) getBeanContext();
try {
bcs.getService(this, this, MyService1.class, null, this);
}
catch (Exception exception) {
exception.printStackTrace();
}
try {
bcs.getService(this, this, MyService2.class, null, this);
}
catch (Exception exception) {
exception.printStackTrace();
}
}