コード例 #1
0
 public void unregisterExtension(String pluginName, Element extensionElement) {
   String epName = extractEPName(extensionElement);
   if (!myExtensionElement2extension.containsKey(extensionElement)) {
     XMLOutputter xmlOutputter = new XMLOutputter();
     Format format =
         Format.getCompactFormat().setIndent("  ").setTextMode(Format.TextMode.NORMALIZE);
     xmlOutputter.setFormat(format);
     StringWriter stringWriter = new StringWriter();
     try {
       xmlOutputter.output(extensionElement, stringWriter);
     } catch (IOException e) {
       throw new RuntimeException(e);
     }
     myLogger.warn(stringWriter.toString());
     throw new IllegalArgumentException(
         "Trying to unregister extension element that was never registered");
   }
   ExtensionComponentAdapter adapter = myExtensionElement2extension.remove(extensionElement);
   if (adapter == null) return;
   if (getExtensionPoint(epName).unregisterComponentAdapter(adapter)) {
     MutablePicoContainer pluginContainer = internalGetPluginContainer();
     pluginContainer.unregisterComponent(adapter.getComponentKey());
     if (pluginContainer.getComponentAdapters().isEmpty()) {
       disposePluginContainer(pluginName);
     }
   }
 }
コード例 #2
0
 public void unregisterExtensionPoint(final String extensionPointName) {
   ExtensionPoint extensionPoint = myExtensionPoints.get(extensionPointName);
   if (extensionPoint != null) {
     extensionPoint.reset();
     myExtensionPoints.remove(extensionPointName);
     notifyEPRemoved(extensionPoint);
   }
 }
コード例 #3
0
 private void disposePluginContainer(String pluginName) {
   DefaultPicoContainer pluginContainer = myPluginName2picoContainer.remove(pluginName);
   if (pluginContainer != null) {
     myPicoContainer.removeChildContainer(pluginContainer);
   }
 }