Commit Graph

4195 Commits

Author SHA1 Message Date
Sam Brannen 4e52a6da68 [SPR-7960] Initial support for @ActivateProfiles in tests.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4387 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-30 22:00:12 +00:00
Sam Brannen 675b6d0d33 [SPR-7960] Initial support for @ActivateProfiles in tests.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4386 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-30 21:59:12 +00:00
Juergen Hoeller d78839ed9d final preparations for 3.1 M2 release
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4385 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-30 13:18:16 +00:00
Chris Beams e6820ecebb Introduce DelegatingFilterProxy constructors
Issue: SPR-7672

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4384 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-30 12:57:19 +00:00
Chris Beams 1bbb71c33e Polish DelegatingFilterProxy Javadoc
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4383 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-30 12:56:32 +00:00
Chris Beams bd3cfea19a Introduce ContextLoader(Listener) constructors
Constructors have been added to both ContextLoader and
ContextLoaderListener to support instance-based programmatic
registration of listeners within ServletContainerInitializer
implementations in Servlet 3.0+ environments, and more particularly
when using Spring 3.1's WebApplicationInitializer SPI.

Issue: SPR-7672

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4382 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-30 12:56:01 +00:00
Chris Beams c7a7618400 Improve ApplicationContextInitializer sorting
ContextLoader and FrameworkServlet now use
AnnotationAwareOrderComparator to support @Order usage; previously
supported only implementation of the Ordered interface.

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4381 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-30 12:55:33 +00:00
Chris Beams bd541aca94 Introduce Framework/DispatcherServlet constructors
Constructors have been added to both FrameworkServlet and
DispatcherServlet to support instance-based programmatic registration
of Servlets within ServletContainerInitializer implementations in
Servlet 3.0+ environments, and more particularly when using Spring 3.1's
WebApplicationInitializer SPI.

This change also renames the method added to FrameworkServlet in
SPR-8185 from #initializeWebApplicationContext to #applyInitializers.
The reason being that a method named #initWebApplicationContext was
already present and the names overlapped confusingly.

Issue: SPR-7672, SPR-8185

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4380 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-30 12:54:48 +00:00
Chris Beams c7754d6d9b Fix DispatcherServlet warnings
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4379 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-30 12:54:24 +00:00
Chris Beams c28157344b Update GenericWAC to implement ConfigurableWAC
GenericWebApplicationContext now implements
ConfigurableWebApplicationContext in order to be compatible with
Framework/DispatcherServlet and ContextLoader/Listener, especially with
regard to changes in SPR-7672 that allow for programmatic use of these
types within Servlet 3.0+ environments.  For the first time, it's now
reasonable to imagine injecting a GWAC into DispatcherServlet; the most
robust way to accommodate this possibility is for GWAC to implement
CWAC.

The implementation is in name only, allowing for interchangable use of
GWAC anywhere, for example, an XWAC could otherwise go.  Methods such
as setConfigLocation will throw UnsupportedOperationException if the
configLocation value actually contains text.  Other methods are
implemented as no-ops or to throw UOE as appropriate.

Issue: SPR-7672

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4378 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-30 12:53:57 +00:00
Chris Beams fa99401dff Introduce Servlet 3.0 WebApplicationInitializer
WebApplicationInitializer provides a programmatic alternative to the
traditional WEB-INF/web.xml servlet container deployment descriptor
for Servlet API 3.0+ environments.

This is done by building atop the new ServletContainerInitializer
support in Servlet 3.0. See SpringServletContainerInitializer for
complete details. And see WebApplicationInitializer Javadoc for
typical usage examples.

