use of org.jboss.as.ee.component.EEModuleClassDescription in project wildfly by wildfly.
the class AroundInvokeAnnotationParsingProcessor method processAroundInvoke.
private void processAroundInvoke(final EEModuleDescription eeModuleDescription, final AnnotationTarget target) throws DeploymentUnitProcessingException {
if (!(target instanceof MethodInfo)) {
throw EeLogger.ROOT_LOGGER.methodOnlyAnnotation(AROUND_INVOKE_ANNOTATION_NAME);
}
final MethodInfo methodInfo = MethodInfo.class.cast(target);
final ClassInfo classInfo = methodInfo.declaringClass();
final EEModuleClassDescription classDescription = eeModuleDescription.addOrGetLocalClassDescription(classInfo.name().toString());
final List<AnnotationInstance> classAroundInvokes = classInfo.annotations().get(AROUND_INVOKE_ANNOTATION_NAME);
if (classAroundInvokes.size() > 1) {
throw EeLogger.ROOT_LOGGER.aroundInvokeAnnotationUsedTooManyTimes(classInfo.name(), classAroundInvokes.size());
}
validateArgumentType(classInfo, methodInfo);
InterceptorClassDescription.Builder builder = InterceptorClassDescription.builder(classDescription.getInterceptorClassDescription());
builder.setAroundInvoke(MethodIdentifier.getIdentifier(Object.class, methodInfo.name(), InvocationContext.class));
classDescription.setInterceptorClassDescription(builder.build());
}
use of org.jboss.as.ee.component.EEModuleClassDescription in project wildfly by wildfly.
the class AbstractPoolMergingProcessor method handleAnnotations.
@Override
protected void handleAnnotations(DeploymentUnit deploymentUnit, EEApplicationClasses applicationClasses, DeploymentReflectionIndex deploymentReflectionIndex, Class<?> componentClass, T description) 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<Pool, String> pool = clazz.getAnnotationInformation(Pool.class);
if (pool == null) {
return;
}
if (!pool.getClassLevelAnnotations().isEmpty()) {
final String poolName = pool.getClassLevelAnnotations().get(0);
if (poolName == null || poolName.trim().isEmpty()) {
throw EjbLogger.ROOT_LOGGER.poolNameCannotBeEmptyString(description.getEJBName());
}
this.setPoolName(description, poolName);
}
}
use of org.jboss.as.ee.component.EEModuleClassDescription in project wildfly by wildfly.
the class CacheMergingProcessor method handleAnnotations.
@Override
protected void handleAnnotations(DeploymentUnit deploymentUnit, EEApplicationClasses applicationClasses, DeploymentReflectionIndex deploymentReflectionIndex, Class<?> componentClass, 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<Cache, CacheInfo> cache = clazz.getAnnotationInformation(Cache.class);
if (cache == null) {
return;
}
if (!cache.getClassLevelAnnotations().isEmpty()) {
componentConfiguration.setCache(cache.getClassLevelAnnotations().get(0));
}
}
use of org.jboss.as.ee.component.EEModuleClassDescription in project wildfly by wildfly.
the class ClusteredSingletonMergingProcessor method handleAnnotations.
@Override
protected void handleAnnotations(DeploymentUnit deploymentUnit, EEApplicationClasses applicationClasses, DeploymentReflectionIndex deploymentReflectionIndex, Class<?> componentClass, MessageDrivenComponentDescription componentDescription) 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<ClusteredSingleton, Boolean> clustering = clazz.getAnnotationInformation(ClusteredSingleton.class);
if (clustering == null || clustering.getClassLevelAnnotations().isEmpty()) {
return;
}
componentDescription.setClusteredSingleton(true);
}
use of org.jboss.as.ee.component.EEModuleClassDescription in project wildfly by wildfly.
the class ResourceAdaptorMergingProcessor 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<ResourceAdapter, String> resourceAdapter = clazz.getAnnotationInformation(ResourceAdapter.class);
if (resourceAdapter == null || resourceAdapter.getClassLevelAnnotations().isEmpty()) {
return;
}
final String configuredAdapterName = resourceAdapter.getClassLevelAnnotations().get(0);
final String adapterName = addEarPrefixIfRelativeName(configuredAdapterName, deploymentUnit, componentClass);
componentConfiguration.setResourceAdapterName(adapterName);
}
Aggregations