/// <summary>
        /// Scans for types using the provided scanner.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="scanner">The scanner.</param>
        public static void Scan(this GenericApplicationContext context, AssemblyObjectDefinitionScanner scanner)
        {
            var registry = context.ObjectFactory as IObjectDefinitionRegistry;

            scanner.ScanAndRegisterTypes(registry);

            AttributeConfigUtils.RegisterAttributeConfigProcessors(registry);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Parse the specified XmlElement and register the resulting
        /// ObjectDefinitions with the <see cref="P:Spring.Objects.Factory.Xml.ParserContext.Registry"/> IObjectDefinitionRegistry
        /// embedded in the supplied <see cref="T:Spring.Objects.Factory.Xml.ParserContext"/>
        /// </summary>
        /// <param name="element">The element to be parsed.</param>
        /// <param name="parserContext">TThe object encapsulating the current state of the parsing process.
        /// Provides access to a IObjectDefinitionRegistry</param>
        /// <returns>The primary object definition.</returns>
        /// <remarks>
        ///     <p>
        /// This method is never invoked if the parser is namespace aware
        /// and was called to process the root node.
        /// </p>
        /// </remarks>
        public IObjectDefinition ParseElement(XmlElement element, ParserContext parserContext)
        {
            AssemblyObjectDefinitionScanner scanner  = ConfigureScanner(parserContext, element);
            IObjectDefinitionRegistry       registry = parserContext.Registry;

            // Actually scan for objects definitions and register them.
            scanner.ScanAndRegisterTypes(registry);
            RegisterComponents(element, registry);

            return(null);
        }