Commit Graph

1027 Commits

Author SHA1 Message Date
David Syer 653c3b5280 SPR-5749: Add defensive matching using target class loader
* Changes to ASpectJExpressionPointcut plus some tests in Spring AOP
* plus some tests in groovy support

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4622 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-24 17:23:43 +00:00
Juergen Hoeller e12c5923f6 getBean(name, type) attempts type conversion if necessary (SPR-8480)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4609 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-22 20:54:02 +00:00
Juergen Hoeller 6335538e35 getBean(name, type) attempts type conversion if necessary (SPR-8480)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4607 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-22 20:52:28 +00:00
Chris Beams d058ba4579 Fix bridge method detection for class hierarchies
Prior to this change, @Autowired injection against an instance of a
subclass having different visibility than its superclass would fail
if the @Autowired method is declared only in the superclass. This is due
to an apparent change in the rules around bridge method generation
between Java 5 and Java 6, and possibly even varying across compiler
vendors.

Now, BridgeMethodResolver is used consistently when detecting
@Autowired, @Inject and @Resource metadata to bypass these bridge
methods if they exist.

Issue: SPR-7900

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4600 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-21 14:59:37 +00:00
Chris Beams d0e55b0564 Compensate for Windows paths in XmlBeanFactoryTests
Issue: SPR-8439

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4589 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-20 08:44:24 +00:00
David Syer 7613a1fc50 SPR-6268: check AnnotationUtils works with Groovy concrete classes (plus remove compiler warnings)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4572 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-17 13:35:57 +00:00
David Syer c287a3c71b SPR-6268: Add proxy-target-class to <lang:groovy/>
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4570 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-17 12:14:01 +00:00
Chris Beams b68f4d984a Provide default ParameterNameDiscoverer for AACBF
Prior to this change, AbstractAutowireCapableBeanFactory did not support
a default ParameterNameDiscoverer.  This meant that attempting to use
<constructor-arg name=".."> syntax would fail (with a fairly obscure
exception) as that feature depends on a ParameterNameDiscoverer to
introspect the constructor arguments.

This lack of a default was originally intended to avoid a dependency on
ASM, but now that (a) .asm is a built-in module and (b) .beans has a
non-optional compile-time dependency on .asm, there is no reason not to
provide this default.

The net effect is that in a number of locations throughout the
framework, namely in GenericApplicationContext and
AbstractRefreshableApplicationContext, it is no longer necessary to
explicitly call AACBF#setParameterNameDiscoverer. This also means that
using a naked BeanFactory (likely for testing scenarios) is that much
easier.

Issue: SPR-8184

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4568 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-17 09:47:19 +00:00
Chris Beams 4e2f464388 Consolidate tests related to @Config inheritance
Issue: SPR-8183

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4567 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-17 09:46:19 +00:00
Chris Beams 5a26457fca Revert "Re-enable ignored JMX tests"
As of SPR-8093, jmxremote_optional.jar is present on the build
server in jre/lib/ext, but it is not by default present on local
developer / user machines, meaning that the build ends up broken
by default.

Issue: SPR-8089, SPR-8093, SPR-8458

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4560 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-16 06:34:23 +00:00
Juergen Hoeller 8c0cfc859b restored support for String-to-ContextResource conversion (SPR-8383)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4555 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-15 15:40:12 +00:00
Juergen Hoeller a4827a93f6 refined WebLogic RMI descriptor to only mark 'getTargetInterfaceName' method as idempotent (SPR-8369)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4540 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-14 15:07:23 +00:00
Juergen Hoeller f88047c80f added further conversion tests (triggered by 3.0.6 backports)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4528 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-13 23:57:53 +00:00
Juergen Hoeller bbeed23f94 added further conversion tests (triggered by 3.0.6 backports)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4526 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-13 23:43:46 +00:00
Chris Beams cf8533fb97 Resolve ${...} placeholders in @PropertySource
Issue: SPR-8442

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4516 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-13 04:23:08 +00:00
Chris Beams 419288562b Polish @EnableScheduling Javadoc
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4515 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-12 06:56:37 +00:00
Chris Beams b3e77d9ef2 Add syntax highlighting to Javadoc where necessary
Issue: SPR-8426

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4514 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-12 06:56:17 +00:00
Sam Brannen 5cde94dc4b Polishing Eclipse classpath settings
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4513 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-11 19:56:48 +00:00
Juergen Hoeller c8627b2236 prepared Spring's DataSource and RowSet adapters for forward compatibility with JDBC 4.1
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4510 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-09 23:09:55 +00:00
Juergen Hoeller 03adc3b632 shortened build properties "org.junit.version" to "junit.version" and "org.testng.version" to "testng.version"; reverted SLF4J version back to 1.5.3 (for Hibernate 3.3.1 compatibility)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4502 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-09 09:58:15 +00:00
Chris Beams 9374f72e41 Revert introduction of AnnotationConfigCapableAC
Per review with Juergen in light of SPR-8413, which will revisit the
overall structure of ACAC and ACWAC.

