changed signature of message dispatcher
This commit is contained in:
parent
b7c5804326
commit
41309cca1c
@ -5,10 +5,7 @@ import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
|
||||
/**
|
||||
* This implementation uses weak references to the elements. Iterators automatically perform cleanups of
|
||||
* garbage collected objects during iteration -> no dedicated maintenance operations need to be called or run in background.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* This implementation uses strong references to the elements.
|
||||
* <p/>
|
||||
*
|
||||
* @author bennidi
|
||||
|
@ -1,7 +1,6 @@
|
||||
package net.engio.mbassy.dispatch;
|
||||
|
||||
import net.engio.mbassy.bus.MessagePublication;
|
||||
import net.engio.mbassy.common.IConcurrentSet;
|
||||
import net.engio.mbassy.subscription.MessageEnvelope;
|
||||
|
||||
/**
|
||||
@ -21,7 +20,7 @@ public class EnvelopedMessageDispatcher extends DelegatingMessageDispatcher {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispatch(MessagePublication publication, Object message, IConcurrentSet listeners) {
|
||||
public void dispatch(MessagePublication publication, Object message, Iterable listeners) {
|
||||
getDelegate().dispatch(publication, new MessageEnvelope(message), listeners);
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package net.engio.mbassy.dispatch;
|
||||
|
||||
import net.engio.mbassy.bus.MessagePublication;
|
||||
import net.engio.mbassy.common.IConcurrentSet;
|
||||
import net.engio.mbassy.listener.IMessageFilter;
|
||||
|
||||
/**
|
||||
@ -37,7 +36,7 @@ public class FilteredMessageDispatcher extends DelegatingMessageDispatcher {
|
||||
|
||||
|
||||
@Override
|
||||
public void dispatch(MessagePublication publication, Object message, IConcurrentSet listeners) {
|
||||
public void dispatch(MessagePublication publication, Object message, Iterable listeners) {
|
||||
if (passesFilter(message)) {
|
||||
getDelegate().dispatch(publication, message, listeners);
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package net.engio.mbassy.dispatch;
|
||||
|
||||
import net.engio.mbassy.bus.MessagePublication;
|
||||
import net.engio.mbassy.common.IConcurrentSet;
|
||||
|
||||
/**
|
||||
* A message dispatcher provides the functionality to deliver a single message
|
||||
@ -29,7 +28,7 @@ public interface IMessageDispatcher extends ISubscriptionContextAware {
|
||||
* @param message The message that should be delivered to the listeners
|
||||
* @param listeners The listeners that should receive the message
|
||||
*/
|
||||
void dispatch(MessagePublication publication, Object message, IConcurrentSet listeners);
|
||||
void dispatch(MessagePublication publication, Object message, Iterable listeners);
|
||||
|
||||
/**
|
||||
* Get the handler invocation that will be used to deliver the
|
||||
|
@ -1,7 +1,6 @@
|
||||
package net.engio.mbassy.dispatch;
|
||||
|
||||
import net.engio.mbassy.bus.MessagePublication;
|
||||
import net.engio.mbassy.common.IConcurrentSet;
|
||||
import net.engio.mbassy.subscription.AbstractSubscriptionContextAware;
|
||||
import net.engio.mbassy.subscription.SubscriptionContext;
|
||||
|
||||
@ -25,7 +24,7 @@ public class MessageDispatcher extends AbstractSubscriptionContextAware implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispatch(final MessagePublication publication, final Object message, final IConcurrentSet listeners) {
|
||||
public void dispatch(final MessagePublication publication, final Object message, final Iterable listeners) {
|
||||
publication.markDelivered();
|
||||
for (Object listener : listeners) {
|
||||
getInvocation().invoke(listener, message);
|
||||
|
@ -75,4 +75,6 @@ public class Subscription {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user