Issue: SPR-7672

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4377 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-30 12:53:32 +00:00
Juergen Hoeller 29be278200 fixed reflective class names
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4376 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-29 22:00:14 +00:00
Juergen Hoeller fc0fa36e14 compatibility with Quartz 2.0 variant of the JobFactory interface
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4375 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-29 21:45:19 +00:00
Juergen Hoeller 6e3d18e19e updated Quartz scheduling package to support Quartz 1.8 as well
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4374 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-29 21:29:40 +00:00
Juergen Hoeller fa459b1a61 preparations for 3.1 M2 release
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4373 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-29 20:55:44 +00:00
Juergen Hoeller 766b189fd0 CustomNumberEditor generically declares numberClass as subclass of Number (matching NumberUtils)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4372 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-29 20:55:15 +00:00
Juergen Hoeller 326c5f4b9b polishing
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4371 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-29 20:53:34 +00:00
Juergen Hoeller 2e4df1d98e RemoteExporter uses an opaque proxy for 'serviceInterface' exposure (no AOP interfaces exposed)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4370 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-29 20:52:37 +00:00
Juergen Hoeller 9c0f443890 fixed JPA 2.0 timeout hints to correctly specify milliseconds (SPR-8086)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4369 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-29 20:52:03 +00:00
Juergen Hoeller 208a097d48 updated IntelliJ dependency descriptors
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4368 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-29 20:43:52 +00:00
Juergen Hoeller d3e3ffd25e added StandardServletMultipartResolver for Servlet 3.0
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4367 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-29 20:38:23 +00:00
Rossen Stoyanchev d2a4316a70 SPR-8218 MVC chapter updates
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4366 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-27 17:09:53 +00:00
Chris Beams d9b73461ff Upgrade javax.servlet dependency to 3.0 for .web
In support of SPR-7672 which will support code-based configuration
alternatives to web.xml using new features in the Servlet 3.0 API.

This upgrade does *not* force Spring users to upgrade to Servlet 3.0
capable containers.  Compatibility with and support for
javax.servlet >= 2.4 remains.

Issue: SPR-7672

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4365 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-26 13:34:21 +00:00
Chris Beams 5049cd0db3 Allow multiple locations via @PropertySource#value
Issue: SPR-8314

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4364 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-25 10:52:25 +00:00
Chris Beams 2a896753d4 Polish PropertySource and Environment Javadoc
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4363 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-25 10:52:03 +00:00
Arjen Poutsma 2e8c494824 Added tests for @RequestMaping produces and consumes
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4362 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-25 09:21:44 +00:00
Keith Donald fbf43508f1 Revised converter search algorithm to favor super classes before interface hierarchy
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4361 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-24 22:20:54 +00:00
Keith Donald 7d7e8ef7fb SPR-6749
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4360 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-24 19:40:14 +00:00
Keith Donald 8b9196ab7c polish
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4359 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-24 18:32:01 +00:00
Keith Donald 115348b6be added null binding check for primitives for all conversion results; polishing
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4358 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-24 17:53:18 +00:00
Rossen Stoyanchev af8f63fa65 SPR-7353 Use canWrite to narrow down list of producible types
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4357 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-24 17:22:22 +00:00
Keith Donald c3a037d7be added new ConverterRegistry operation; polishing
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4356 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-24 03:47:50 +00:00
Keith Donald 00bcadcbe5 added symmetry to ToString converters: SPR-8306
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4355 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-23 23:00:43 +00:00
Sam Brannen 1b71b04a3b Added Eclipse project dependency on org.springframework.asm
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4354 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-23 17:18:14 +00:00
Chris Beams c0b7d175e9 Delegate parent environment to child app contexts
Calls to AbstractApplicationContext#setParent delegate the parent
context environment to the child.

This ensures that any property sources added to the parent are available
to the child as well as ensuring that any profiles activated are
activated everywhere.

Child contexts may still choose to replace their environment (through an
ApplicationContextInitializer, for example).  In any case, however, in
the root/child web application context relationship established by
ContextLoader + DispatcherServlet, the child is guaranteed to have
already been given the parent environment by the time it is delegated
to any ACIs.

See AbstractApplicationContext#setParent for implementation

See FrameworkServlet#createWebApplicationContext for order in which
setParent then initializeWebApplicationContext are called.

Issue: SPR-8185

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4353 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-23 10:04:00 +00:00
Chris Beams f82aabb6c3 Introduce AnnotationConfigCapableApplicationContext
AnnotationConfigApplicationContext and
AnnotationConfigWebApplicationContext both expose #register and #scan
methods as of the completion of SPR-8320. This change introduces a new
interface that declares each of these methods and refactors ACAC and
ACWAC to implement it.

Beyond information value, this is useful for implementors of the
ApplicationContextInitializer interface, in that users may create an ACI
that works consistently across ACAC and ACWAC for standalone (e.g.
testing, batch) or web (e.g. production) use.

