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
/* | |
* Copyright 2002-2011 the original author or authors. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
@Configuration | |
class TxConfig { | |
@SpecMethod | |
public TxAnnotationDriven tx() { | |
return new TxAnnotationDriven(this.txManager()); | |
} | |
@Bean | |
public TransactionalTestBean testBean() { |
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
@Configuration | |
class TxConfig { | |
@Feature | |
public TxAnnotationDriven tx() { | |
return new TxAnnotationDriven(this.txManager()).proxyTargetClass(false); | |
} | |
@Bean | |
public TransactionalTestBean testBean() { |
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
@Configuration | |
class TxConfig { | |
@Feature | |
public TxAnnotationDriven tx() { | |
return new TxAnnotationDriven(this.txManager()).proxyTargetClass(false); | |
} | |
@SpringConfigured | |
public Order configureOrder(Order order) { |
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
@Configuration | |
@TxAnnotationDriven | |
@PropertySource("classpath:/com/company/app/db.properties") | |
public class UnifiedConfig { | |
@Inject Environment env; | |
// ---- configure data infrastructure ---- |
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
@Configuration | |
@ComponentScan("com.company.app") | |
@TxAnnotationDriven | |
@PropertySource("classpath:/com/company/app/db.properties") | |
public class UnifiedConfig { | |
@Inject Environment env; | |
// ---- configure data infrastructure ---- |
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
@Configuration@TxAnnotationDriven | |
public abstract class AppConfig { | |
@Inject Environment env; | |
// ---- configure data infrastructure ---- | |
public abstract DataSource dataSource(); |
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
@Configuration | |
@TxAnnotationDriven | |
@ImportResource("classpath:/com/company/app/db-config.xml") | |
public class AppConfig { | |
@Inject Environment env; | |
@Inject DataSource dataSource; // from XML -> won't work; @Feature forces autowiring before BFPP! | |
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
@Configuration | |
@Import(MyFrameworkConfiguration.class) | |
public class UserConfig implements MyFrameworkInitializer { | |
@Bean | |
public FooCallback fooCallback() { | |
return new FooCallback() { | |
public void doWithFoo(Foo foo) { | |
foo.setAwesome(true); | |
} |
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
@Configuration | |
@Import(MyFrameworkConfiguration.class) | |
public class UserConfig implements MyFrameworkInitializer { | |
protected void setMyFrameworkInitializer(MyFrameworkInitializer initializer) { | |
super.setMyFrameworkInitializer(this) | |
} | |
public void configureFoo(Foo foo) { | |
foo.setAwesome(true); |
OlderNewer