/**
   * Remove a bundle listener. The listener is removed from the context bundle's list of listeners.
   * See {@link #getBundle() getBundle()} for a definition of context bundle.
   *
   * <p>If this method is called with a listener which is not registered, then this method does
   * nothing.
   *
   * @param listener The bundle listener to remove.
   * @exception java.lang.IllegalStateException If the bundle context has stopped.
   */
  public void removeBundleListener(BundleListener 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(
          "removeBundleListener["
              + bundle
              + "]("
              + listenerName
              + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    }

    framework.removeBundleListener(listener, this);
  }
Exemplo n.º 2
0
 /*
  * (non-Javadoc)
  *
  * @see com.yipsilon.osgi.IBundleContext#removeBundleListener(com.yipsilon.osgi.IBundleListener)
  */
 public void removeBundleListener(IBundleListener listener) {
   framework.removeBundleListener(listener);
 }