Class ServiceComponent.ComponentMaker

    • Constructor Detail

      • ComponentMaker

        ComponentMaker​(Analyzer analyzer)
    • Method Detail

      • doServiceComponent

        java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.lang.String>> doServiceComponent()
                                                                                                                 throws java.lang.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:
        java.lang.Exception
      • componentEntry

        private void componentEntry​(java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.lang.String>> serviceComponents,
                                    java.lang.String name,
                                    java.util.Map<java.lang.String,​java.lang.String> info)
                             throws java.lang.Exception,
                                    java.io.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:
        java.lang.Exception
        java.io.IOException
      • checkAnnotationsFeasible

        private java.util.Collection<Clazz> checkAnnotationsFeasible​(java.lang.String name)
                                                              throws java.lang.Exception
        Check if annotations are actually feasible looking at the class format. If the class format does not provide annotations then it is no use specifying annotated components.
        Parameters:
        name -
        Throws:
        java.lang.Exception
      • annotated

        void annotated​(java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.lang.String>> components,
                       Clazz c,
                       java.util.Map<java.lang.String,​java.lang.String> info)
                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createComponentResource

        private void createComponentResource​(java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.lang.String>> components,
                                             java.lang.String name,
                                             java.util.Map<java.lang.String,​java.lang.String> info)
                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • designate

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

        Resource createComponentResource​(java.lang.String name,
                                         java.lang.String impl,
                                         java.util.Map<java.lang.String,​java.lang.String> info)
                                  throws java.lang.Exception
        Create the resource for a DS component.
        Parameters:
        list -
        name -
        info -
        Throws:
        java.io.UnsupportedEncodingException
        java.lang.Exception