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 String
namespace
protected Map<String,List<BiConsumer<String,byte[]>>>
subscribers
List of subscribers for each topic.
-
Constructor Summary
Constructors Constructor Description AbstractPubSubProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Frees the resources.void
initialize(Map<String,String> options, Map<String,List<BiConsumer<String,byte[]>>> subscribers)
Initializes the resources for this provider and registers the local subscribers map.void
localPublish(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
-
-
-
-
Method Detail
-
initialize
public void initialize(Map<String,String> options, Map<String,List<BiConsumer<String,byte[]>>> subscribers)
Description copied from interface:PubSubProvider
Initializes the resources for this provider and registers the local subscribers map.The options taken from the
PubSubProviderDescriptor
The subscribers map structure is thread-safe. The implementation must not modify the subscribers map in any way.- Specified by:
initialize
in interfacePubSubProvider
-
close
public void close()
Description copied from interface:PubSubProvider
Frees the resources.- Specified by:
close
in interfacePubSubProvider
-
localPublish
public void localPublish(String topic, byte[] message)
-
-