class MyService2 extends BeanContextServicesSupport implements BeanContextServiceProvider {
protected void initializeBeanContextResources() {
super.initializeBeanContextResources();
BeanContextServicesSupport bcs = (BeanContextServicesSupport) getBeanContext();
try {
bcs.getService(this, this, MyService1.class, null, this);
}
catch (Exception exception) {
exception.printStackTrace();
}
bcs.addService(this.getClass(), this);
}