/**
   * Constructor.
   *
   * @param metadataMgr Manager for MetaData
   */
  public AnnotationManagerImpl(MetaDataManager metadataMgr) {
    this.metadataMgr = metadataMgr;

    PluginManager pluginMgr = metadataMgr.getNucleusContext().getPluginManager();

    // Load up the registry of available annotation readers
    ConfigurationElement[] elems =
        pluginMgr.getConfigurationElementsForExtension("org.datanucleus.annotations", null, null);
    if (elems != null) {
      for (int i = 0; i < elems.length; i++) {
        annotationReaderLookup.put(
            elems[i].getAttribute("annotation-class"), elems[i].getAttribute("reader"));
      }
    }

    // Load up the registry of available class annotation handlers
    elems =
        pluginMgr.getConfigurationElementsForExtension(
            "org.datanucleus.class_annotation_handler", null, null);
    if (elems != null && elems.length > 0) {
      classAnnotationHandlerAnnotations = new HashSet<String>(elems.length);
      classAnnotationHandlers = new HashMap<String, ClassAnnotationHandler>(elems.length);
      for (int i = 0; i < elems.length; i++) {
        classAnnotationHandlerAnnotations.add(elems[i].getAttribute("annotation-class"));
      }
    }

    // Load up the registry of available member annotation handlers
    elems =
        pluginMgr.getConfigurationElementsForExtension(
            "org.datanucleus.member_annotation_handler", null, null);
    if (elems != null && elems.length > 0) {
      memberAnnotationHandlerAnnotations = new HashSet<String>(elems.length);
      memberAnnotationHandlers = new HashMap<String, MemberAnnotationHandler>(elems.length);
      for (int i = 0; i < elems.length; i++) {
        memberAnnotationHandlerAnnotations.add(elems[i].getAttribute("annotation-class"));
      }
    }
  }