Issue: SPR-8365, SPR-8413

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4499 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-09 02:54:34 +00:00
Juergen Hoeller fcd4ca61c6 fixed pattern list test
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4489 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-07 23:24:30 +00:00
Chris Beams c84c97d572 Preserve DefaultContextLoadTimeWeaver no-arg ctor
Issue: SPR-8317

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4475 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-06 13:15:10 +00:00
Chris Beams a50e4a24a9 Introduce @EnableLoadTimeWeaving
Issue: SPR-8317

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4472 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-06 08:31:18 +00:00
Mark Fisher ac176da515 SPR-8205 added support for a 'trigger' attribute (bean ref) on scheduled-task elements
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4441 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-03 18:54:21 +00:00
Sam Brannen c5cdb5602e Increased timeout in calls to assertStopWatchTimeLimit() to increase stability of the build.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4439 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-03 15:44:08 +00:00
Oliver Gierke 67ffadd1f4 SPR-7477 - Added lazy-init attribute to jee namespace
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4431 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-03 08:51:56 +00:00
Sam Brannen 6fee394ac0 [SPR-8393] AnnotatedBeanDefinitionReader's constructor now inherits the Environment of supplied BeanDefinitionRegistry.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4419 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-02 17:33:12 +00:00
Chris Beams 292916c66c Mention code alternatives in context and mvc XSDs
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4415 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-02 14:45:00 +00:00
Chris Beams de347353c6 Polish @Primary Javadoc
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4414 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-02 14:44:26 +00:00
Chris Beams c5d7dcf418 Polish @EnableScheduling Javadoc and related XSD
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4413 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-02 14:43:59 +00:00
Chris Beams c3822bd26d Polish @EnableAsync Javadoc and related XSD
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4412 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-02 14:42:26 +00:00
Costin Leau 11b4525f5a revised cache abstraction
+ remove generic signature on key generator (as the type is not used anywhere)
+ add a small improvement to CacheAspect to nicely handle the cases where the aspect is pulled in but not configured

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4407 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-02 10:01:14 +00:00
Sam Brannen f4801fa988 [SPR-8089][SPR-8093] Re-enabled ignored JMX tests based on the feedback that jmxremote_optional.jar is now present "jre/lib/ext/ in both 1.5 and 1.6 JDKs on the build server".
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4398 50f2f4bb-b051-0410-bef5-90022cba6387
2011-06-01 14:12:03 +00:00
Chris Beams fe50d070f9 Polish AdviceMode Javadoc
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4389 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-31 06:41:35 +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
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
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
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
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 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 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 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
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
Chris Beams cf19ecc5a7 Rename {Default=>Standard}Environment
Issue: SPR-8348

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4337 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-20 03:53:37 +00:00
Costin Leau 7a91725ba6 revised cache abstraction
- removed generics from Cache/CacheManager (they add no value since it's an SPI not API)
+ update docs and tests
+ renamed ConcurrentCacheFactoryBean to ConcurrentMapCacheFactoryBean

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4326 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-18 18:34:41 +00:00
Costin Leau 903928e504 revised cache abstraction
- removed AbstractDelegatingCache (a cache is not a map, no need to offer a template)
+ renamed ConcurrentCache to ConcurrentCacheMap

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4325 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-18 17:43:13 +00:00
Chris Beams 692245b0bc Revert #processConfigBeanDefinitions to 3.0.x API
Revert signature of
ConfigurationClassPostProcessor#processConfigBeanDefinitions to its form
found in the 3.0.x line.  Refactorings made during 3.1 development
caused otherwise package-private types such as
ConfigurationClassBeanDefinitionReader to escape through this public
method, causing issues for STS as well as being a general design issue.

Upon review, the refactorings could easily be backed out in favor of a
simpler approach, and this has been done.

This also means that ConfigurationClassBeanDefinitionReader can return
to package-private visibility, and this change has been made as well.

Issue: SPR-8200

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4322 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-18 08:53:46 +00:00