use of org.jboss.as.ee.component.EEModuleClassDescription in project wildfly by wildfly.
the class StatefulTimeoutMergingProcessor method handleAnnotations.
@Override
protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final StatefulComponentDescription 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<StatefulTimeout, StatefulTimeoutInfo> timeout = clazz.getAnnotationInformation(StatefulTimeout.class);
if (timeout == null) {
return;
}
if (!timeout.getClassLevelAnnotations().isEmpty()) {
componentConfiguration.setStatefulTimeout(timeout.getClassLevelAnnotations().get(0));
}
}
use of org.jboss.as.ee.component.EEModuleClassDescription in project wildfly by wildfly.
the class ConcurrencyManagementMergingProcessor method handleAnnotations.
@Override
protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final SessionBeanComponentDescription componentConfiguration) throws DeploymentUnitProcessingException {
final EEModuleClassDescription clazz = applicationClasses.getClassByName(componentClass.getName());
//we only care about annotations on the bean class itself
if (clazz == null) {
return;
}
ClassAnnotationInformation<ConcurrencyManagement, ConcurrencyManagementType> management = clazz.getAnnotationInformation(ConcurrencyManagement.class);
if (management == null) {
return;
}
if (!management.getClassLevelAnnotations().isEmpty()) {
componentConfiguration.setConcurrencyManagementType(management.getClassLevelAnnotations().get(0));
}
}
use of org.jboss.as.ee.component.EEModuleClassDescription in project wildfly by wildfly.
the class MdbDeliveryMergingProcessor method handleAnnotations.
@Override
protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final MessageDrivenComponentDescription 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<DeliveryActive, Boolean> deliveryActive = clazz.getAnnotationInformation(DeliveryActive.class);
if (deliveryActive != null) {
if (!deliveryActive.getClassLevelAnnotations().isEmpty()) {
componentConfiguration.setDeliveryActive(deliveryActive.getClassLevelAnnotations().get(0));
}
}
final ClassAnnotationInformation<DeliveryGroup, String> deliveryGroup = clazz.getAnnotationInformation(DeliveryGroup.class);
if (deliveryGroup != null) {
if (!deliveryGroup.getClassLevelAnnotations().isEmpty()) {
componentConfiguration.setDeliveryGroup(deliveryGroup.getClassLevelAnnotations().get(0));
}
}
}
use of org.jboss.as.ee.component.EEModuleClassDescription 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);
if (runAs == null) {
return;
}
if (!runAs.getClassLevelAnnotations().isEmpty()) {
componentConfiguration.setRunAs(runAs.getClassLevelAnnotations().get(0));
}
final ClassAnnotationInformation<RunAsPrincipal, String> runAsPrincipal = clazz.getAnnotationInformation(RunAsPrincipal.class);
String principal = DEFAULT_RUN_AS_PRINCIPAL;
if (runAsPrincipal != null) {
if (!runAsPrincipal.getClassLevelAnnotations().isEmpty()) {
principal = runAsPrincipal.getClassLevelAnnotations().get(0);
}
}
componentConfiguration.setRunAsPrincipal(principal);
}
use of org.jboss.as.ee.component.EEModuleClassDescription in project wildfly by wildfly.
the class JPAAnnotationProcessor method processPersistenceAnnotations.
private void processPersistenceAnnotations(final DeploymentUnit deploymentUnit, final EEModuleDescription eeModuleDescription, List<AnnotationInstance> persistenceContexts, final EEApplicationClasses applicationClasses) throws DeploymentUnitProcessingException {
for (AnnotationInstance annotation : persistenceContexts) {
ClassInfo declaringClass;
final AnnotationTarget annotationTarget = annotation.target();
if (annotationTarget instanceof FieldInfo) {
FieldInfo fieldInfo = (FieldInfo) annotationTarget;
declaringClass = fieldInfo.declaringClass();
EEModuleClassDescription eeModuleClassDescription = eeModuleDescription.addOrGetLocalClassDescription(declaringClass.name().toString());
this.processField(deploymentUnit, annotation, fieldInfo, eeModuleClassDescription);
} else if (annotationTarget instanceof MethodInfo) {
MethodInfo methodInfo = (MethodInfo) annotationTarget;
declaringClass = methodInfo.declaringClass();
EEModuleClassDescription eeModuleClassDescription = eeModuleDescription.addOrGetLocalClassDescription(declaringClass.name().toString());
this.processMethod(deploymentUnit, annotation, methodInfo, eeModuleClassDescription);
} else if (annotationTarget instanceof ClassInfo) {
declaringClass = (ClassInfo) annotationTarget;
EEModuleClassDescription eeModuleClassDescription = eeModuleDescription.addOrGetLocalClassDescription(declaringClass.name().toString());
this.processClass(deploymentUnit, annotation, eeModuleClassDescription);
}
}
}
Aggregations