java.lang.Object
org.evrete.util.BroadcastingPublisher<E>
- Type Parameters:
E- the type of event that this publisher will broadcast
- All Implemented Interfaces:
Events.Publisher<E>
public class BroadcastingPublisher<E extends Events.Event>
extends Object
implements Events.Publisher<E>
An implementation of the
Events.Publisher interface that can broadcast events.
When constructed using the BroadcastingPublisher(BroadcastingPublisher) constructor,
this implementation will publish events to both its own subscriptions and those of its parent.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidSubscribes a consumer to this publisher.intMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.evrete.api.events.Events.Publisher
subscribe, subscribe, subscribe, subscribeAsync, subscribeAsync
-
Constructor Details
-
BroadcastingPublisher
-
BroadcastingPublisher
-
-
Method Details
-
totalLocalSubscriptions
public int totalLocalSubscriptions() -
subscribe
Description copied from interface:Events.PublisherSubscribes a consumer to this publisher.- Specified by:
subscribein interfaceEvents.Publisher<E extends Events.Event>- Parameters:
async- iftrue, the listener will be invoked asynchronously using theAbstractKnowledgeService.getExecutor(); iffalse, it will be invoked synchronouslylistener- the consumer that will receive the published items.- Returns:
- the result of the subscribe operation.
-
broadcast
-