final Set<Class<?>> privilizedTypes = new LinkedHashSet<Class<?>>();
// handle blueprints:
for (final WeavableClass<?> type : scanner.scan(
new ScanRequest().add(WeaveInterest.of(Privilizing.class, ElementType.TYPE))).getClasses()) {
final Class<?> target = type.getTarget();
if (privilizedTypes.add(target) && validateRequest(privilizer, type)) {
privilizer.blueprint(target, type.getAnnotation(Privilizing.class));
}
}
// handle remaining classes declaring @Privileged methods:
for (final WeavableClass<?> type : scanner.scan(
new ScanRequest().add(WeaveInterest.of(Privileged.class, ElementType.METHOD))).getClasses()) {
final Class<?> target = type.getTarget();
if (privilizedTypes.add(target) && validateRequest(privilizer, type)) {
privilizer.privilize(target);
}
}