renamed endpoint annotation post-processor
This commit is contained in:
@@ -24,6 +24,7 @@ import org.springframework.beans.factory.parsing.BeanComponentDefinition;
|
||||
import org.springframework.beans.factory.support.RootBeanDefinition;
|
||||
import org.springframework.beans.factory.xml.BeanDefinitionParser;
|
||||
import org.springframework.beans.factory.xml.ParserContext;
|
||||
import org.springframework.integration.endpoint.annotation.MessageEndpointAnnotationPostProcessor;
|
||||
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
@@ -36,10 +37,14 @@ public class AnnotationDrivenParser implements BeanDefinitionParser {
|
||||
private static final String SUBSCRIBER_ANNOTATION_POST_PROCESSOR_BEAN_NAME =
|
||||
"internal.SubscriberAnnotationPostProcessor";
|
||||
|
||||
private static final String MESSAGE_ENDPOINT_ANNOTATION_POST_PROCESSOR_BEAN_NAME =
|
||||
"internal.MessageEndpointAnnotationPostProcessor";
|
||||
|
||||
|
||||
public BeanDefinition parse(Element element, ParserContext parserContext) {
|
||||
this.createPublisherPostProcessor(parserContext);
|
||||
this.createSubscriberPostProcessor(parserContext);
|
||||
this.createMessageEndpointPostProcessor(parserContext);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -61,4 +66,13 @@ public class AnnotationDrivenParser implements BeanDefinitionParser {
|
||||
parserContext.registerBeanComponent(bcd);
|
||||
}
|
||||
|
||||
private void createMessageEndpointPostProcessor(ParserContext parserContext) {
|
||||
BeanDefinition bd = new RootBeanDefinition(MessageEndpointAnnotationPostProcessor.class);
|
||||
bd.getPropertyValues().addPropertyValue("messageBus",
|
||||
new RuntimeBeanReference(MessageBusParser.MESSAGE_BUS_BEAN_NAME));
|
||||
BeanComponentDefinition bcd = new BeanComponentDefinition(
|
||||
bd, MESSAGE_ENDPOINT_ANNOTATION_POST_PROCESSOR_BEAN_NAME);
|
||||
parserContext.registerBeanComponent(bcd);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ import org.springframework.util.StringUtils;
|
||||
*
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
public class EndpointAnnotationPostProcessor implements BeanPostProcessor, InitializingBean {
|
||||
public class MessageEndpointAnnotationPostProcessor implements BeanPostProcessor, InitializingBean {
|
||||
|
||||
private Map<Class<? extends Annotation>, AnnotationHandlerCreator> handlerCreators =
|
||||
new ConcurrentHashMap<Class<? extends Annotation>, AnnotationHandlerCreator>();
|
||||
@@ -100,8 +100,8 @@ public class FixedDelayConsumerTests {
|
||||
channel.send(new GenericMessage<String>(1, "test " + (i+1)));
|
||||
}
|
||||
latch.await(80, TimeUnit.MILLISECONDS);
|
||||
assertTrue(counter.get() < 10);
|
||||
assertTrue(counter.get() > 7);
|
||||
assertTrue(counter.get() < 15);
|
||||
assertTrue(counter.get() > 5);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import org.springframework.integration.message.GenericMessage;
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
public class EndpointAnnotationPostProcessorTests {
|
||||
public class MessageEndpointAnnotationPostProcessorTests {
|
||||
|
||||
@Test
|
||||
public void testSimpleHandler() throws InterruptedException {
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
<bean id="endpoint" class="org.springframework.integration.endpoint.annotation.SimpleAnnotatedEndpoint"/>
|
||||
|
||||
<bean class="org.springframework.integration.endpoint.annotation.EndpointAnnotationPostProcessor">
|
||||
<bean class="org.springframework.integration.endpoint.annotation.MessageEndpointAnnotationPostProcessor">
|
||||
<property name="messageBus" ref="bus"/>
|
||||
</bean>
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
<bean id="outputChannel" class="org.springframework.integration.channel.PointToPointChannel"/>
|
||||
|
||||
<bean class="org.springframework.integration.endpoint.annotation.EndpointAnnotationPostProcessor">
|
||||
<bean class="org.springframework.integration.endpoint.annotation.MessageEndpointAnnotationPostProcessor">
|
||||
<property name="messageBus" ref="bus"/>
|
||||
</bean>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user