public static synchronized void instanceDelete(String uri) { BaseUtil.out("SuiteManager.instanceDelete uri=" + uri); if (uri == null) { BaseUtil.out("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! URI == NULL "); BaseUtil.out("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! URI == NULL "); return; } SuiteNodesNotifier suiteNotifier = SuiteManager.getServerSuiteProject(uri).getLookup().lookup(SuiteNodesNotifier.class); Properties props = ServerUtil.removeInstanceProperties(uri); // // Delete InstancePreferencies // String instancePath = SuiteUtil.extractInstancePath(uri); if (instancePath != null) { DirectoryPreferences registry = new DirectoryPreferences(Paths.get(instancePath)); registry.remove(); Project suite = getServerSuiteProject(uri); if (suite != null) { suite.getLookup().lookup(DistributeModulesManager.class).remove(instancePath); } // DistributeModulesManager m = getInstance(uri); } suiteNotifier.instancesChanged(); // Can invoke this method too }
public static synchronized void instanceCreate(String uri) { SuiteNodesNotifier suiteNotifier = SuiteManager.getServerSuiteProject(uri).getLookup().lookup(SuiteNodesNotifier.class); suiteNotifier.instancesChanged(); String displayname = InstanceProperties.getInstanceProperties(uri).getProperty(BaseConstants.DISPLAY_NAME_PROP); if (displayname != null) { suiteNotifier.displayNameChange(uri, displayname); } Properties props = ServerUtil.getProperties(uri); updateInstanceRegistry(props); }
public static synchronized void removeInstance(String uri) { SuiteNodesNotifier suiteNotifier = SuiteManager.getServerSuiteProject(uri).getLookup().lookup(SuiteNodesNotifier.class); Properties instanceProperties = ServerUtil.removeInstanceProperties(uri); suiteNotifier.instancesChanged(); saveInstanceProperties(instanceProperties); String instancePath = SuiteUtil.extractInstancePath(uri); if (instancePath == null) { return; } DirectoryPreferences registry = new DirectoryPreferences(Paths.get(instancePath)); registry.remove(); Project suite = getServerSuiteProject(uri); if (suite != null) { suite.getLookup().lookup(DistributeModulesManager.class).remove(instancePath); } }