From fc2a30d8fdfd0b794e2300d67c4603400cef0cbb Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Mon, 13 Oct 2008 14:20:49 +0000 Subject: [PATCH] Renamed ApplicationEventOutboundChannelAdapter to ApplicationEventPublishingMessageConsumer, since a consumer only plays the role of a "Channel Adapter" when connected to a channel within either a PublishingConsumerEndpoint or SubscribingConsumerEndpoint. --- ...va => ApplicationEventPublishingMessageConsumer.java} | 9 +++++---- ... ApplicationEventPublishingMessageConsumerTests.java} | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) rename org.springframework.integration.event/src/main/java/org/springframework/integration/event/{ApplicationEventOutboundChannelAdapter.java => ApplicationEventPublishingMessageConsumer.java} (78%) rename org.springframework.integration.event/src/test/java/org/springframework/integration/event/{ApplicationEventOutboundChannelAdapterTests.java => ApplicationEventPublishingMessageConsumerTests.java} (87%) diff --git a/org.springframework.integration.event/src/main/java/org/springframework/integration/event/ApplicationEventOutboundChannelAdapter.java b/org.springframework.integration.event/src/main/java/org/springframework/integration/event/ApplicationEventPublishingMessageConsumer.java similarity index 78% rename from org.springframework.integration.event/src/main/java/org/springframework/integration/event/ApplicationEventOutboundChannelAdapter.java rename to org.springframework.integration.event/src/main/java/org/springframework/integration/event/ApplicationEventPublishingMessageConsumer.java index b72f80517f..cf5e1f8efa 100644 --- a/org.springframework.integration.event/src/main/java/org/springframework/integration/event/ApplicationEventOutboundChannelAdapter.java +++ b/org.springframework.integration.event/src/main/java/org/springframework/integration/event/ApplicationEventPublishingMessageConsumer.java @@ -24,13 +24,14 @@ import org.springframework.integration.message.Message; import org.springframework.util.Assert; /** - * An outbound Channel Adapter that publishes each {@link Message} it receives - * as a {@link MessagingEvent}. The {@link MessagingEvent} is a subclass of Spring's - * {@link ApplicationEvent} used by this adapter to simply wrap the {@link Message}. + * A {@link org.springframework.integration.message.MessageConsumer} that + * publishes each {@link Message} it receives as a {@link MessagingEvent}. The + * {@link MessagingEvent} is a subclass of Spring's {@link ApplicationEvent} + * used by this adapter to simply wrap the {@link Message}. * * @author Mark Fisher */ -public class ApplicationEventOutboundChannelAdapter extends AbstractMessageConsumer implements ApplicationEventPublisherAware { +public class ApplicationEventPublishingMessageConsumer extends AbstractMessageConsumer implements ApplicationEventPublisherAware { private ApplicationEventPublisher applicationEventPublisher; diff --git a/org.springframework.integration.event/src/test/java/org/springframework/integration/event/ApplicationEventOutboundChannelAdapterTests.java b/org.springframework.integration.event/src/test/java/org/springframework/integration/event/ApplicationEventPublishingMessageConsumerTests.java similarity index 87% rename from org.springframework.integration.event/src/test/java/org/springframework/integration/event/ApplicationEventOutboundChannelAdapterTests.java rename to org.springframework.integration.event/src/test/java/org/springframework/integration/event/ApplicationEventPublishingMessageConsumerTests.java index fbfd0000c5..c55f8975e5 100644 --- a/org.springframework.integration.event/src/test/java/org/springframework/integration/event/ApplicationEventOutboundChannelAdapterTests.java +++ b/org.springframework.integration.event/src/test/java/org/springframework/integration/event/ApplicationEventPublishingMessageConsumerTests.java @@ -29,17 +29,17 @@ import org.springframework.integration.message.StringMessage; /** * @author Mark Fisher */ -public class ApplicationEventOutboundChannelAdapterTests { +public class ApplicationEventPublishingMessageConsumerTests { @Test @SuppressWarnings("unchecked") public void testSendingEvent() throws InterruptedException { TestApplicationEventPublisher publisher = new TestApplicationEventPublisher(); - ApplicationEventOutboundChannelAdapter adapter = new ApplicationEventOutboundChannelAdapter(); - adapter.setApplicationEventPublisher(publisher); + ApplicationEventPublishingMessageConsumer consumer = new ApplicationEventPublishingMessageConsumer(); + consumer.setApplicationEventPublisher(publisher); assertNull(publisher.getLastEvent()); Message message = new StringMessage("testing"); - adapter.onMessage(message); + consumer.onMessage(message); ApplicationEvent event = publisher.getLastEvent(); assertEquals(MessagingEvent.class, event.getClass()); assertEquals(message, ((MessagingEvent) event).getMessage());