Added 'broadcaster' property to Message.

This commit is contained in:
Mark Fisher
2008-01-10 02:54:39 +00:00
parent 5c8262c152
commit f860e0cdd6
2 changed files with 18 additions and 0 deletions

View File

@@ -35,6 +35,13 @@ public interface MessageChannel {
*/
String getName();
/**
* Return whether this channel has been designated as a broadcaster. If so,
* any dispatcher retrieving messages from this channel should send each
* message to each of its receivers.
*/
boolean isBroadcaster();
/**
* Send a message, blocking indefinitely if necessary.
*

View File

@@ -36,8 +36,11 @@ public class SimpleChannel implements MessageChannel, BeanNameAware {
private String name;
private boolean broadcaster = false;
private BlockingQueue<Message<?>> queue;
/**
* Create a channel with the specified queue capacity.
*/
@@ -67,6 +70,14 @@ public class SimpleChannel implements MessageChannel, BeanNameAware {
return this.name;
}
public boolean isBroadcaster() {
return this.broadcaster;
}
public void setBroadcaster(boolean broadcaster) {
this.broadcaster = broadcaster;
}
/**
* Set the name of this channel to its bean name. This will be invoked
* automatically whenever the channel is configured explicitly with a bean