- private void updateService() {
- bindingContextProvider.update(classLoadingStrat, schemaContextProvider);
- osgiReg.setProperties(null); // send modifiedService event
+ public void updateService() {
+ if(this.osgiReg != null) {
+ try {
+ this.bindingContextProvider.update(this.classLoadingStrat, this.schemaContextProvider);
+
+ final Dictionary<String, Object> props = new Hashtable<>();
+ props.put(BindingRuntimeContext.class.getName(), this.bindingContextProvider.getBindingContext());
+ props.put(SchemaSourceProvider.class.getName(), this.sourceProvider);
+ // send modifiedService event
+ this.osgiReg.setProperties(props);
+ } catch (final RuntimeException e) {
+ // The ModuleInfoBackedContext throws a RuntimeException if it can't create the schema context.
+ LOG.warn("Error updating the BindingContextProvider", e);
+ }
+ }