Created
April 22, 2016 20:22
-
-
Save martyychang/d7ecae6605aeb6510512893354ad6ec5 to your computer and use it in GitHub Desktop.
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 | |
public class AppConfig { | |
public @Bean Foo fooer() { | |
return new Foo("fooer"); | |
} | |
public @Bean Foo fooey() { | |
return new Foo("fooey"); | |
} | |
} |
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 class Foo { | |
private String name; | |
public Foo(String name) { | |
this.name = name; | |
} | |
} |
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
@Component | |
public class FooerBar { | |
/** | |
* This gets injected with the fooer bean | |
*/ | |
@Autowired | |
private Foo fooer; | |
... | |
} |
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
@Component | |
public class FooeyBar { | |
/** | |
* This gets injected with the fooey bean | |
*/ | |
@Autowired | |
private Foo fooey; | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment