/**
   * Add a general framework listener. {@link FrameworkListener}s are notified of general framework
   * events. The listener is added to the context bundle's list of listeners. See {@link
   * #getBundle() getBundle()} for a definition of context bundle.
   *
   * @param listener The framework listener to add.
   * @exception java.lang.IllegalStateException If the bundle context has stopped.
   * @see FrameworkEvent
   * @see FrameworkListener
   */
  public void addFrameworkListener(FrameworkListener listener) {
    checkValid();
    if (listener == null) {
      throw new IllegalArgumentException();
    }

    if (Debug.DEBUG_EVENTS) {
      String listenerName =
          listener.getClass().getName()
              + "@"
              + Integer.toHexString(System.identityHashCode(listener)); // $NON-NLS-1$
      Debug.println(
          "addFrameworkListener["
              + bundle
              + "]("
              + listenerName
              + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    }

    framework.addFrameworkListener(listener, this);
  }