if (config == null) {
getLogger().debug("Sitemap has no components definition at " + tree.getLocation());
config = new DefaultConfiguration("", "");
}
ComponentManager manager = new ExcaliburComponentManager(this.parentManager) {
public void setRoleManager(RoleManager rm) {
super.setRoleManager(rm);
}
};
LifecycleHelper.setupComponent(manager,
getLogger(),
this.context,
this.parentManager,
this.roleManager,
this.logKit,
config
);
// Set parent of all selectors.
if (this.parentManager != null) {
for (int i = 0; i < ComponentsSelector.SELECTOR_ROLES.length; i++) {
String role = ComponentsSelector.SELECTOR_ROLES[i];
ComponentSelector parentSelector = null;
try {
parentSelector = (ComponentSelector)this.parentManager.lookup(role);
} catch(Exception e) {
// ignore and keep it null
}
if (parentSelector != null) {
ExtendedComponentSelector localSelector = null;
try {
localSelector = (ExtendedComponentSelector)manager.lookup(role);
if (localSelector != parentSelector) {
// local selector wasn't given by chaining to the parent manager
localSelector.setParentSelector(parentSelector);
}
manager.release(localSelector);
} catch(Exception e) {
// ignore
}