import org.opendaylight.yangtools.concepts.Registration;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.osgi.framework.FrameworkUtil;
+import org.osgi.service.component.ComponentException;
import org.osgi.service.component.ComponentFactory;
import org.osgi.service.component.ComponentInstance;
import org.osgi.service.component.annotations.Activate;
this.dataBroker = requireNonNull(dataBroker);
this.factory = requireNonNull(factory);
reg = dataBroker.registerDataListener(
- DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION,
+ DataTreeIdentifier.of(LogicalDatastoreType.CONFIGURATION,
InstanceIdentifier.create(AaaEncryptServiceConfig.class)),
this);
LOG.debug("AAA Encryption Service configurator started");
}
disableInstance();
- instance = factory.newInstance(FrameworkUtil.asDictionary(
- AAAEncryptionServiceImpl.props(new EncryptServiceConfigImpl(newConfig))));
+ try {
+ instance = factory.newInstance(FrameworkUtil.asDictionary(
+ AAAEncryptionServiceImpl.props(new EncryptServiceConfigImpl(newConfig))));
+ } catch (ComponentException e) {
+ LOG.error("Failed to start Encryption Service", e);
+ return;
+ }
+
current = newConfig;
LOG.info("Encryption Service enabled");
}