Class AnnotationPlugin

java.lang.Object
org.apache.felix.dm.annotation.plugin.bnd.AnnotationPlugin
All Implemented Interfaces:
aQute.bnd.service.AnalyzerPlugin, aQute.bnd.service.OrderedPlugin, aQute.bnd.service.Plugin

public class AnnotationPlugin extends Object implements aQute.bnd.service.AnalyzerPlugin, aQute.bnd.service.Plugin
This class is a BND plugin. It scans the target bundle and look for DependencyManager annotations. It can be directly used when using ant and can be referenced inside the ".bnd" descriptor, using the "-plugin" parameter.
Author:
Felix Project Team
  • Constructor Details

    • AnnotationPlugin

      public AnnotationPlugin()
  • Method Details

    • setReporter

      public void setReporter(aQute.service.reporter.Reporter reporter)
      Specified by:
      setReporter in interface aQute.bnd.service.Plugin
    • setProperties

      public void setProperties(Map<String,String> map)
      Specified by:
      setProperties in interface aQute.bnd.service.Plugin
    • analyzeJar

      public boolean analyzeJar(aQute.bnd.osgi.Analyzer analyzer) throws Exception
      This plugin is called after analysis of the JAR but before manifest generation. When some DM annotations are found, the plugin will add the corresponding DM component descriptors under META-INF/ directory. It will also set the "DependencyManager-Component" manifest header (which references the descriptor paths).
      Specified by:
      analyzeJar in interface aQute.bnd.service.AnalyzerPlugin
      Parameters:
      analyzer - the object that is used to retrieve classes containing DM annotations.
      Returns:
      true if the classpath has been modified so that the bundle classpath must be reanalyzed
      Throws:
      Exception - on any errors.