-
Notifications
You must be signed in to change notification settings - Fork 38.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide dedicated ApplicationContext implementations for use with (JavaConfig) @Configuration classes [SPR-5682] #10353
Comments
Juergen Hoeller commented Current not-too-bad option, assuming annotated classes in "mypackage": GenericApplicationContext context = new GenericApplicationContext(); ConfigurationClassPostProcessor gets automated automatically... So this is actually about general classpath-scanning ApplicationContext convenience! In the web case (as of 3.0 M3): GenericWebApplicationContext context = new GenericWebApplicationContext(servletContext); The only thing we're missing is a ClassPathXmlApplicationContext / XmlWebApplicationContext equivalent. I'm not sure whether we should turn the Generic(Web)ApplicationContext model into more of a first-class feature, or rather build ClassPathScanningApplicationContext-style convenience classes... Juergen |
Craig Walls commented The option that Juergen offers is better than nothing, but it's not a one-for-one swap with what is available for the XML configuration option. The XML-haters may not be appeased if they have to do any more (even if it's a little more) than what you have to do for the XML configuration. I'm in favor of including JavaConfigApplicationContext and JavaConfigWebApplicationContext in Spring 3. Just my $0.02. |
Juergen Hoeller commented Assigning this to you, Chris - as per our discussion today, with the goal being inclusion of ConfigurationClassApplicationContext and co in Spring 3.0 RC1. Juergen |
Gabriel Axel commented Will it include the annotations-related features that were added to JavaConfig M4 ( |
Chris Beams commented
The general goal at this time is to provide programmatic access to the same APIs that underlie the XML namespaces themselves (search around for In the meantime, along with the new |
Chris Beams commented Committed rev 2048: "SPR-5682: Initial support for ConfigurationClassApplicationContext" |
Chris Beams commented Just added |
Juergen Hoeller commented FYI, I'm in the process of reworking CC(W)AC into general AnnotationConfigApplicationContext and AnnotationConfigWebApplicationContext implementations: supporting Juergen |
Chris Beams opened SPR-5682 and commented
The JavaConfig project provided
[JavaConfigApplicationContext](http://static.springframework.org/spring-javaconfig/docs/1.0.0.M4/javadoc-api/org/springframework/config/java/context/JavaConfigApplicationContext.html)
and[JavaConfigWebApplicationContext](http://static.springframework.org/spring-javaconfig/docs/1.0.0.M4/javadoc-api/org/springframework/config/java/context/JavaConfigWebApplicationContext.html)
to allow for eliminating XML entirely. (See also: usage).Similar implementations could be provided in Spring Core, though naming would probably change to
ConfigurationClassApplicationContext
andConfigurationClassWebApplicationContext
, respectively.There are a number of issues to consider and work out before providing this support, but this issue can serve as a way to track community interest.
Sub-tasks:
@Configuration
classes and AnnotationConfig[Web]ApplicationContextIssue Links:
@ImportResource
within@Configuration
classes@Configuration
classesReferenced from: commits cbadf35, fd8935b, a48234c, 772a74a
12 votes, 13 watchers
The text was updated successfully, but these errors were encountered: