Added 'broadcaster' property to Message.
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user