AnnotatedType<GenericRoleVoter> roleVoterAnnotatedType = beanManager
.createAnnotatedType(GenericRoleVoter.class);
InjectionTarget<GenericRoleVoter> voterInjectionTarget = beanManager
.createInjectionTarget(roleVoterAnnotatedType);
NamedRole namedRole;
String beanName;
for (Object permission : constants) {
namedRole = (NamedRole) permission;
beanName = nameFactory.generateRoleBeanName(namedRole.name());
Bean<GenericRoleVoter> bean = new BeanBuilder<GenericRoleVoter>(beanManager)
.passivationCapable(false).beanClass(GenericRoleVoter.class)
.addTypes(AbstractAccessDecisionVoter.class, GenericRoleVoter.class)
.injectionPoints(voterInjectionTarget.getInjectionPoints()).name(beanName)