private void registerExtensionPoint(
      final String extensionPointName,
      String extensionPointBeanClass,
      PluginDescriptor descriptor,
      ExtensionPoint.Kind kind) {
    if (hasExtensionPoint(extensionPointName)) {
      if (DEBUG_REGISTRATION) {
        final ExtensionPointImpl oldEP = getExtensionPoint(extensionPointName);
        myLogger.error(
            "Duplicate registration for EP: "
                + extensionPointName
                + ": original plugin "
                + oldEP.getDescriptor().getPluginId()
                + ", new plugin "
                + descriptor.getPluginId(),
            myEPTraces.get(extensionPointName));
      }
      throw new RuntimeException("Duplicate registration for EP: " + extensionPointName);
    }

    registerExtensionPoint(
        new ExtensionPointImpl(
            extensionPointName,
            extensionPointBeanClass,
            kind,
            this,
            myAreaInstance,
            myLogger,
            descriptor));
  }
 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);
     }
   }
 }
 public void resumeInteractions() {
   myAvailabilityNotificationsActive = true;
   ExtensionPoint[] extensionPoints = getExtensionPoints();
   for (ExtensionPoint extensionPoint : extensionPoints) {
     extensionPoint.getExtensions(); // creates extensions from ComponentAdapters
   }
   for (Runnable action : mySuspendedListenerActions) {
     try {
       action.run();
     } catch (Exception e) {
       myLogger.error(e);
     }
   }
   mySuspendedListenerActions.clear();
 }