use of org.jboss.ejb3.annotation.RunAsPrincipal in project wildfly by wildfly.
the class RunAsMergingProcessor method handleAnnotations.
@Override
protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final EJBComponentDescription componentConfiguration) throws DeploymentUnitProcessingException {
final EEModuleClassDescription clazz = applicationClasses.getClassByName(componentClass.getName());
// we only care about annotations on the bean class itself
if (clazz == null) {
return;
}
final ClassAnnotationInformation<RunAs, String> runAs = clazz.getAnnotationInformation(RunAs.class);
final ClassAnnotationInformation<RunAsPrincipal, String> runAsPrincipal = clazz.getAnnotationInformation(RunAsPrincipal.class);
if (runAs == null) {
if (runAsPrincipal != null) {
EjbLogger.DEPLOYMENT_LOGGER.missingRunAsAnnotation(componentClass.getName());
}
return;
}
if (!runAs.getClassLevelAnnotations().isEmpty()) {
componentConfiguration.setRunAs(runAs.getClassLevelAnnotations().get(0));
}
String principal = DEFAULT_RUN_AS_PRINCIPAL;
if (runAsPrincipal != null && !runAsPrincipal.getClassLevelAnnotations().isEmpty()) {
principal = runAsPrincipal.getClassLevelAnnotations().get(0);
}
componentConfiguration.setRunAsPrincipal(principal);
}
Aggregations