Refactored MessageEndpointAnnotationPostProcessor to MessagingAnnotationPostProcessor which delegates to HandlerAnnotationPostProcessor, SourceAnnotationPostProcessor, and TargetAnnotationPostProcessor (work related to INT-194 and INT-195).
This commit is contained in:
@@ -37,7 +37,7 @@ public class PublisherAnnotationPostProcessorTests {
|
||||
ITestBean testBean = (ITestBean) context.getBean("testBean");
|
||||
testBean.test();
|
||||
MessageChannel channel = (MessageChannel) context.getBean("testChannel");
|
||||
Message result = channel.receive();
|
||||
Message<?> result = channel.receive();
|
||||
assertEquals("test", result.getPayload());
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
<bean id="testBean" class="org.springframework.integration.aop.PublisherAnnotationTestBean"/>
|
||||
|
||||
<bean class="org.springframework.integration.config.PublisherAnnotationPostProcessor">
|
||||
<bean class="org.springframework.integration.config.annotation.PublisherAnnotationPostProcessor">
|
||||
<property name="channelRegistry" ref="messageBus"/>
|
||||
</bean>
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.springframework.integration.annotation.MessageEndpoint;
|
||||
import org.springframework.integration.channel.MessageChannel;
|
||||
import org.springframework.integration.channel.QueueChannel;
|
||||
import org.springframework.integration.channel.ThreadLocalChannel;
|
||||
import org.springframework.integration.config.MessageEndpointAnnotationPostProcessor;
|
||||
import org.springframework.integration.config.annotation.MessagingAnnotationPostProcessor;
|
||||
import org.springframework.integration.dispatcher.DirectChannel;
|
||||
import org.springframework.integration.endpoint.HandlerEndpoint;
|
||||
import org.springframework.integration.handler.MessageHandler;
|
||||
@@ -69,7 +69,7 @@ public class DirectChannelSubscriptionTests {
|
||||
|
||||
@Test
|
||||
public void testSendAndReceiveForAnnotatedEndpoint() {
|
||||
MessageEndpointAnnotationPostProcessor postProcessor = new MessageEndpointAnnotationPostProcessor(bus);
|
||||
MessagingAnnotationPostProcessor postProcessor = new MessagingAnnotationPostProcessor(bus);
|
||||
postProcessor.afterPropertiesSet();
|
||||
TestEndpoint endpoint = new TestEndpoint();
|
||||
postProcessor.postProcessAfterInitialization(endpoint, "testEndpoint");
|
||||
@@ -83,7 +83,7 @@ public class DirectChannelSubscriptionTests {
|
||||
@Test(expected=MessagingException.class)
|
||||
public void testExceptionThrownFromRegisteredEndpoint() {
|
||||
QueueChannel errorChannel = new QueueChannel();
|
||||
bus.setErrorChannel(errorChannel);
|
||||
bus.setErrorChannel(errorChannel);
|
||||
HandlerEndpoint endpoint = new HandlerEndpoint(new MessageHandler() {
|
||||
public Message<?> handle(Message<?> message) {
|
||||
throw new RuntimeException("intentional test failure");
|
||||
@@ -100,7 +100,7 @@ public class DirectChannelSubscriptionTests {
|
||||
public void testExceptionThrownFromAnnotatedEndpoint() {
|
||||
QueueChannel errorChannel = new QueueChannel();
|
||||
bus.setErrorChannel(errorChannel);
|
||||
MessageEndpointAnnotationPostProcessor postProcessor = new MessageEndpointAnnotationPostProcessor(bus);
|
||||
MessagingAnnotationPostProcessor postProcessor = new MessagingAnnotationPostProcessor(bus);
|
||||
postProcessor.afterPropertiesSet();
|
||||
FailingTestEndpoint endpoint = new FailingTestEndpoint();
|
||||
postProcessor.postProcessAfterInitialization(endpoint, "testEndpoint");
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.config;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.beans.DirectFieldAccessor;
|
||||
import org.springframework.beans.factory.BeanCreationException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.integration.bus.MessageBus;
|
||||
import org.springframework.integration.endpoint.HandlerEndpoint;
|
||||
import org.springframework.integration.handler.MessageHandlerChain;
|
||||
import org.springframework.integration.router.AggregatingMessageHandler;
|
||||
import org.springframework.integration.router.CompletionStrategyAdapter;
|
||||
|
||||
/**
|
||||
* @author Marius Bogoevici
|
||||
*/
|
||||
public class CompletionStrategyAnnotationTests {
|
||||
|
||||
@Test
|
||||
public void testAnnotationWithDefaultSettings() {
|
||||
ApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
new String[] { "classpath:/org/springframework/integration/config/testAnnotatedAggregator.xml" });
|
||||
final String endpointName = "endpointWithDefaultAnnotationAndCustomCompletionStrategy";
|
||||
DirectFieldAccessor aggregatingMessageHandlerAccessor = getDirectFieldAccessorForAggregatingHandler(context,
|
||||
endpointName);
|
||||
Assert.assertTrue(aggregatingMessageHandlerAccessor.getPropertyValue("completionStrategy") instanceof CompletionStrategyAdapter);
|
||||
DirectFieldAccessor invokerAccessor = new DirectFieldAccessor(new DirectFieldAccessor(
|
||||
aggregatingMessageHandlerAccessor.getPropertyValue("completionStrategy")).getPropertyValue("invoker"));
|
||||
Assert.assertSame(context.getBean(endpointName), invokerAccessor.getPropertyValue("object"));
|
||||
Method completionCheckerMethod = (Method) invokerAccessor.getPropertyValue("method");
|
||||
Assert.assertEquals("completionChecker", completionCheckerMethod.getName());
|
||||
|
||||
}
|
||||
|
||||
@Test(expected=BeanCreationException.class)
|
||||
public void testInvalidAnnotation() {
|
||||
new ClassPathXmlApplicationContext(new String[] {
|
||||
"classpath:/org/springframework/integration/config/testInvalidCompletionStrategyAnnotation.xml" });
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private DirectFieldAccessor getDirectFieldAccessorForAggregatingHandler(ApplicationContext context,
|
||||
final String endpointName) {
|
||||
MessageBus messageBus = getMessageBus(context);
|
||||
HandlerEndpoint endpoint = (HandlerEndpoint) messageBus
|
||||
.lookupEndpoint(endpointName + "-endpoint");
|
||||
MessageHandlerChain messageHandlerChain = (MessageHandlerChain) endpoint.getHandler();
|
||||
AggregatingMessageHandler aggregatingMessageHandler = (AggregatingMessageHandler) ((List) new DirectFieldAccessor(
|
||||
messageHandlerChain).getPropertyValue("handlers")).get(0);
|
||||
DirectFieldAccessor aggregatingMessageHandlerAccessor = new DirectFieldAccessor(aggregatingMessageHandler);
|
||||
return aggregatingMessageHandlerAccessor;
|
||||
}
|
||||
|
||||
private MessageBus getMessageBus(ApplicationContext context) {
|
||||
MessageBus messageBus = (MessageBus) context.getBean(MessageBusParser.MESSAGE_BUS_BEAN_NAME);
|
||||
return messageBus;
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,7 @@ import org.springframework.integration.annotation.Subscriber;
|
||||
import org.springframework.integration.bus.MessageBus;
|
||||
import org.springframework.integration.channel.MessageChannel;
|
||||
import org.springframework.integration.channel.QueueChannel;
|
||||
import org.springframework.integration.config.annotation.SubscriberAnnotationPostProcessor;
|
||||
import org.springframework.integration.message.StringMessage;
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,31 +14,38 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.config;
|
||||
package org.springframework.integration.config.annotation;
|
||||
|
||||
import java.util.List;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.aop.framework.Advised;
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.aop.support.DelegatingIntroductionInterceptor;
|
||||
import org.springframework.beans.DirectFieldAccessor;
|
||||
import org.springframework.beans.factory.BeanCreationException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.integration.bus.MessageBus;
|
||||
import org.springframework.integration.config.MessageBusParser;
|
||||
import org.springframework.integration.endpoint.HandlerEndpoint;
|
||||
import org.springframework.integration.handler.MessageHandlerChain;
|
||||
import org.springframework.integration.handler.MessageHandler;
|
||||
import org.springframework.integration.router.AggregatingMessageHandler;
|
||||
import org.springframework.integration.router.CompletionStrategyAdapter;
|
||||
import org.springframework.integration.router.SequenceSizeCompletionStrategy;
|
||||
|
||||
/**
|
||||
* @author Marius Bogoevici
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
public class AggregatorAnnotationTests {
|
||||
|
||||
@Test
|
||||
public void testAnnotationWithDefaultSettings() {
|
||||
ApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
new String[] { "classpath:/org/springframework/integration/config/testAnnotatedAggregator.xml" });
|
||||
new String[] { "classpath:/org/springframework/integration/config/annotation/testAnnotatedAggregator.xml" });
|
||||
final String endpointName = "endpointWithDefaultAnnotation";
|
||||
DirectFieldAccessor aggregatingMessageHandlerAccessor = getDirectFieldAccessorForAggregatingHandler(context,
|
||||
endpointName);
|
||||
@@ -59,7 +66,7 @@ public class AggregatorAnnotationTests {
|
||||
@Test
|
||||
public void testAnnotationWithCustomSettings() {
|
||||
ApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
new String[] { "classpath:/org/springframework/integration/config/testAnnotatedAggregator.xml" });
|
||||
new String[] { "classpath:/org/springframework/integration/config/annotation/testAnnotatedAggregator.xml" });
|
||||
final String endpointName = "endpointWithCustomizedAnnotation";
|
||||
DirectFieldAccessor aggregatingMessageHandlerAccessor = getDirectFieldAccessorForAggregatingHandler(context,
|
||||
endpointName);
|
||||
@@ -79,23 +86,49 @@ public class AggregatorAnnotationTests {
|
||||
aggregatingMessageHandlerAccessor.getPropertyValue("trackedCorrelationIdCapacity"));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private DirectFieldAccessor getDirectFieldAccessorForAggregatingHandler(ApplicationContext context,
|
||||
final String endpointName) {
|
||||
MessageBus messageBus = getMessageBus(context);
|
||||
HandlerEndpoint endpoint = (HandlerEndpoint) messageBus.lookupEndpoint(endpointName + "-endpoint");
|
||||
MessageHandlerChain messageHandlerChain = (MessageHandlerChain) endpoint.getHandler();
|
||||
AggregatingMessageHandler aggregatingMessageHandler = (AggregatingMessageHandler) ((List) new DirectFieldAccessor(
|
||||
messageHandlerChain).getPropertyValue("handlers")).get(0);
|
||||
DirectFieldAccessor aggregatingMessageHandlerAccessor = new DirectFieldAccessor(aggregatingMessageHandler);
|
||||
return aggregatingMessageHandlerAccessor;
|
||||
@Test
|
||||
public void testAnnotationWithCustomCompletionStrategy() throws Exception {
|
||||
ApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
new String[] { "classpath:/org/springframework/integration/config/annotation/testAnnotatedAggregator.xml" });
|
||||
final String endpointName = "endpointWithDefaultAnnotationAndCustomCompletionStrategy";
|
||||
DirectFieldAccessor aggregatingMessageHandlerAccessor = getDirectFieldAccessorForAggregatingHandler(context,
|
||||
endpointName);
|
||||
Assert.assertTrue(aggregatingMessageHandlerAccessor.getPropertyValue("completionStrategy") instanceof CompletionStrategyAdapter);
|
||||
DirectFieldAccessor invokerAccessor = new DirectFieldAccessor(new DirectFieldAccessor(
|
||||
aggregatingMessageHandlerAccessor.getPropertyValue("completionStrategy")).getPropertyValue("invoker"));
|
||||
Assert.assertSame(((Advised) context.getBean(endpointName)).getTargetSource().getTarget(), invokerAccessor.getPropertyValue("object"));
|
||||
Method completionCheckerMethod = (Method) invokerAccessor.getPropertyValue("method");
|
||||
Assert.assertEquals("completionChecker", completionCheckerMethod.getName());
|
||||
}
|
||||
|
||||
@Test(expected=BeanCreationException.class)
|
||||
public void testInvalidCompletionStrategyAnnotation() {
|
||||
new ClassPathXmlApplicationContext(new String[] {
|
||||
"classpath:/org/springframework/integration/config/annotation/testInvalidCompletionStrategyAnnotation.xml" });
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private DirectFieldAccessor getDirectFieldAccessorForAggregatingHandler(ApplicationContext context, final String endpointName) {
|
||||
MessageBus messageBus = this.getMessageBus(context);
|
||||
HandlerEndpoint endpoint = (HandlerEndpoint) messageBus.lookupEndpoint(endpointName + ".MessageHandler.endpoint");
|
||||
MessageHandler handler = endpoint.getHandler();
|
||||
try {
|
||||
if (AopUtils.isAopProxy(handler)) {
|
||||
DelegatingIntroductionInterceptor interceptor = (DelegatingIntroductionInterceptor)
|
||||
((Advised) handler).getAdvisors()[0].getAdvice();
|
||||
Object delegate = new DirectFieldAccessor(interceptor).getPropertyValue("delegate");
|
||||
return new DirectFieldAccessor(delegate);
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
// will return the accessor for the handler
|
||||
}
|
||||
return new DirectFieldAccessor(endpoint.getHandler());
|
||||
}
|
||||
|
||||
|
||||
|
||||
private MessageBus getMessageBus(ApplicationContext context) {
|
||||
MessageBus messageBus = (MessageBus) context.getBean(MessageBusParser.MESSAGE_BUS_BEAN_NAME);
|
||||
return messageBus;
|
||||
return (MessageBus) context.getBean(MessageBusParser.MESSAGE_BUS_BEAN_NAME);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,25 +14,32 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.endpoint.annotation;
|
||||
package org.springframework.integration.config.annotation;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.support.AbstractApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.integration.ConfigurationException;
|
||||
import org.springframework.integration.annotation.Concurrency;
|
||||
import org.springframework.integration.annotation.DefaultOutput;
|
||||
import org.springframework.integration.annotation.Handler;
|
||||
import org.springframework.integration.annotation.MessageEndpoint;
|
||||
import org.springframework.integration.annotation.MessageSource;
|
||||
import org.springframework.integration.annotation.MessageTarget;
|
||||
import org.springframework.integration.annotation.Polled;
|
||||
import org.springframework.integration.annotation.Splitter;
|
||||
import org.springframework.integration.bus.MessageBus;
|
||||
@@ -40,9 +47,9 @@ import org.springframework.integration.channel.ChannelRegistry;
|
||||
import org.springframework.integration.channel.ChannelRegistryAware;
|
||||
import org.springframework.integration.channel.MessageChannel;
|
||||
import org.springframework.integration.channel.QueueChannel;
|
||||
import org.springframework.integration.config.MessageEndpointAnnotationPostProcessor;
|
||||
import org.springframework.integration.endpoint.ConcurrencyPolicy;
|
||||
import org.springframework.integration.endpoint.HandlerEndpoint;
|
||||
import org.springframework.integration.handler.MessageHandler;
|
||||
import org.springframework.integration.message.Message;
|
||||
import org.springframework.integration.message.StringMessage;
|
||||
import org.springframework.integration.scheduling.PollingSchedule;
|
||||
@@ -51,7 +58,47 @@ import org.springframework.integration.scheduling.Schedule;
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
public class MessageEndpointAnnotationPostProcessorTests {
|
||||
public class MessagingAnnotationPostProcessorTests {
|
||||
|
||||
@Test
|
||||
public void testHandlerAnnotation() {
|
||||
MessageBus messageBus = new MessageBus();
|
||||
MessagingAnnotationPostProcessor postProcessor = new MessagingAnnotationPostProcessor(messageBus);
|
||||
postProcessor.afterPropertiesSet();
|
||||
HandlerAnnotatedBean bean = new HandlerAnnotatedBean();
|
||||
Object result = postProcessor.postProcessAfterInitialization(bean, "testBean");
|
||||
assertTrue(result instanceof MessageHandler);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCustomHandlerAnnotation() {
|
||||
MessageBus messageBus = new MessageBus();
|
||||
MessagingAnnotationPostProcessor postProcessor = new MessagingAnnotationPostProcessor(messageBus);
|
||||
postProcessor.afterPropertiesSet();
|
||||
CustomHandlerAnnotatedBean bean = new CustomHandlerAnnotatedBean();
|
||||
Object result = postProcessor.postProcessAfterInitialization(bean, "testBean");
|
||||
assertTrue(result instanceof MessageHandler);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSimpleHandlerWithContext() {
|
||||
ApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
"handlerAnnotationPostProcessorTests.xml", this.getClass());
|
||||
MessageHandler handler = (MessageHandler) context.getBean("simpleHandler");
|
||||
Message<?> reply = handler.handle(new StringMessage("world"));
|
||||
assertEquals("hello world", reply.getPayload());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSimpleHandlerEndpointWithContext() {
|
||||
ApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
"handlerAnnotationPostProcessorTests.xml", this.getClass());
|
||||
MessageChannel inputChannel = (MessageChannel) context.getBean("inputChannel");
|
||||
MessageChannel outputChannel = (MessageChannel) context.getBean("outputChannel");
|
||||
inputChannel.send(new StringMessage("foo"));
|
||||
Message<?> reply = outputChannel.receive(1000);
|
||||
assertEquals("hello foo", reply.getPayload());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSimpleHandler() throws InterruptedException {
|
||||
@@ -104,31 +151,14 @@ public class MessageEndpointAnnotationPostProcessorTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPolledAnnotation() throws InterruptedException {
|
||||
public void testTargetAnnotation() throws InterruptedException {
|
||||
MessageBus messageBus = new MessageBus();
|
||||
QueueChannel testChannel = new QueueChannel();
|
||||
messageBus.registerChannel("testChannel", testChannel);
|
||||
MessageEndpointAnnotationPostProcessor postProcessor =
|
||||
new MessageEndpointAnnotationPostProcessor(messageBus);
|
||||
postProcessor.afterPropertiesSet();
|
||||
PolledAnnotationTestBean testBean = new PolledAnnotationTestBean();
|
||||
postProcessor.postProcessAfterInitialization(testBean, "testBean");
|
||||
messageBus.start();
|
||||
Message<?> message = testChannel.receive(1000);
|
||||
assertEquals("test", message.getPayload());
|
||||
messageBus.stop();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDefaultOutputAnnotation() throws InterruptedException {
|
||||
MessageBus messageBus = new MessageBus();
|
||||
QueueChannel testChannel = new QueueChannel();
|
||||
messageBus.registerChannel("testChannel", testChannel);
|
||||
MessageEndpointAnnotationPostProcessor postProcessor =
|
||||
new MessageEndpointAnnotationPostProcessor(messageBus);
|
||||
MessagingAnnotationPostProcessor postProcessor = new MessagingAnnotationPostProcessor(messageBus);
|
||||
postProcessor.afterPropertiesSet();
|
||||
CountDownLatch latch = new CountDownLatch(1);
|
||||
DefaultOutputAnnotationTestBean testBean = new DefaultOutputAnnotationTestBean(latch);
|
||||
TargetAnnotationTestBean testBean = new TargetAnnotationTestBean(latch);
|
||||
postProcessor.postProcessAfterInitialization(testBean, "testBean");
|
||||
messageBus.start();
|
||||
testChannel.send(new StringMessage("foo"));
|
||||
@@ -141,12 +171,11 @@ public class MessageEndpointAnnotationPostProcessorTests {
|
||||
@Test
|
||||
public void testConcurrencyAnnotationWithValues() {
|
||||
MessageBus messageBus = new MessageBus();
|
||||
MessageEndpointAnnotationPostProcessor postProcessor =
|
||||
new MessageEndpointAnnotationPostProcessor(messageBus);
|
||||
MessagingAnnotationPostProcessor postProcessor = new MessagingAnnotationPostProcessor(messageBus);
|
||||
postProcessor.afterPropertiesSet();
|
||||
ConcurrencyAnnotationTestBean testBean = new ConcurrencyAnnotationTestBean();
|
||||
postProcessor.postProcessAfterInitialization(testBean, "testBean");
|
||||
HandlerEndpoint endpoint = (HandlerEndpoint) messageBus.lookupEndpoint("testBean-endpoint");
|
||||
HandlerEndpoint endpoint = (HandlerEndpoint) messageBus.lookupEndpoint("testBean.MessageHandler.endpoint");
|
||||
ConcurrencyPolicy concurrencyPolicy = endpoint.getConcurrencyPolicy();
|
||||
assertEquals(17, concurrencyPolicy.getCoreSize());
|
||||
assertEquals(42, concurrencyPolicy.getMaxSize());
|
||||
@@ -156,14 +185,13 @@ public class MessageEndpointAnnotationPostProcessorTests {
|
||||
|
||||
@Test(expected=IllegalArgumentException.class)
|
||||
public void testPostProcessorWithNullMessageBus() {
|
||||
new MessageEndpointAnnotationPostProcessor(null);
|
||||
new MessagingAnnotationPostProcessor(null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testChannelRegistryAwareBean() {
|
||||
MessageBus messageBus = new MessageBus();
|
||||
MessageEndpointAnnotationPostProcessor postProcessor =
|
||||
new MessageEndpointAnnotationPostProcessor(messageBus);
|
||||
MessagingAnnotationPostProcessor postProcessor = new MessagingAnnotationPostProcessor(messageBus);
|
||||
postProcessor.afterPropertiesSet();
|
||||
ChannelRegistryAwareTestBean testBean = new ChannelRegistryAwareTestBean();
|
||||
assertNull(testBean.getChannelRegistry());
|
||||
@@ -177,8 +205,7 @@ public class MessageEndpointAnnotationPostProcessorTests {
|
||||
public void testProxiedMessageEndpointAnnotation() {
|
||||
MessageBus messageBus = new MessageBus();
|
||||
messageBus.setAutoCreateChannels(true);
|
||||
MessageEndpointAnnotationPostProcessor postProcessor =
|
||||
new MessageEndpointAnnotationPostProcessor(messageBus);
|
||||
MessagingAnnotationPostProcessor postProcessor = new MessagingAnnotationPostProcessor(messageBus);
|
||||
postProcessor.afterPropertiesSet();
|
||||
ProxyFactory proxyFactory = new ProxyFactory(new SimpleAnnotatedEndpoint());
|
||||
Object proxy = proxyFactory.getProxy();
|
||||
@@ -195,8 +222,7 @@ public class MessageEndpointAnnotationPostProcessorTests {
|
||||
public void testMessageEndpointAnnotationInherited() {
|
||||
MessageBus messageBus = new MessageBus();
|
||||
messageBus.setAutoCreateChannels(true);
|
||||
MessageEndpointAnnotationPostProcessor postProcessor =
|
||||
new MessageEndpointAnnotationPostProcessor(messageBus);
|
||||
MessagingAnnotationPostProcessor postProcessor = new MessagingAnnotationPostProcessor(messageBus);
|
||||
postProcessor.afterPropertiesSet();
|
||||
postProcessor.postProcessAfterInitialization(new SimpleAnnotatedEndpointSubclass(), "subclass");
|
||||
messageBus.start();
|
||||
@@ -211,8 +237,7 @@ public class MessageEndpointAnnotationPostProcessorTests {
|
||||
public void testMessageEndpointAnnotationInheritedWithProxy() {
|
||||
MessageBus messageBus = new MessageBus();
|
||||
messageBus.setAutoCreateChannels(true);
|
||||
MessageEndpointAnnotationPostProcessor postProcessor =
|
||||
new MessageEndpointAnnotationPostProcessor(messageBus);
|
||||
MessagingAnnotationPostProcessor postProcessor = new MessagingAnnotationPostProcessor(messageBus);
|
||||
postProcessor.afterPropertiesSet();
|
||||
ProxyFactory proxyFactory = new ProxyFactory(new SimpleAnnotatedEndpointSubclass());
|
||||
Object proxy = proxyFactory.getProxy();
|
||||
@@ -232,8 +257,7 @@ public class MessageEndpointAnnotationPostProcessorTests {
|
||||
MessageChannel outputChannel = new QueueChannel();
|
||||
messageBus.registerChannel("inputChannel", inputChannel);
|
||||
messageBus.registerChannel("outputChannel", outputChannel);
|
||||
MessageEndpointAnnotationPostProcessor postProcessor =
|
||||
new MessageEndpointAnnotationPostProcessor(messageBus);
|
||||
MessagingAnnotationPostProcessor postProcessor = new MessagingAnnotationPostProcessor(messageBus);
|
||||
postProcessor.afterPropertiesSet();
|
||||
postProcessor.postProcessAfterInitialization(new SimpleAnnotatedEndpointImplementation(), "impl");
|
||||
messageBus.start();
|
||||
@@ -246,8 +270,7 @@ public class MessageEndpointAnnotationPostProcessorTests {
|
||||
public void testMessageEndpointAnnotationInheritedFromInterfaceWithAutoCreatedChannels() {
|
||||
MessageBus messageBus = new MessageBus();
|
||||
messageBus.setAutoCreateChannels(true);
|
||||
MessageEndpointAnnotationPostProcessor postProcessor =
|
||||
new MessageEndpointAnnotationPostProcessor(messageBus);
|
||||
MessagingAnnotationPostProcessor postProcessor = new MessagingAnnotationPostProcessor(messageBus);
|
||||
postProcessor.afterPropertiesSet();
|
||||
postProcessor.postProcessAfterInitialization(new SimpleAnnotatedEndpointImplementation(), "impl");
|
||||
messageBus.start();
|
||||
@@ -265,8 +288,7 @@ public class MessageEndpointAnnotationPostProcessorTests {
|
||||
MessageChannel outputChannel = new QueueChannel();
|
||||
messageBus.registerChannel("inputChannel", inputChannel);
|
||||
messageBus.registerChannel("outputChannel", outputChannel);
|
||||
MessageEndpointAnnotationPostProcessor postProcessor =
|
||||
new MessageEndpointAnnotationPostProcessor(messageBus);
|
||||
MessagingAnnotationPostProcessor postProcessor = new MessagingAnnotationPostProcessor(messageBus);
|
||||
postProcessor.afterPropertiesSet();
|
||||
ProxyFactory proxyFactory = new ProxyFactory(new SimpleAnnotatedEndpointImplementation());
|
||||
Object proxy = proxyFactory.getProxy();
|
||||
@@ -284,8 +306,7 @@ public class MessageEndpointAnnotationPostProcessorTests {
|
||||
QueueChannel output = new QueueChannel();
|
||||
messageBus.registerChannel("input", input);
|
||||
messageBus.registerChannel("output", output);
|
||||
MessageEndpointAnnotationPostProcessor postProcessor =
|
||||
new MessageEndpointAnnotationPostProcessor(messageBus);
|
||||
MessagingAnnotationPostProcessor postProcessor = new MessagingAnnotationPostProcessor(messageBus);
|
||||
postProcessor.afterPropertiesSet();
|
||||
SplitterAnnotationTestEndpoint endpoint = new SplitterAnnotationTestEndpoint();
|
||||
postProcessor.postProcessAfterInitialization(endpoint, "endpoint");
|
||||
@@ -311,8 +332,7 @@ public class MessageEndpointAnnotationPostProcessorTests {
|
||||
MessageBus messageBus = new MessageBus();
|
||||
QueueChannel testChannel = new QueueChannel();
|
||||
messageBus.registerChannel("testChannel", testChannel);
|
||||
MessageEndpointAnnotationPostProcessor postProcessor =
|
||||
new MessageEndpointAnnotationPostProcessor(messageBus);
|
||||
MessagingAnnotationPostProcessor postProcessor = new MessagingAnnotationPostProcessor(messageBus);
|
||||
postProcessor.afterPropertiesSet();
|
||||
AnnotatedEndpointWithNoHandlerMethod endpoint = new AnnotatedEndpointWithNoHandlerMethod();
|
||||
postProcessor.postProcessAfterInitialization(endpoint, "endpoint");
|
||||
@@ -323,12 +343,11 @@ public class MessageEndpointAnnotationPostProcessorTests {
|
||||
MessageBus messageBus = new MessageBus();
|
||||
QueueChannel testChannel = new QueueChannel();
|
||||
messageBus.registerChannel("testChannel", testChannel);
|
||||
MessageEndpointAnnotationPostProcessor postProcessor =
|
||||
new MessageEndpointAnnotationPostProcessor(messageBus);
|
||||
MessagingAnnotationPostProcessor postProcessor = new MessagingAnnotationPostProcessor(messageBus);
|
||||
postProcessor.afterPropertiesSet();
|
||||
AnnotatedEndpointWithPolledAnnotation endpoint = new AnnotatedEndpointWithPolledAnnotation();
|
||||
postProcessor.postProcessAfterInitialization(endpoint, "testBean");
|
||||
HandlerEndpoint processedEndpoint = (HandlerEndpoint) messageBus.lookupEndpoint("testBean-endpoint");
|
||||
HandlerEndpoint processedEndpoint = (HandlerEndpoint) messageBus.lookupEndpoint("testBean.MessageHandler.endpoint");
|
||||
Schedule schedule = processedEndpoint.getSubscription().getSchedule();
|
||||
assertEquals(PollingSchedule.class, schedule.getClass());
|
||||
PollingSchedule pollingSchedule = (PollingSchedule) schedule;
|
||||
@@ -338,31 +357,31 @@ public class MessageEndpointAnnotationPostProcessorTests {
|
||||
assertEquals(TimeUnit.SECONDS, pollingSchedule.getTimeUnit());
|
||||
}
|
||||
|
||||
|
||||
@MessageEndpoint(output="testChannel")
|
||||
private static class PolledAnnotationTestBean {
|
||||
|
||||
@Polled(period=100)
|
||||
public String poller() {
|
||||
return "test";
|
||||
}
|
||||
|
||||
@Handler
|
||||
public Message<?> handle(Message<?> message) {
|
||||
return message;
|
||||
}
|
||||
@Test
|
||||
public void testMessageSourceAnnotation() {
|
||||
MessageBus messageBus = new MessageBus();
|
||||
QueueChannel testChannel = new QueueChannel();
|
||||
messageBus.registerChannel("testChannel", testChannel);
|
||||
MessagingAnnotationPostProcessor postProcessor = new MessagingAnnotationPostProcessor(messageBus);
|
||||
postProcessor.afterPropertiesSet();
|
||||
MessageSourceAnnotationTestBean testBean = new MessageSourceAnnotationTestBean();
|
||||
postProcessor.postProcessAfterInitialization(testBean, "testBean");
|
||||
messageBus.start();
|
||||
Message<?> message = testChannel.receive(1000);
|
||||
assertEquals("test", message.getPayload());
|
||||
messageBus.stop();
|
||||
}
|
||||
|
||||
|
||||
@MessageEndpoint(input="testChannel")
|
||||
private static class DefaultOutputAnnotationTestBean {
|
||||
private static class TargetAnnotationTestBean {
|
||||
|
||||
private String messageText;
|
||||
|
||||
private CountDownLatch latch;
|
||||
|
||||
|
||||
public DefaultOutputAnnotationTestBean(CountDownLatch latch) {
|
||||
public TargetAnnotationTestBean(CountDownLatch latch) {
|
||||
this.latch = latch;
|
||||
}
|
||||
|
||||
@@ -370,12 +389,7 @@ public class MessageEndpointAnnotationPostProcessorTests {
|
||||
return this.messageText;
|
||||
}
|
||||
|
||||
@Handler
|
||||
public Message<?> handle(Message<?> message) {
|
||||
return message;
|
||||
}
|
||||
|
||||
@DefaultOutput
|
||||
@MessageTarget
|
||||
public void countdown(String input) {
|
||||
this.messageText = input;
|
||||
latch.countDown();
|
||||
@@ -418,7 +432,7 @@ public class MessageEndpointAnnotationPostProcessorTests {
|
||||
}
|
||||
|
||||
|
||||
@MessageEndpoint(input="inputChannel", output="outputChannel", pollPeriod=25)
|
||||
@MessageEndpoint(input="inputChannel", output="outputChannel")
|
||||
private static interface SimpleAnnotatedEndpointInterface {
|
||||
String test(String input);
|
||||
}
|
||||
@@ -458,4 +472,43 @@ public class MessageEndpointAnnotationPostProcessorTests {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static class HandlerAnnotatedBean {
|
||||
|
||||
@Handler
|
||||
public String test(String s) {
|
||||
return s + s;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Handler
|
||||
private static @interface CustomHandler {
|
||||
}
|
||||
|
||||
|
||||
private static class CustomHandlerAnnotatedBean {
|
||||
|
||||
@CustomHandler
|
||||
public String test(String s) {
|
||||
return s + s;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@MessageEndpoint(output="testChannel")
|
||||
@Polled(period=100)
|
||||
private static class MessageSourceAnnotationTestBean {
|
||||
|
||||
@MessageSource
|
||||
public String test() {
|
||||
return "test";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,15 +14,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.endpoint.annotation;
|
||||
package org.springframework.integration.config.annotation;
|
||||
|
||||
import org.springframework.integration.annotation.Handler;
|
||||
import org.springframework.integration.annotation.MessageEndpoint;
|
||||
import org.springframework.integration.endpoint.annotation.ITestEndpoint;
|
||||
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
@MessageEndpoint(input="inputChannel", output="outputChannel", pollPeriod=10)
|
||||
@MessageEndpoint(input="inputChannel", output="outputChannel")
|
||||
public class SimpleAnnotatedEndpoint implements ITestEndpoint {
|
||||
|
||||
@Handler
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2007 the original author or authors.
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.config;
|
||||
package org.springframework.integration.config.annotation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -60,7 +60,7 @@ public class TestAnnotatedEndpointWithCompletionStrategy {
|
||||
public boolean completionChecker(List<Message<?>> messages) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public ConcurrentMap<Object, Message<?>> getAggregatedMessages() {
|
||||
return aggregatedMessages;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2007 the original author or authors.
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,21 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.config;
|
||||
package org.springframework.integration.config.annotation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
import org.springframework.integration.annotation.Aggregator;
|
||||
import org.springframework.integration.annotation.CompletionStrategy;
|
||||
import org.springframework.integration.annotation.MessageEndpoint;
|
||||
import org.springframework.integration.message.Message;
|
||||
import org.springframework.integration.message.StringMessage;
|
||||
import org.springframework.integration.router.MessageSequenceComparator;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
@@ -40,7 +32,7 @@ public class TestAnnotatedEndpointWithCompletionStrategyOnly {
|
||||
|
||||
@CompletionStrategy
|
||||
public boolean checkCompleteness(List<Message<?>> messages) {
|
||||
throw new UnsupportedOperationException("Not intended to being called");
|
||||
throw new UnsupportedOperationException("Not intended to be called");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.config;
|
||||
package org.springframework.integration.config.annotation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.config;
|
||||
package org.springframework.integration.config.annotation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.endpoint.annotation;
|
||||
package org.springframework.integration.config.annotation;
|
||||
|
||||
import org.springframework.integration.annotation.Handler;
|
||||
import org.springframework.integration.annotation.MessageEndpoint;
|
||||
@@ -22,7 +22,7 @@ import org.springframework.integration.annotation.MessageEndpoint;
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
@MessageEndpoint(input="inputChannel", output="outputChannel", pollPeriod=10)
|
||||
@MessageEndpoint(input="inputChannel", output="outputChannel")
|
||||
public class TypeConvertingTestEndpoint {
|
||||
|
||||
@Handler
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans:beans xmlns="http://www.springframework.org/schema/integration"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:beans="http://www.springframework.org/schema/beans"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://www.springframework.org/schema/integration
|
||||
http://www.springframework.org/schema/integration/spring-integration-core-1.0.xsd">
|
||||
|
||||
<message-bus/>
|
||||
|
||||
<channel id="inputChannel"/>
|
||||
<channel id="outputChannel"/>
|
||||
|
||||
<handler-endpoint input-channel="inputChannel" handler="simpleHandler" output-channel="outputChannel"/>
|
||||
|
||||
<beans:bean class="org.springframework.integration.config.annotation.MessagingAnnotationPostProcessor">
|
||||
<beans:constructor-arg ref="internal.MessageBus"/>
|
||||
</beans:bean>
|
||||
|
||||
<beans:bean id="simpleHandler" class="org.springframework.integration.handler.annotation.SimpleHandlerTestBean"/>
|
||||
|
||||
</beans:beans>
|
||||
@@ -13,9 +13,9 @@
|
||||
|
||||
<integration:channel id="outputChannel"/>
|
||||
|
||||
<bean id="endpoint" class="org.springframework.integration.endpoint.annotation.SimpleAnnotatedEndpoint"/>
|
||||
<bean id="endpoint" class="org.springframework.integration.config.annotation.SimpleAnnotatedEndpoint"/>
|
||||
|
||||
<bean class="org.springframework.integration.config.MessageEndpointAnnotationPostProcessor">
|
||||
<bean class="org.springframework.integration.config.annotation.MessagingAnnotationPostProcessor">
|
||||
<constructor-arg ref="bus"/>
|
||||
</bean>
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
<property name="autoCreateChannels" value="true"/>
|
||||
</bean>
|
||||
|
||||
<bean id="endpoint" class="org.springframework.integration.endpoint.annotation.SimpleAnnotatedEndpoint"/>
|
||||
<bean id="endpoint" class="org.springframework.integration.config.annotation.SimpleAnnotatedEndpoint"/>
|
||||
|
||||
<bean class="org.springframework.integration.config.MessageEndpointAnnotationPostProcessor">
|
||||
<bean class="org.springframework.integration.config.annotation.MessagingAnnotationPostProcessor">
|
||||
<constructor-arg ref="bus"/>
|
||||
</bean>
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
|
||||
<context:component-scan base-package="org.springframework.integration.config" use-default-filters="false">
|
||||
<context:include-filter type="regex"
|
||||
expression="org\.springframework\.integration\.config\.TestAnnotatedEndpoint.*"/>
|
||||
expression="org\.springframework\.integration\.config\.annotation\.TestAnnotatedEndpoint.*"/>
|
||||
<context:exclude-filter type="regex"
|
||||
expression="org\.springframework\.integration\.config\.TestAnnotatedEndpointWithCompletionStrategyOnly"/>
|
||||
expression="org\.springframework\.integration\.config\.annotation\.TestAnnotatedEndpointWithCompletionStrategyOnly"/>
|
||||
</context:component-scan>
|
||||
|
||||
</beans:beans>
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
<context:component-scan base-package="org.springframework.integration.config" use-default-filters="false">
|
||||
<context:include-filter type="regex"
|
||||
expression="org\.springframework\.integration\.config\.TestAnnotatedEndpointWithCompletionStrategyOnly"/>
|
||||
expression="org\.springframework\.integration\.config\.annotation\.TestAnnotatedEndpointWithCompletionStrategyOnly"/>
|
||||
</context:component-scan>
|
||||
|
||||
</beans:beans>
|
||||
@@ -13,9 +13,9 @@
|
||||
|
||||
<integration:channel id="outputChannel"/>
|
||||
|
||||
<bean id="endpoint" class="org.springframework.integration.endpoint.annotation.TypeConvertingTestEndpoint"/>
|
||||
<bean id="endpoint" class="org.springframework.integration.config.annotation.TypeConvertingTestEndpoint"/>
|
||||
|
||||
<bean class="org.springframework.integration.config.MessageEndpointAnnotationPostProcessor">
|
||||
<bean class="org.springframework.integration.config.annotation.MessagingAnnotationPostProcessor">
|
||||
<constructor-arg ref="bus"/>
|
||||
</bean>
|
||||
|
||||
@@ -19,14 +19,16 @@ package org.springframework.integration.endpoint.annotation;
|
||||
import org.springframework.integration.annotation.Handler;
|
||||
import org.springframework.integration.annotation.MessageEndpoint;
|
||||
import org.springframework.integration.annotation.Polled;
|
||||
import org.springframework.integration.annotation.MessageSource;
|
||||
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
@MessageEndpoint(output="outputChannel")
|
||||
@Polled(period=100)
|
||||
public class InboundChannelAdapterTestBean {
|
||||
|
||||
@Polled(period=100)
|
||||
@MessageSource
|
||||
public String getName() {
|
||||
return "world";
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.springframework.integration.message.StringMessage;
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
@MessageEndpoint(input="inputChannel", output="outputChannel", pollPeriod=10)
|
||||
@MessageEndpoint(input="inputChannel", output="outputChannel")
|
||||
public class MessageParameterAnnotatedEndpoint {
|
||||
|
||||
@Handler
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2007 the original author or authors.
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,26 +14,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.endpoint.annotation;
|
||||
package org.springframework.integration.handler.annotation;
|
||||
|
||||
import org.springframework.integration.annotation.DefaultOutput;
|
||||
import org.springframework.integration.annotation.Handler;
|
||||
import org.springframework.integration.annotation.MessageEndpoint;
|
||||
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
@MessageEndpoint(input="inputChannel")
|
||||
public class OutboundChannelAdapterTestBean {
|
||||
public class SimpleHandlerTestBean {
|
||||
|
||||
@Handler
|
||||
public String sayHello(String name) {
|
||||
return "hello " + name;
|
||||
}
|
||||
|
||||
@DefaultOutput
|
||||
public void sendGreeting(String greeting) {
|
||||
System.out.println(greeting);
|
||||
public String sayHello(String input) {
|
||||
return "hello " + input;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user