Package org.nuxeo.runtime.pubsub
Class MemPubSubProvider
- java.lang.Object
-
- org.nuxeo.runtime.pubsub.AbstractPubSubProvider
-
- org.nuxeo.runtime.pubsub.MemPubSubProvider
-
- All Implemented Interfaces:
PubSubProvider
public class MemPubSubProvider extends AbstractPubSubProvider
In-Memory implementation ofPubSubProvider
.- Since:
- 9.1
-
-
Field Summary
-
Fields inherited from class org.nuxeo.runtime.pubsub.AbstractPubSubProvider
namespace, subscribers
-
-
Constructor Summary
Constructors Constructor Description MemPubSubProvider()
-
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
publish(String topic, byte[] message)
Publishes a message to the given topic.-
Methods inherited from class org.nuxeo.runtime.pubsub.AbstractPubSubProvider
localPublish
-
-
-
-
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
- Overrides:
initialize
in classAbstractPubSubProvider
-
close
public void close()
Description copied from interface:PubSubProvider
Frees the resources.- Specified by:
close
in interfacePubSubProvider
- Overrides:
close
in classAbstractPubSubProvider
-
publish
public void publish(String topic, byte[] message)
Description copied from interface:PubSubProvider
Publishes a message to the given topic.- Parameters:
topic
- the topicmessage
- the message
-
-