Configuration[] rolesConf = roles.getChildren("role");
for(int i=0; i<rolesConf.length;i++) {
final Configuration current = rolesConf[i];
final String name = current.getAttribute("name");
Receiver receiver = null;
try {
receiver = (Receiver) this.manager.lookup(name);
this.subscribe(receiver);
} finally {
this.manager.release(receiver);
}
}
}
// subscribe all configured receiver classes
classes = this.configuration.getChild("receiver-classes", false);
if ( classes != null ) {
Configuration[] classesConf = classes.getChildren("class");
for(int i=0; i<classesConf.length;i++) {
final Configuration current = classesConf[i];
final String name = current.getAttribute("name");
Receiver receiver = (Receiver)ClassUtils.newInstance(name);
ContainerUtil.enableLogging(receiver, this.getLogger());
ContainerUtil.contextualize(receiver, this.context);
ContainerUtil.service(receiver, this.manager );
ContainerUtil.initialize(receiver);
this.subscribe(receiver);