- /**
- * Creates new {@link ListenerAdapter} listener from
- * {@link InstanceIdentifier} path and stream name.
- *
- * @param path
- * Path to data in data repository.
- * @param streamName
- * The name of the stream.
- * @return New {@link ListenerAdapter} listener from
- * {@link InstanceIdentifier} path and stream name.
- */
- public static ListenerAdapter createListener(InstanceIdentifier path,
- String streamName) {
- ListenerAdapter listener = new ListenerAdapter(path, streamName);
- try {
- lock.lock();
- listenersByInstanceIdentifier.put(path, listener);
- listenersByStreamName.put(streamName, listener);
- } finally {
- lock.unlock();
- }
- return listener;
- }
+ /**
+ * Checks if the listener specified by {@link YangInstanceIdentifier} path exist.
+ *
+ * @param streamName
+ * @return True if the listener exist, false otherwise.
+ */
+ public static boolean existListenerFor(String streamName) {
+ return listenersByStreamName.containsKey(streamName);
+ }