return instantiate(clazz, dependencies);
}
public <T> T instantiate(Class<? extends T> clazz, Registry registry) throws Exception {
if (!allowCustomServices) {
Service reg = clazz.getAnnotation(Service.class);
if (reg == null) {
throw new IllegalArgumentException("Class " + clazz.getName() + " is not annotated with @Service");
}
}
T instance = clazz.newInstance();