Commit Graph

142 Commits

Author SHA1 Message Date
Juergen Hoeller b4095c3e1d Class identity comparisons wherever possible
Issue: SPR-12926
2015-05-20 14:34:16 +02:00
Stephane Nicoll 073c176400 Fix test
The rework of 314b069 in a7fec6a has created a lazy proxy to make sure
that the need for an exception cache resolver come as late as possible.

Unfortunately, the test that was only failing on CI because of an early
lookup has not been updated accordingly. This is now the case.

Issue: SPR-12850
2015-03-28 12:23:30 +01:00
Stephane Nicoll a7fec6a459 Lazily resolve the default exception CacheResolver
This is a rework of 314b069 that may still lead to issue if a Cacheable
annotated bean is inspected on startup. Instead of resolving the default
exception CacheResolver if a cache operation is parsed, we resolve it as
late as possible (i.e. when an exception is thrown and the relevant
exception cache needs to be resolved)

Issue: SPR-12850
2015-03-27 09:42:06 +01:00
Stephane Nicoll 314b069fd8 Only require an exception CacheResolver if necessary
Previously, a cache infrastructure with only a CacheResolver would have
worked fine until the JSR-107 API is added to the classpath. When this is
the case, the JCache support kicks in and an exception cache resolver is
all of the sudden required.

The CacheResolver _is_ different as the default implementation does look
different attributes so if a custom CacheResolver is set, it is not
possible to "reuse" it as a fallback exception CacheResolver.

Now, an exception CacheResolver is only required if a JSR-107 annotation
with an "exceptionCacheName" attribute is processed (i.e. the exception
CacheResolver is lazily instantiated if necessary).

The use case of having a CachingConfigurerSupport with only a
CacheResolver was still broken though since the JCache support only looks
for a JCacheConfigurer bean (per the generic type set on
AbstractCachingConfiguration). This has been fixed as well.

Issue: SPR-12850
2015-03-25 15:12:08 +01:00
Juergen Hoeller d23893fd25 Consistent javadoc param declarations for type variables 2015-03-25 00:44:01 +01:00
Juergen Hoeller 26d4f91835 Compatibility with EhCache 3.0 M1 (as a JCache provider)
Issue: SPR-12847
2015-03-24 19:20:26 +01:00
Stephane Nicoll 9172a6d05e Restore proper use of CacheLoader
Since Guava 11, CacheLoader is only invoked with a LoadingCache but the
GuavaCache wrapper is always invoking getIfPresent(), available on the
main Guava Cache interface.

Update GuavaCache#get to check for the presence of a LoadingCache and
call the appropriate method.

Issue: SPR-12842
2015-03-22 10:02:36 +01:00
Stephane Nicoll a64532ede2 Add testConnection on JavaMailSender
Add a way to test that a particular JavaMailSender instance can connect
to the server that it is configured for.

Issue: SPR-12799
2015-03-10 16:58:29 +01:00
Stephane Nicoll babbf6e871 Harmonize resources location
Issue: SPR-12766
2015-02-28 10:32:40 +01:00
Stas Volsky ef95fc2f7e Synchronize clear on TransactionAwareCacheDecorator
Previously, a cache decorated with TransactionAwareCacheDecorator would
clear the cache immediately, even when a transaction is running. This
commit updates the decorator to synchronize to the afterCommit phase for
the clear operation as well.

Issue: SPR-12653
2015-02-10 14:53:16 +01:00
Stephane Nicoll c7b324b89b Move cached expression evaluation abstraction
Move MethodCacheKey and related classes to the expression package so that
other parts of the framework can benefit ot it.

CacheExpressionEvaluator is a base class that can be used to cache SpEL
expressions based on its annotation source (i.e. method). Sub-classing
that base class provides a simple to use API to retrieve Expression
instances efficiently.

