This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project basedir="." default="runtests" name="testng_tests"> | |
<property environment="env" /> | |
<property name="M2_REPO" value="C:/Users/nschlimm/.m2/repository" /> | |
<property name="ECLIPSE_HOME" value="../../../../eclipse-3.6" /> | |
<property name="debuglevel" value="source,lines,vars" /> | |
<property name="target" value="1.6" /> | |
<property name="source" value="1.6" /> | |
<target name="runtests"> | |
<junit printsummary="yes" haltonfailure="yes"> | |
<classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<!-- WARNING: Eclipse auto-generated file. | |
Any modifications will be overwritten. | |
To include a user specific buildfile here, simply create one in the same | |
directory with the processing instruction <?eclipse.ant.import?> | |
as the first entry and export the buildfile again. --> | |
<project basedir="." default="runtests" name="testng_tests"> | |
<property environment="env" /> | |
<property name="M2_REPO" value="C:/Users/nschlimm/.m2/repository" /> | |
<property name="ECLIPSE_HOME" value="../../../../eclipse-3.6" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<!-- WARNING: Eclipse auto-generated file. | |
Any modifications will be overwritten. | |
To include a user specific buildfile here, simply create one in the same | |
directory with the processing instruction <?eclipse.ant.import?> | |
as the first entry and export the buildfile again. --> | |
<project basedir="." default="runtests" name="testng_tests"> | |
<property environment="env" /> | |
<property name="M2_REPO" value="C:/Users/nschlimm/.m2/repository" /> | |
<property name="ECLIPSE_HOME" value="../../../../eclipse-3.6" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String getRegisteredDelegate(ConfigurableListableBeanFactory beanFactory, DecoratorInfo decoratorInfo) { | |
DelegateField arbitraryDelegateField = decoratorInfo.getDelegateFields().get(0); | |
DependencyDescriptor delegateDependencyDescriptor = DecoratorModuleUtils.createRuleBasedDescriptor(arbitraryDelegateField.getDeclaredField(), new Class[] { IgnoreDecoratorAutowiringLogic.class }); | |
List<String> registeredDelegates = new ArrayList<String>(); | |
String[] candidateNames = BeanFactoryUtils.beanNamesForTypeIncludingAncestors(beanFactory, arbitraryDelegateField.getDeclaredField().getType(), true, false); | |
for (String candidate : candidateNames) { | |
BeanDefinition bd = beanFactory.getBeanDefinition(candidate); | |
// Annotated Bean scanned in the classpath | |
if (bd instanceof AnnotatedBeanDefinition) { | |
AnnotatedBeanDefinition abd = (AnnotatedBeanDefinition) bd; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc" | |
xmlns:context="http://www.springframework.org/schema/context" | |
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd | |
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd | |
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd" | |
default-autowire="byName"> | |
<context:component-scan base-package="com.mycompany.springapp.springcdi" scoped-proxy="targetClass"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { | |
Map<String, Class> decorators = decoratorResolutionStrategy.getRegisteredDecorators(beanFactory); | |
List<QualifiedDecoratorChain> chains = buildQualifiedDecoratorChains(beanFactory, decorators); | |
registerAutowireCandidateResolver(beanFactory, chains); | |
registerDecoratorMetadataBean(beanFactory, chains); | |
if (PROCESSOR.equals(getMode())) { | |
((DefaultListableBeanFactory) beanFactory).registerBeanDefinition(DECORATOR_POSTPROCESSOR_NAME, BeanDefinitionBuilder.rootBeanDefinition(DecoratorAwareBeanPostProcessor.class).getBeanDefinition()); | |
if (beanFactory.getBeanNamesForType(DecoratorAwareBeanPostProcessor.class) == null) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { | |
if (metaData.isDecoratedBean(beanName)) { | |
return buildDelegateProxy(bean, beanName); | |
} else { | |
return bean; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupid>org.springframework</groupid> | |
<artifactid>spring-context</artifactid> | |
<version>3.0.5.RELEASE</version> | |
</dependency> | |
<dependency> | |
<groupid>org.springframework</groupid> | |
<artifactid>org.springframework.aop</artifactid> | |
<version>3.0.5.RELEASE</version> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mycompany.springapp.springcdi; | |
public interface MyService { | |
String sayHello(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mycompany.springapp.springcdi; | |
import org.springframework.stereotype.Component; | |
@Component | |
public class MyServiceImpl implements MyService { | |
public String sayHello() { | |
return "Hello"; | |
} |
OlderNewer