/* (non-Javadoc)
   * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
   */
  public void stop(BundleContext context) throws Exception {
    // release plugin's singleton instance(s)
    ExtensionExplorer.releaseInstance();

    super.stop(context);
    sm_plugin = null;
  }
  /**
   * Instantiates and returns the property provider of the specified application that implements the
   * ODA consumer propertyProvider extension point.
   *
   * @param applicationId the identifier of an ODA consumer application; its value must match the
   *     consumerApplicationId attribute of a propertyProvider extension
   * @return an instance of the providerClass implemented in the specified propertyProvider
   *     extension
   * @throws OdaException
   */
  public static IPropertyProvider createPropertyProvider(String applicationId) throws OdaException {
    final String methodName = "ProviderUtil.getPropertyProvider( String )\t"; // $NON-NLS-1$

    if (applicationId == null || applicationId.length() == 0) {
      log(methodName, "No application id specified in method argument."); // $NON-NLS-1$
      return null; // no consumer application id specified in appContext
    }

    PropertyProviderManifest providerManifest =
        ExtensionExplorer.getInstance().getPropertyProviderManifest(applicationId);
    if (providerManifest == null) {
      log(
          methodName,
          "No IPropertyProvider found for " + applicationId + "."); // $NON-NLS-1$ //$NON-NLS-2$
      return null; // no extension defined by application
    }

    IPropertyProvider extnProvider = providerManifest.createProvider();
    log(
        methodName,
        "Returning IPropertyProvider instance ("
            + extnProvider //$NON-NLS-1$
            + ") of application id ("
            + applicationId
            + ")."); //$NON-NLS-1$ //$NON-NLS-2$
    return extnProvider;
  }