use of org.jboss.ejb3.annotation.Pool in project microservice_framework by CJSCommonPlatform.
the class SubscriptionJmsEndpointGeneratorTest method shouldCreateJmsEndpointAnnotatedWithoutPoolConfiguration.
@Test
public void shouldCreateJmsEndpointAnnotatedWithoutPoolConfiguration() throws Exception {
SubscriptionDescriptor subscriptionDescriptor = setUpMessageSubscription("jms:topic:people.person-added", "people.abc", "people", "EVENT_LISTENER");
generator.run(subscriptionDescriptor, configurationWithBasePackage(BASE_PACKAGE, outputFolder, generatorProperties));
Class<?> clazz = compiler.compiledClassOf(BASE_PACKAGE, "PeopleEventListenerPeoplePersonAddedJmsListener");
Pool poolAnnotation = clazz.getAnnotation(Pool.class);
assertThat(poolAnnotation, nullValue());
}
use of org.jboss.ejb3.annotation.Pool in project microservice_framework by CJSCommonPlatform.
the class SubscriptionJmsEndpointGeneratorTest method shouldCreateJmsEndpointAnnotatedWithPoolConfiguration.
@Test
public void shouldCreateJmsEndpointAnnotatedWithPoolConfiguration() throws Exception {
SubscriptionDescriptor subscriptionDescriptor = setUpMessageSubscription("jms:topic:people.person-added", "people.abc", "people", "EVENT_LISTENER");
generator.run(subscriptionDescriptor, configurationWithBasePackage(BASE_PACKAGE, outputFolder, new GeneratorPropertiesFactory().withCustomMDBPool()));
Class<?> clazz = compiler.compiledClassOf(BASE_PACKAGE, "PeopleEventListenerPeoplePersonAddedJmsListener");
Pool poolAnnotation = clazz.getAnnotation(Pool.class);
assertThat(poolAnnotation, not(nullValue()));
assertThat(poolAnnotation.value(), is("people-person-added-event-listener-pool"));
}
use of org.jboss.ejb3.annotation.Pool 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);
}
}
Aggregations