Examples of BeanComponentDefinition


Examples of org.springframework.beans.factory.parsing.BeanComponentDefinition

        // see if we have already auto registered this id
        BeanDefinition existing = autoRegisterMap.get(id);
        if (existing == null) {
            // no then add it to the map and register it
            autoRegisterMap.put(id, definition);
            parserContext.registerComponent(new BeanComponentDefinition(definition, id));
            if (LOG.isDebugEnabled()) {
                LOG.debug("Registered default: {} with id: {} on camel context: {}", new Object[]{definition.getBeanClassName(), id, contextId});
            }
        } else {
            // ups we have already registered it before with same id, but on another camel context
View Full Code Here

Examples of org.springframework.beans.factory.parsing.BeanComponentDefinition

                Method method = definition.getClass().getMethod("setDependsOn", String[].class);
                method.invoke(definition, (Object) new String[]{contextId});
            } catch (Exception e) {
                // Do nothing here
            }
            parserContext.registerBeanComponent(new BeanComponentDefinition(definition, id));
        }
    }
View Full Code Here

Examples of org.springframework.beans.factory.parsing.BeanComponentDefinition

    public BeanDefinition parse(Element element, ParserContext pc) {
        boolean webmvcPresent = ClassUtils.isPresent(DISPATCHER_SERVLET_CLASS_NAME, getClass().getClassLoader());
        if(webmvcPresent) {
            RootBeanDefinition beanDefinition = new RootBeanDefinition(CsrfRequestDataValueProcessor.class);
            BeanComponentDefinition componentDefinition =
                    new BeanComponentDefinition(beanDefinition, REQUEST_DATA_VALUE_PROCESSOR);
            pc.registerBeanComponent(componentDefinition);
        }

        csrfRepositoryRef = element.getAttribute(ATT_REPOSITORY);
        String matcherRef = element.getAttribute(ATT_MATCHER);

        if(!StringUtils.hasText(csrfRepositoryRef)) {
            RootBeanDefinition csrfTokenRepository = new RootBeanDefinition(HttpSessionCsrfTokenRepository.class);
            csrfRepositoryRef = pc.getReaderContext().generateBeanName(csrfTokenRepository);
            pc.registerBeanComponent(new BeanComponentDefinition(csrfTokenRepository, csrfRepositoryRef));
        }

        BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(CsrfFilter.class);
        builder.addConstructorArgReference(csrfRepositoryRef);
View Full Code Here

Examples of org.springframework.beans.factory.parsing.BeanComponentDefinition

            if (!StringUtils.hasText(id)) {
                id = pc.getReaderContext().generateBeanName(filterChainBean);
            }
        }

        pc.registerBeanComponent(new BeanComponentDefinition(filterChainBean, id));

        return new RuntimeBeanReference(id);
    }
View Full Code Here

Examples of org.springframework.beans.factory.parsing.BeanComponentDefinition

    private BeanReference createPortMapper(Element elt, ParserContext pc) {
        // Register the portMapper. A default will always be created, even if no element exists.
        BeanDefinition portMapper = new PortMappingsBeanDefinitionParser().parse(
                DomUtils.getChildElementByTagName(elt, Elements.PORT_MAPPINGS), pc);
        String portMapperName = pc.getReaderContext().generateBeanName(portMapper);
        pc.registerBeanComponent(new BeanComponentDefinition(portMapper, portMapperName));

        return new RuntimeBeanReference(portMapperName);
    }
View Full Code Here

Examples of org.springframework.beans.factory.parsing.BeanComponentDefinition

    private RuntimeBeanReference createPortResolver(BeanReference portMapper, ParserContext pc) {
        RootBeanDefinition portResolver = new RootBeanDefinition(PortResolverImpl.class);
        portResolver.getPropertyValues().addPropertyValue("portMapper", portMapper);
        String portResolverName = pc.getReaderContext().generateBeanName(portResolver);
        pc.registerBeanComponent(new BeanComponentDefinition(portResolver, portResolverName));
        return new RuntimeBeanReference(portResolverName);
    }
