}
// Subscribe the service to the bus.
bus.subscribe(svcName, svc);
RolesRequiredRule rule = null;
if (clazz.isAnnotationPresent(RequireRoles.class)) {
rule = new RolesRequiredRule(clazz.getAnnotation(RequireRoles.class).value(), bus);
} else if (clazz.isAnnotationPresent(RequireAuthentication.class)) {
rule = new RolesRequiredRule(new HashSet<Object>(), bus);
}
if (rule != null) {
bus.addRule(svcName, rule);
}
}
}
}
}
);
String requireAuthenticationForAll = "errai.require_authentication_for_all";
if (hasProperty(requireAuthenticationForAll) && "true".equals(getProperty(requireAuthenticationForAll))) {
bus.addRule("ClientNegotiationService", new RolesRequiredRule(new HashSet<Object>(), bus));
}
for (Runnable r : deferred) {
r.run();
}