protected void destroyManager() { if (manager != null) { Manager mgr = manager; manager = null; try { mgr.destroy(); } catch (IOException e) { // ignore } } }
public void onConnected() { destroyManager(); try { manager = new Manager(this.bundleContext, curator, uri, exportedAddress, timeout); manager.init(); } catch (Exception e) { throw new RuntimeException("Unable to start DOSGi service: " + e.getMessage(), e); } }