Package org.springframework.beans.factory.config

Examples of org.springframework.beans.factory.config.BeanReference


                    Collection<Object> checked = new ArrayList<Object>(ids.size());
                    for (Object id : ids) {
                        if (id instanceof QName) {
                            checked.add(id);
                        } else if (id instanceof BeanReference) {
                            BeanReference br = (BeanReference)id;
                            Object refId = context.getBean(br.getBeanName());
                            checked.add(refId);
                        } else if (id instanceof BeanDefinitionHolder) {
                            BeanDefinitionHolder bdh = (BeanDefinitionHolder)id;
                            if (QName.class.getName().equals(bdh.getBeanDefinition().getBeanClassName())) {
                                try {
View Full Code Here


            else if ("ref".equals(childElement.getLocalName())) {
                RootBeanDefinition smartInterceptorDef =
                        createSmartInterceptorDefinition(DelegatingSmartSoapEndpointInterceptor.class, childElement,
                                parserContext);

                BeanReference interceptorRef = createInterceptorReference(parserContext, childElement);

                smartInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(0, interceptorRef);

                registerSmartInterceptor(parserContext, smartInterceptorDef);

            }
            else if ("payloadRoot".equals(childElement.getLocalName())) {
                List<Element> payloadRootChildren = DomUtils.getChildElements(childElement);
                for (Element payloadRootChild : payloadRootChildren) {
                    if ("bean".equals(payloadRootChild.getLocalName())) {
                        RootBeanDefinition smartInterceptorDef =
                                createSmartInterceptorDefinition(PayloadRootSmartSoapEndpointInterceptor.class,
                                        childElement, parserContext);
                        BeanDefinitionHolder interceptorDef =
                                createInterceptorDefinition(parserContext, payloadRootChild);

                        String namespaceUri = childElement.getAttribute("namespaceUri");
                        String localPart = childElement.getAttribute("localPart");

                        smartInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(0, interceptorDef);
                        smartInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(1, namespaceUri);
                        smartInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(2, localPart);

                        registerSmartInterceptor(parserContext, smartInterceptorDef);
                    }
                    else if ("ref".equals(payloadRootChild.getLocalName())) {
                        RootBeanDefinition smartInterceptorDef =
                                createSmartInterceptorDefinition(PayloadRootSmartSoapEndpointInterceptor.class,
                                        childElement, parserContext);
                        BeanReference interceptorRef = createInterceptorReference(parserContext, payloadRootChild);

                        String namespaceUri = childElement.getAttribute("namespaceUri");
                        String localPart = childElement.getAttribute("localPart");

                        smartInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(0, interceptorRef);
                        smartInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(1, namespaceUri);
                        smartInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(2, localPart);

                        registerSmartInterceptor(parserContext, smartInterceptorDef);
                    }
                }
            }
            else if ("soapAction".equals(childElement.getLocalName())) {
                List<Element> soapActionChildren = DomUtils.getChildElements(childElement);
                for (Element soapActionChild : soapActionChildren) {
                    if ("bean".equals(soapActionChild.getLocalName())) {
                        RootBeanDefinition smartInterceptorDef =
                                createSmartInterceptorDefinition(SoapActionSmartEndpointInterceptor.class, childElement,
                                        parserContext);
                        BeanDefinitionHolder interceptorDef =
                                createInterceptorDefinition(parserContext, soapActionChild);

                        String soapAction = childElement.getAttribute("value");

                        smartInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(0, interceptorDef);
                        smartInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(1, soapAction);

                        registerSmartInterceptor(parserContext, smartInterceptorDef);
                    }
                    else if ("ref".equals(soapActionChild.getLocalName())) {
                        RootBeanDefinition smartInterceptorDef =
                                createSmartInterceptorDefinition(SoapActionSmartEndpointInterceptor.class, childElement,
                                        parserContext);
                        BeanReference interceptorRef = createInterceptorReference(parserContext, soapActionChild);

                        String soapAction = childElement.getAttribute("value");

                        smartInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(0, interceptorRef);
                        smartInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(1, soapAction);
View Full Code Here

                    Collection<Object> checked = new ArrayList<Object>(ids.size());
                    for (Object id : ids) {
                        if (id instanceof QName) {
                            checked.add(id);
                        } else if (id instanceof BeanReference) {
                            BeanReference br = (BeanReference)id;
                            Object refId = context.getBean(br.getBeanName());
                            checked.add(refId);
                        } else if (id instanceof BeanDefinitionHolder) {
                            BeanDefinitionHolder bdh = (BeanDefinitionHolder)id;
                            if (QName.class.getName().equals(bdh.getBeanDefinition().getBeanClassName())) {
                                try {
View Full Code Here

            }

            return createSecurityFilterChainBean(element, pc, Collections.emptyList());
        }

        final BeanReference portMapper = createPortMapper(element, pc);
        final BeanReference portResolver = createPortResolver(portMapper, pc);

        ManagedList<BeanReference> authenticationProviders = new ManagedList<BeanReference>();
        BeanReference authenticationManager = createAuthenticationManager(element, pc, authenticationProviders);

        HttpConfigurationBuilder httpBldr = new HttpConfigurationBuilder(element, pc,
                portMapper, portResolver, authenticationManager);

        AuthenticationConfigBuilder authBldr = new AuthenticationConfigBuilder(element, pc,
View Full Code Here

            if (useAspectJ) {
                pc.getReaderContext().error("You can't use AspectJ mode with protect-pointcut definitions", source);
            }
            // Only add it if there are actually any pointcuts defined.
            BeanDefinition mapBasedMetadataSource = new RootBeanDefinition(MapBasedMethodSecurityMetadataSource.class);
            BeanReference ref = new RuntimeBeanReference(pc.getReaderContext().generateBeanName(mapBasedMetadataSource));

            delegates.add(ref);
            pc.registerBeanComponent(new BeanComponentDefinition(mapBasedMetadataSource, ref.getBeanName()));
            registerProtectPointcutPostProcessor(pc, pointcutMap, ref, source);
        }

        BeanReference metadataSource = registerDelegatingMethodSecurityMetadataSource(pc, delegates, source);

        // Check for additional after-invocation-providers..
        List<Element> afterInvocationElts = DomUtils.getChildElementsByTagName(element, Elements.AFTER_INVOCATION_PROVIDER);

        for (Element elt : afterInvocationElts) {
            afterInvocationProviders.add(new RuntimeBeanReference(elt.getAttribute(ATT_REF)));
        }

        String accessManagerId = element.getAttribute(ATT_ACCESS_MGR);

        if (!StringUtils.hasText(accessManagerId)) {
            accessManagerId = registerAccessManager(pc, jsr250Enabled, preInvocationVoter);
        }

        String authMgrRef = element.getAttribute(ATT_AUTHENTICATION_MANAGER_REF);

        String runAsManagerId = element.getAttribute(ATT_RUN_AS_MGR);
        BeanReference interceptor = registerMethodSecurityInterceptor(pc, authMgrRef, accessManagerId, runAsManagerId,
                metadataSource, afterInvocationProviders, source, useAspectJ);

        if (useAspectJ) {
            BeanDefinitionBuilder aspect =
                BeanDefinitionBuilder.rootBeanDefinition("org.springframework.security.access.intercept.aspectj.aspect.AnnotationSecurityAspect");
View Full Code Here

                    Collection<Object> checked = new ArrayList<Object>(ids.size());
                    for (Object id : ids) {
                        if (id instanceof QName) {
                            checked.add(id);
                        } else if (id instanceof BeanReference) {
                            BeanReference br = (BeanReference)id;
                            Object refId = context.getBean(br.getBeanName());
                            checked.add(refId);
                        } else {
                            break;
                        }
                    }
View Full Code Here

  }


  private void unwrapDefinitions(BeanDefinition advisorDefinition, BeanDefinition pointcutDefinition) {
    MutablePropertyValues pvs = advisorDefinition.getPropertyValues();
    BeanReference adviceReference = (BeanReference) pvs.getPropertyValue("adviceBeanName").getValue();

    if (pointcutDefinition != null) {
      this.beanReferences = new BeanReference[] {adviceReference};
      this.beanDefinitions = new BeanDefinition[] {advisorDefinition, pointcutDefinition};
      this.description = buildDescription(adviceReference, pointcutDefinition);
    }
    else {
      BeanReference pointcutReference = (BeanReference) pvs.getPropertyValue("pointcut").getValue();
      this.beanReferences = new BeanReference[] {adviceReference, pointcutReference};
      this.beanDefinitions = new BeanDefinition[] {advisorDefinition};
      this.description = buildDescription(adviceReference, pointcutReference);
    }
  }
View Full Code Here

        return beanElements;
    }

    public void configurePropertyElement(SpringPropertyElement propertyElement, Object value) {
        if (value instanceof BeanReference) {
            BeanReference beanRef = (BeanReference)value;
            propertyElement.addRef(beanRef.getBeanName());
        } else if (value instanceof Collection) {
            Collection collection = (Collection)value;
            for (Object item : collection) {
                configurePropertyElement(propertyElement, item);
            }
View Full Code Here

        return beanElements;
    }

    public void configurePropertyElement(SpringPropertyElement propertyElement, Object value) {
        if (value instanceof BeanReference) {
            BeanReference beanRef = (BeanReference)value;
            propertyElement.addRef(beanRef.getBeanName());
        } else if (value instanceof Collection) {
            Collection collection = (Collection)value;
            for (Object item : collection) {
                configurePropertyElement(propertyElement, item);
            }
View Full Code Here

  }


  private void unwrapDefinitions(BeanDefinition advisorDefinition, BeanDefinition pointcutDefinition) {
    MutablePropertyValues pvs = advisorDefinition.getPropertyValues();
    BeanReference adviceReference = (BeanReference) pvs.getPropertyValue("adviceBeanName").getValue();

    if (pointcutDefinition != null) {
      this.beanReferences = new BeanReference[] {adviceReference};
      this.beanDefinitions = new BeanDefinition[] {advisorDefinition, pointcutDefinition};
      this.description = buildDescription(adviceReference, pointcutDefinition);
    }
    else {
      BeanReference pointcutReference = (BeanReference) pvs.getPropertyValue("pointcut").getValue();
      this.beanReferences = new BeanReference[] {adviceReference, pointcutReference};
      this.beanDefinitions = new BeanDefinition[] {advisorDefinition};
      this.description = buildDescription(adviceReference, pointcutReference);
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.beans.factory.config.BeanReference

Copyright © 2018 www.massapicom. 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.