View Full Code Here

Examples of org.springframework.beans.factory.parsing.BeanComponentDefinition

            authManager.addPropertyValue("eraseCredentialsAfterAuthentication", clearCredentials);
        } else {
            RootBeanDefinition amfb = new RootBeanDefinition(AuthenticationManagerFactoryBean.class);
            amfb.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
            String amfbId = pc.getReaderContext().generateBeanName(amfb);
            pc.registerBeanComponent(new BeanComponentDefinition(amfb, amfbId));
            RootBeanDefinition clearCredentials = new RootBeanDefinition(MethodInvokingFactoryBean.class);
            clearCredentials.getPropertyValues().addPropertyValue("targetObject", new RuntimeBeanReference(amfbId));
            clearCredentials.getPropertyValues().addPropertyValue("targetMethod", "isEraseCredentialsAfterAuthentication");

            authManager.addConstructorArgValue(new RuntimeBeanReference(amfbId));
            authManager.addPropertyValue("eraseCredentialsAfterAuthentication", clearCredentials);
        }

        authManager.getRawBeanDefinition().setSource(pc.extractSource(element));
        BeanDefinition authMgrBean = authManager.getBeanDefinition();
        String id = pc.getReaderContext().generateBeanName(authMgrBean);
        pc.registerBeanComponent(new BeanComponentDefinition(authMgrBean, id));

        return new RuntimeBeanReference(id);
    }
View Full Code Here

Examples of org.springframework.beans.factory.parsing.BeanComponentDefinition

            return;
        }
        // Not already registered, so register the list of filter chains and the FilterChainProxy
        BeanDefinition listFactoryBean = new RootBeanDefinition(ListFactoryBean.class);
        listFactoryBean.getPropertyValues().add("sourceList", new ManagedList());
        pc.registerBeanComponent(new BeanComponentDefinition(listFactoryBean, BeanIds.FILTER_CHAINS));

        BeanDefinitionBuilder fcpBldr = BeanDefinitionBuilder.rootBeanDefinition(FilterChainProxy.class);
        fcpBldr.getRawBeanDefinition().setSource(source);
        fcpBldr.addConstructorArgReference(BeanIds.FILTER_CHAINS);
        fcpBldr.addPropertyValue("filterChainValidator", new RootBeanDefinition(DefaultFilterChainValidator.class));
        BeanDefinition fcpBean = fcpBldr.getBeanDefinition();
        pc.registerBeanComponent(new BeanComponentDefinition(fcpBean, BeanIds.FILTER_CHAIN_PROXY));
        pc.getRegistry().registerAlias(BeanIds.FILTER_CHAIN_PROXY, BeanIds.SPRING_SECURITY_FILTER_CHAIN);
    }
View Full Code Here

Examples of org.springframework.beans.factory.parsing.BeanComponentDefinition

        BeanDefinition mds = createSecurityMetadataSource(interceptUrls, element, parserContext);

        String id = element.getAttribute(AbstractBeanDefinitionParser.ID_ATTRIBUTE);

        if (StringUtils.hasText(id)) {
            parserContext.registerComponent(new BeanComponentDefinition(mds, id));
            parserContext.getRegistry().registerBeanDefinition(id, mds);
        }

        return mds;
    }
View Full Code Here

Examples of org.springframework.beans.factory.parsing.BeanComponentDefinition

    }

    static String registerDefaultExpressionHandler(ParserContext pc) {
        BeanDefinition expressionHandler = BeanDefinitionBuilder.rootBeanDefinition(DefaultWebSecurityExpressionHandler.class).getBeanDefinition();
        String expressionHandlerRef = pc.getReaderContext().generateBeanName(expressionHandler);
        pc.registerBeanComponent(new BeanComponentDefinition(expressionHandler, expressionHandlerRef));

        return expressionHandlerRef;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.