Package org.opennms.core.ipc.twin.memory
Class MemoryTwinPublisher
- java.lang.Object
-
- org.opennms.core.ipc.twin.memory.MemoryTwinPublisher
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,TwinPublisher
public class MemoryTwinPublisher extends Object implements TwinPublisher
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MemoryTwinPublisher.SessionKey
-
Nested classes/interfaces inherited from interface org.opennms.core.ipc.twin.api.TwinPublisher
TwinPublisher.Session<T>
-
-
Constructor Summary
Constructors Constructor Description MemoryTwinPublisher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
<T> TwinPublisher.Session<T>
register(String key, Class<T> clazz, String location)
<T> org.opennms.core.ipc.twin.memory.MemoryTwinPublisher.Subscription<T>
subscribe(String key, String location, Class<T> clazz, java.util.function.Consumer<T> consumer)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opennms.core.ipc.twin.api.TwinPublisher
register
-
-
-
-
Method Detail
-
register
public <T> TwinPublisher.Session<T> register(String key, Class<T> clazz, String location) throws IOException
- Specified by:
register
in interfaceTwinPublisher
- Type Parameters:
T
- type of object for replication- Parameters:
key
- unique key for the object.clazz
- a class used for serialization.location
- targeted Minion location for the object, set null for all locations.- Returns:
- Session which provides updates to object.
- Throws:
IOException
-
subscribe
public <T> org.opennms.core.ipc.twin.memory.MemoryTwinPublisher.Subscription<T> subscribe(String key, String location, Class<T> clazz, java.util.function.Consumer<T> consumer)
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
-