Package org.opennms.core.ipc.twin.memory
Class MemoryTwinSubscriber
- java.lang.Object
-
- org.opennms.core.ipc.twin.memory.MemoryTwinSubscriber
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,TwinSubscriber
public class MemoryTwinSubscriber extends Object implements TwinSubscriber
-
-
Constructor Summary
Constructors Constructor Description MemoryTwinSubscriber(MemoryTwinPublisher publisher, String location)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
<T> Closeable
subscribe(String key, Class<T> clazz, java.util.function.Consumer<T> consumer)
-
-
-
Constructor Detail
-
MemoryTwinSubscriber
public MemoryTwinSubscriber(MemoryTwinPublisher publisher, String location)
-
-
Method Detail
-
subscribe
public <T> Closeable subscribe(String key, Class<T> clazz, java.util.function.Consumer<T> consumer)
- Specified by:
subscribe
in interfaceTwinSubscriber
- Type Parameters:
T
- T is an object type that needs to be replicated from OpenNMS to Minion.- Parameters:
key
- Unique key for the object.clazz
- Specific bean class of T to marshal/unmarshal.consumer
- Consumer of T for subsequent updates to T.- Returns:
- Closeable to close the subscription of T.
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
-