use of org.opendaylight.mdsal.dom.spi.SimpleDOMMountPoint in project mdsal by opendaylight.
the class DOMMountPointServiceImpl method registerMountPoint.
@SuppressWarnings("checkstyle:IllegalCatch")
private ObjectRegistration<DOMMountPoint> registerMountPoint(final SimpleDOMMountPoint mountPoint) {
final YangInstanceIdentifier mountPointId = mountPoint.getIdentifier();
synchronized (mountPoints) {
final DOMMountPoint prev = mountPoints.putIfAbsent(mountPointId, mountPoint);
checkState(prev == null, "Mount point %s already exists as %s", mountPointId, prev);
}
listeners.streamListeners().forEach(listener -> {
try {
listener.onMountPointCreated(mountPointId);
} catch (final Exception ex) {
LOG.error("Listener {} failed on mount point {} created event", listener, mountPoint, ex);
}
});
return new AbstractObjectRegistration<>(mountPoint) {
@Override
protected void removeRegistration() {
unregisterMountPoint(getInstance().getIdentifier());
}
};
}
Aggregations