Class ServiceComponent.ComponentMaker

java.lang.Object
aQute.bnd.osgi.Domain
aQute.bnd.osgi.Processor
aQute.bnd.make.component.ServiceComponent.ComponentMaker
All Implemented Interfaces:
Constants, Registry, Report, Reporter, Closeable, AutoCloseable, Iterable<String>
Enclosing class:
ServiceComponent

private static class ServiceComponent.ComponentMaker extends Processor
  • Field Details

  • Constructor Details

    • ComponentMaker

      ComponentMaker(Analyzer analyzer)
  • Method Details

    • doServiceComponent

      Map<String,Map<String,String>> doServiceComponent() throws Exception
      Iterate over the Service Component entries. There are two cases:
      1. An XML file reference
      2. A FQN/wildcard with a set of attributes
      An XML reference is immediately expanded, an FQN/wildcard is more complicated and is delegated to componentEntry(Map, String, Map).
      Throws:
      Exception
    • componentEntry

      private void componentEntry(Map<String,Map<String,String>> serviceComponents, String name, Map<String,String> info) throws Exception, IOException
      Parse an entry in the Service-Component header. This header supports the following types:
      1. An FQN + attributes describing a component
      2. A wildcard expression for finding annotated components.
      The problem is the distinction between an FQN and a wildcard because an FQN can also be used as a wildcard. If the info specifies Constants.NOANNOTATIONS then wildcards are an error and the component must be fully described by the info. Otherwise the FQN/wildcard is expanded into a list of classes with annotations. If this list is empty, the FQN case is interpreted as a complete component definition. For the wildcard case, it is checked if any matching classes for the wildcard have been compiled for a class file format that does not support annotations, this can be a problem with JSR14 who silently ignores annotations. An error is reported in such a case.
      Parameters:
      serviceComponents -
      name -
      info -
      Throws:
      Exception
      IOException
    • reportInvalidUseOfServiceComponentHeader

      private void reportInvalidUseOfServiceComponentHeader(String name) throws Exception, IOException
      Throws:
      Exception
      IOException
    • createComponentResource

      private void createComponentResource(Map<String,Map<String,String>> components, String name, Map<String,String> info) throws Exception
      Throws:
      Exception
    • designate

      private boolean designate(String name, String config, boolean factory) throws Exception
      Create a Metatype and Designate record out of the given configurations.
      Parameters:
      name -
      config -
      Throws:
      Exception
    • createComponentResource

      Resource createComponentResource(String name, String impl, Map<String,String> info) throws Exception
      Create the resource for a DS component.
      Throws:
      Exception