for (final Object o : singletons) {
final AbstractResource ar = wa.getAbstractResource(o);
// Configure meta-data
wa.initiateResource(ar, o);
final ComponentInjector ci = new ComponentInjector(injectableFactory, o.getClass());
ci.inject(o);
addRule(ar.getPath().getValue(), o);
}
// Process root resource classes
for (final Class<?> c : classes) {
final AbstractResource ar = wa.getAbstractResource(c);
// Configure meta-data
wa.initiateResource(ar);
addRule(ar.getPath().getValue(), c);
}
// Process explicit root resources
for (final Map.Entry<String, Object> e : resourceConfig.getExplicitRootResources().entrySet()) {
final String path = e.getKey();
final Object o = e.getValue();
if (o instanceof Class) {
final Class c = (Class)o;
// Configure meta-data
wa.initiateResource(explicitRootResources.get(path));
addRule(path, c);
} else {
// Configure meta-data
wa.initiateResource(explicitRootResources.get(path));
final ComponentInjector ci = new ComponentInjector(injectableFactory, o.getClass());
ci.inject(o);
addRule(path, o);
}
}