Renamed SubscribableSource to Subscribable, and it no longer extends MessageSource.

This commit is contained in:
Mark Fisher
2008-09-07 21:20:00 +00:00
parent 35e744e60a
commit bd7c74b69c
7 changed files with 16 additions and 16 deletions

View File

@@ -20,7 +20,7 @@ import org.springframework.integration.dispatcher.SimpleDispatcher;
import org.springframework.integration.endpoint.MessageEndpoint;
import org.springframework.integration.message.Message;
import org.springframework.integration.message.MessageConsumer;
import org.springframework.integration.message.SubscribableSource;
import org.springframework.integration.message.Subscribable;
/**
* A channel that invokes the subscribed {@link MessageEndpoint endpoint(s)}
@@ -29,7 +29,7 @@ import org.springframework.integration.message.SubscribableSource;
* @author Dave Syer
* @author Mark Fisher
*/
public class DirectChannel extends AbstractMessageChannel implements SubscribableSource {
public class DirectChannel extends AbstractMessageChannel implements Subscribable {
private final SimpleDispatcher dispatcher = new SimpleDispatcher();

View File

@@ -20,12 +20,12 @@ import org.springframework.core.task.TaskExecutor;
import org.springframework.integration.dispatcher.BroadcastingDispatcher;
import org.springframework.integration.message.Message;
import org.springframework.integration.message.MessageConsumer;
import org.springframework.integration.message.SubscribableSource;
import org.springframework.integration.message.Subscribable;
/**
* @author Mark Fisher
*/
public class PublishSubscribeChannel extends AbstractMessageChannel implements SubscribableSource {
public class PublishSubscribeChannel extends AbstractMessageChannel implements Subscribable {
private final BroadcastingDispatcher dispatcher = new BroadcastingDispatcher();

View File

@@ -17,14 +17,14 @@
package org.springframework.integration.dispatcher;
import org.springframework.integration.message.Message;
import org.springframework.integration.message.SubscribableSource;
import org.springframework.integration.message.Subscribable;
/**
* Strategy interface for dispatching messages.
*
* @author Mark Fisher
*/
public interface MessageDispatcher extends SubscribableSource {
public interface MessageDispatcher extends Subscribable {
boolean dispatch(Message<?> message);

View File

@@ -24,7 +24,7 @@ import org.springframework.integration.message.Message;
import org.springframework.integration.message.MessageConsumer;
import org.springframework.integration.message.MessageHandlingException;
import org.springframework.integration.message.MessagingException;
import org.springframework.integration.message.SubscribableSource;
import org.springframework.integration.message.Subscribable;
import org.springframework.integration.scheduling.PollingSchedule;
import org.springframework.integration.scheduling.Schedule;
@@ -93,8 +93,8 @@ public abstract class AbstractMessageConsumingEndpoint extends AbstractEndpoint
if (this.inputChannel == null) {
throw new ConfigurationException("failed to start endpoint, inputChannel is required");
}
if (this.inputChannel instanceof SubscribableSource) {
((SubscribableSource) inputChannel).subscribe(this);
if (this.inputChannel instanceof Subscribable) {
((Subscribable) inputChannel).subscribe(this);
}
else if (this.inputChannel instanceof PollableChannel) {
if (this.getTaskScheduler() == null) {
@@ -111,8 +111,8 @@ public abstract class AbstractMessageConsumingEndpoint extends AbstractEndpoint
if (!this.running) {
return;
}
if (this.inputChannel instanceof SubscribableSource) {
((SubscribableSource) inputChannel).unsubscribe(this);
if (this.inputChannel instanceof Subscribable) {
((Subscribable) inputChannel).unsubscribe(this);
}
else if (this.poller != null) {
this.getTaskScheduler().cancel(poller, true);

View File

@@ -20,14 +20,14 @@ import org.springframework.integration.channel.PollableChannel;
import org.springframework.integration.dispatcher.SimpleDispatcher;
import org.springframework.integration.message.Message;
import org.springframework.integration.message.MessageConsumer;
import org.springframework.integration.message.SubscribableSource;
import org.springframework.integration.message.Subscribable;
import org.springframework.integration.scheduling.Schedule;
import org.springframework.util.Assert;
/**
* @author Mark Fisher
*/
public class ChannelPoller extends AbstractPoller implements SubscribableSource {
public class ChannelPoller extends AbstractPoller implements Subscribable {
private final PollableChannel channel;

View File

@@ -21,7 +21,7 @@ package org.springframework.integration.message;
*
* @author Mark Fisher
*/
public interface SubscribableSource extends MessageSource {
public interface Subscribable {
/**
* Register a {@link MessageConsumer} as a subscriber to this source.

View File

@@ -21,12 +21,12 @@ import java.util.concurrent.CopyOnWriteArrayList;
import org.springframework.integration.message.Message;
import org.springframework.integration.message.MessageConsumer;
import org.springframework.integration.message.SubscribableSource;
import org.springframework.integration.message.Subscribable;
/**
* @author Mark Fisher
*/
public class TestSubscribableSource implements SubscribableSource {
public class TestSubscribableSource implements Subscribable {
private final List<MessageConsumer> subscibers = new CopyOnWriteArrayList<MessageConsumer>();