Package org.nuxeo.runtime.pubsub
Class AbstractPubSubProvider
- java.lang.Object
-
- org.nuxeo.runtime.pubsub.AbstractPubSubProvider
-
- All Implemented Interfaces:
PubSubProvider
- Direct Known Subclasses:
MemPubSubProvider,RedisPubSubProvider,StreamPubSubProvider
public abstract class AbstractPubSubProvider extends Object implements PubSubProvider
Abstract implementation ofPubSubProvider.This deals with subscribers registration and dispatch.
- Since:
- 9.1
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringnamespaceprotected Map<String,List<BiConsumer<String,byte[]>>>subscribersList of subscribers for each topic.
-
Constructor Summary
Constructors Constructor Description AbstractPubSubProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Frees the resources.voidinitialize(Map<String,String> options, Map<String,List<BiConsumer<String,byte[]>>> subscribers)Initializes the resources for this provider and registers the local subscribers map.voidlocalPublish(String topic, byte[] message)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.runtime.pubsub.PubSubProvider
publish
-
-
-
-
Field Detail
-
subscribers
protected Map<String,List<BiConsumer<String,byte[]>>> subscribers
List of subscribers for each topic.
-
-
Constructor Detail
-
AbstractPubSubProvider
public AbstractPubSubProvider()
-
-
Method Detail
-
initialize
public void initialize(Map<String,String> options, Map<String,List<BiConsumer<String,byte[]>>> subscribers)
Description copied from interface:PubSubProviderInitializes the resources for this provider and registers the local subscribers map.The options taken from the
PubSubProviderDescriptorThe subscribers map structure is thread-safe. The implementation must not modify the subscribers map in any way.- Specified by:
initializein interfacePubSubProvider
-
close
public void close()
Description copied from interface:PubSubProviderFrees the resources.- Specified by:
closein interfacePubSubProvider
-
localPublish
public void localPublish(String topic, byte[] message)
-
-