Configuration[] rolesConf = roles.getChildren("role");
for(int i=0; i<rolesConf.length;i++) {
final Configuration current = rolesConf[i];
final String name = current.getAttribute("name");
Subscriber subscriber = null;
try {
subscriber = (Subscriber) this.manager.lookup(name);
Deprecation.logger.warn("Subscriber is deprecated. Please convert the following component to a Receiver: " + subscriber.getClass().getName());
this.subscribe(subscriber);
} finally {
this.manager.release(subscriber);
}
}
}
// subscribe all configured classes
Configuration classes = this.configuration.getChild("subscriber-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");
Deprecation.logger.warn("Subscriber is deprecated. Please convert the following component to a Receiver: " + name);
Subscriber subscriber = (Subscriber) ClassUtils.newInstance(name);
ContainerUtil.enableLogging(subscriber, this.getLogger());
ContainerUtil.contextualize(subscriber, this.context);
ContainerUtil.service(subscriber, this.manager );
ContainerUtil.initialize(subscriber);
this.subscribe(subscriber);