Issue: SPR-12622
2015-01-26 14:44:14 +01:00
Juergen Hoeller 49e31c302b Allow schedulerWithHsqlDataSource to pass through reducing it to the trigger table check
Issue: SPR-12618
2015-01-21 11:11:07 +01:00
Sam Brannen d5fb829ade Polish failed assertion messages in QuartzSupportTests 2015-01-10 22:28:00 +01:00
Juergen Hoeller 223d849a14 Polishing 2014-11-23 00:12:02 +01:00
Juergen Hoeller 2675ce7c9f Polishing 2014-11-22 18:05:35 +01:00
Stephane Nicoll 330897b411 Fix typo 2014-11-03 13:35:14 +01:00
Juergen Hoeller e2518e0b7c Reduced DefaultJCacheOperationSource's dependency from ApplicationContext to BeanFactory
Issue: SPR-12336
2014-11-01 09:06:55 +01:00
Juergen Hoeller 0e36402bd2 Revised retrieval of cache strategy beans
Issue: SPR-12336
2014-11-01 08:26:48 +01:00
Stephane Nicoll 5aefcc802e Prevent early bean initialization with @EnableCaching
Prior to this commmit, any configuration class holding a CacheManager
bean would be eagerly instantiated. This is because the
CacheConfiguration infrastructure requests all beans of type
CacheManager.

This commit defers the resolution of the CacheManager as late
as possible.

Issue: SPR-12336
2014-10-31 14:37:30 +01:00
Juergen Hoeller 69f1b78e93 Latest dependency updates (EhCache 2.9, Joda-Time 2.5, Jackson 2.4.3, Tiles 3.0.5, Tomcat 8.0.14, FreeMarker 2.3.21) 2014-10-21 22:19:09 +02:00
Juergen Hoeller 8325b10080 Consistent formatting of license headers, package javadocs, and import declarations 2014-10-21 01:44:07 +02:00
Stephane Nicoll 6f987a9cf8 Proper JCache metadata caching on non cache methods
Prior to this commit, the cache operation metadata cache was not
updated for a method not using the JCache annotations. This means
that every execution of said method was going through the process
of identifying if it was using the cache or not.

This commit adds a default placeholder identifying the absence of
metadata; this allows to flag such method as not having any metadata
at all.

Issue: SPR-12337
2014-10-15 18:04:44 +02:00
Juergen Hoeller b7faef0103 JavaMailSenderImpl catches Exception instead of MessagingException and checks for reconnect in case of message batches
Issue: SPR-12298
2014-10-06 15:37:08 +02:00
Juergen Hoeller 473ed1a672 Polishing 2014-10-04 01:01:53 +02:00
Juergen Hoeller cc02269c9f JavaMailSenderImpl considers empty username and password as not set (for use with placeholders)
Also includes varargs declaration for applicable send methods.

Issue: SPR-12294
2014-10-04 01:01:40 +02:00
Stephane Nicoll d47c5433cb Improve configuration changes in GuavaCacheManager
Prior to this commit, setting the parameters used to build the caches
was fragile in static mode as the caches were created right when the
setCacheNames setter was called.

This commit provides a better handling of such arguments and also
provide a way to restore the dynamic mode if necessary.

Issue: SPR-12120
2014-08-27 16:36:01 +02:00
Juergen Hoeller c65a82a32d Polishing 2014-08-18 21:25:38 +02:00
Juergen Hoeller a2e6b56dd0 SchedulerAccessorBean falls back to finding a default Scheduler bean by type
Issue: SPR-12094
2014-08-18 21:23:29 +02:00
Juergen Hoeller 2ef3d66c89 Polishing 2014-08-18 19:27:08 +02:00
Juergen Hoeller 0d0d7139ee Convenient EhCache CacheManager bootstrapping within @Bean methods
Also introducing default CacheManager setup for EhCacheCacheManager, analogous to JCacheCacheManager.