Issue: SPR-8365,SPR-8320

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4352 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-23 10:03:23 +00:00
Chris Beams 1fee0f3176 Introduce AnnotationConfigWAC #scan and #register
Primarily for use in conjunction with ApplicationContextInitializer,
these new #scan and #register methods mirror those in
AnnotationConfigApplicationContext. #setConfigLocation
and #setConfigLocations methods remain for compatibility with
ContextLoader-style initialization, but have been locally overridden
and documented clearly.

AnnotationConfigWebApplicationContext#loadBeanDefinitions Javadoc has
also been updated to explain the processing logic for each of these
potential inputs.

Issue: SPR-8320

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4351 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-23 10:02:50 +00:00
Chris Beams 1b34c00884 Support "contextInitializerClasses" init-param
FrameworkServlet now has support equivalent to ContextLoader and its
"contextInitializerClasses" context-param introduced in 3.1 M1.

This allows users to specify ApplicationContextInitializers at the root
(ContextLoader) level and/or at the DispatcherServlet level.

Issue: SPR-8366

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4350 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-23 10:02:18 +00:00
Chris Beams 8f4c1c339e Polish FrameworkServlet Javadoc; fix warnings
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4349 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-23 10:01:49 +00:00
Keith Donald 02d58b6a97 SPR-8364
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4348 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-23 07:38:27 +00:00
Keith Donald 888da26094 revised findCommonElement handling within TypeDescriptor.forObject(Object); we now fully introspect the collection elements to resolve the common type. We also support nested introspection e.g. collections of collections. Object.class is used to indicate no common type, and TypeDescriptor.NULL is used to indicate a null element value
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4347 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-23 05:21:02 +00:00
Keith Donald c9789d3a37 moved applyIndexedObject internal, now invoked inside forObject static factory method
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4346 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-23 01:08:18 +00:00
Keith Donald c42976ba7a SPR-8364
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4345 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-22 19:10:40 +00:00
Chris Beams a9530596bf Guard against null in #visitInnerClass
Issue: SPR-8358,SPR-8186

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4344 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-21 01:39:50 +00:00
Chris Beams 027e431bbd Register nested @Configuration classes automatically
The following is now possible:

@Configuration
public class AppConfig {
    @Inject DataSource dataSource;

    @Bean
    public MyBean myBean() {
        return new MyBean(dataSource);
    }

    @Configuration
    static class DatabaseConfig {
        @Bean
        DataSource dataSource() {
            return new EmbeddedDatabaseBuilder().build();
        }
    }
}

public static void main(String... args) {
    AnnotationConfigApplicationContext ctx =
        new AnnotationConfigApplicationContext(AppConfig.class);
    ctx.getBean(MyBean.class);     // works
    ctx.getBean(DataSource.class); // works
}

Notice that the @Import annotation was not used and that only AppConfig
was registered against the context. By virtue of the fact that
DatabaseConfig is a member class of AppConfig, it is automatically
registered when AppConfig is registered. This avoids an awkward and
redundant @Import annotation when the relationship is already implicitly
clear.

See @Configuration Javadoc for details.

Issue: SPR-8186

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4343 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-21 01:20:33 +00:00
Chris Beams 0181ed3213 Introduce ClassMetadata#getMemberClassNames
ClassMetadata implementations can now introspect their member (nested)
classes. This will allow for automatic detection of nested
@Configuration types in SPR-8186.

Issue: SPR-8358,SPR-8186

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4342 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-21 01:20:03 +00:00
Chris Beams 73eb53f002 Polish @Configuration-related Javadoc
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4341 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-21 01:19:25 +00:00
Rossen Stoyanchev 1b48f26900 SPR-7353 Respect 'produces' condition in ContentNegotiatingViewResolver, improve selection of more specific media type in a pair
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4340 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-20 17:02:20 +00:00
Chris Beams c834ba84f3 Rename {Default=>Standard}PortletEnvironment
Issue: SPR-8348

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4339 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-20 03:57:35 +00:00
Chris Beams 2b6bcf470c Rename {DefaultWeb=>StandardServlet}Environment
Issue: SPR-8348

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4338 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-20 03:55:56 +00:00