Issue: SPR-12093
2014-08-18 19:25:40 +02:00
Phillip Webb ac8326d2df Polish mockito usage
Consistent use of BDDMockito rather than standard Mockito.
2014-08-11 16:23:11 -07:00
Juergen Hoeller ad475ffadf Consistent vararg declarations for String array setters 2014-08-08 17:17:09 +02:00
Juergen Hoeller 036896a6b8 Split configuration constants into local XConfigUtils classes instead of piling them up in AnnotationConfigUtils 2014-07-28 21:58:21 +02:00
Stephane Nicoll 8d8d47fb4e Fix compiler warning 2014-07-23 19:24:52 +02:00
Stephane Nicoll d9e0b292ab polishing 2014-07-23 17:08:19 +02:00
Juergen Hoeller 188e58c46a Fixed javadoc links 2014-07-18 17:21:44 +02:00
Juergen Hoeller a53987ace1 Renamed JCacheEhCacheTest to JCacheEhCacheTests 2014-07-16 20:27:49 +02:00
Stephane Nicoll fac0599aef Add cache abstraction tests using JSR-107
This commit adds an extra test implementation that runs the cache
abstraction tests using a JSR-107 cache manager. This further covers
JCacheCacheManager.

The actual JSR-107 implementation is ehcache-jcache that requires at
least ehcache 2.8.3. Since the ehcache-core artifact is no longer a
public artifact, this commit switches to the full ehcache library,
that is net.sf.ehcache:ehcache
2014-07-16 17:35:34 +02:00
Juergen Hoeller b1b7f8ab1f EhCacheFactoryBean uses reflection to call setStatisticsEnabled method (which allows for building against EhCache 2.7+)
Issue: SPR-11262
2014-07-16 16:02:03 +02:00
Juergen Hoeller bf9ccc8138 ExceptionTypeFilter and InstanceFilter live in util package itself now
Issue: SPR-9616
2014-07-09 21:43:19 +02:00
Juergen Hoeller 5614e257d1 Polishing
Issue: SPR-11939
2014-07-02 17:03:05 +02:00
Juergen Hoeller b7984f21d8 Polishing 2014-07-01 20:30:31 +02:00
Sam Brannen c60c1cec45 Suppress serial warning in JCacheCustomInterceptorTests 2014-07-01 17:40:18 +02:00
Juergen Hoeller 98d6f7b443 Polishing 2014-06-26 16:01:24 +02:00
Stephane Nicoll aaae10ce3b Cache operation invocation hook point
This commit adds a invokeOperation protected method in case one
needs a hook point in the way the underlying cache method is invoked,
and how exceptions that might be thrown by that invocation are handled.

Issue: SPR-11540
2014-06-02 15:00:51 +02:00
Stephane Nicoll bb6e07bd3a polishing 2014-05-26 13:39:38 +02:00
Stephane Nicoll 9952973e01 Add missing cache-resolver attribute
Prior to this commit, CacheResolver could not be configured through
the XML namespace (i.e. cache:annotation-driven). This is now the
case.

Issue: SPR-11490
2014-05-21 09:03:18 +02:00
Stephane Nicoll 05e96ee448 Cache provider related exceptions handling
This commit adds the necessary infrastructure to handle exceptions
thrown by a cache provider in both Spring's and JCache's caching
abstractions.

Both interceptors can be configured with a CacheErrorHandler that
defines several callbacks on typical cache operations. In particular,
handleCacheGetError can be implemented in such a way that an
exception thrown by the provider is handled as a cache miss by the
caching abstraction.

The handler can be configured with both CachingConfigurer and the
XML namespace (error-handler property)

Issue: SPR-9275
2014-05-20 16:39:34 +02:00
Juergen Hoeller b43fc7ac0f Building against Quartz 2.2.1 and JavaMail 1.5.2 2014-05-12 22:31:27 +02:00
Juergen Hoeller e04fb15a5e Compilation compatibility with JasperReports 5.5.2 2014-05-12 20:34:38 +02:00