Commit Graph

576 Commits

Author SHA1 Message Date
Phillip Webb
239d19d38c Support JNDI for JTA and JMS.
Update auto-configuration for JMS and JTA to support a ConnectionFactory
and TransactionManager exposed via JNDI.

JTA configuration now attempts a simple JtaTransactionManager before
attempting Bitronix or Atomikos configuration.

The JMS auto-configuration also now attempts to find a ConnectionFactory
from JNDI before falling back to the previous strategies. If JNDI is
present a JndiDestinationResolver is also configured instead of the
default DestinationResolver.

See gh-947
2014-08-26 22:34:10 -07:00
Phillip Webb
da88bb4791 Update JMS auto-configuration to support XA
Update JMS auto-configuration for ActiveMQ and HornetQ to support XA
transactions.

See gh-947
2014-08-26 22:33:58 -07:00
Phillip Webb
8219f2be4c Update DataSource auto-configuration to support XA
Update DataSource and JPA auto-configuration to consider XA datasources.

See gh-947
2014-08-26 22:33:57 -07:00
Josh Long
5ef136511f Add Atomikos and Bitronix JTA auto-configuration
Add auto-configuration for the Atomikos and Bitronix JTA libraries.

See gh-947
2014-08-26 22:33:51 -07:00
Josh Long
508bd14ad9 Add SpringJtaPlatform for Hibernate
Add SpringJtaPlatform Hibernate AbstractJtaPlatform implementation. Also
relocated SpringNamingStrategy to the `hibernate` sub-package.

See gh-947
2014-08-26 22:33:45 -07:00
Phillip Webb
b3ce079ea1 Automatically apply @EnableJMS
Automatically apply @EnableJMS when spring-jms is on the classpath
and the annotation hasn't already been applied. This allow for Spring's
new @JmsListener annotation to just work.

Fixes gh-1425
2014-08-26 14:55:22 -07:00
Phillip Webb
a4925dabf7 Add property for JNDI DataSource lookup
Add `spring.datasource.jndi-name` property to allow a DataSource to be
looked up from JNDI as an alternative to defining a URL connection.

Fixes gh-989
2014-08-26 11:44:38 -07:00
Phillip Webb
c98713ba95 Inject PlatformTransactionManager bean for JMS
Update JmsAutoConfiguration to inject any PlatformTransactionManager
bean into the DefaultJmsListenerContainerFactory.

Fixes gh-1444
2014-08-26 11:44:27 -07:00
Phillip Webb
5b9d45b231 Inject any existing JMS DestinationResolver bean
Update JmsAutoConfiguration to inject any existing DestinationResolver
bean into JmsTemplate and DefaultJmsListenerContainerFactory.

Fixes gh-1443
2014-08-26 11:44:19 -07:00
Phillip Webb
7a5248e38c Polish 2014-08-26 09:43:27 -07:00
Dave Syer
3404850b2e Merge branch '1.1.x' 2014-08-26 09:19:38 +01:00
Dave Syer
95d65c2ff5 Add indirection to avoid runtime dependency on MVC in templates
Velocity and Freemarker share some common properties so the base class for
configuring their properties makes some sense. Unfortunately the implementation
pulls in Spring MVC at runtime because of the signature of one method (that
would never be called). We can fix that in a number of ways, but the least
disruptive is probably to change the signature of that method and only refer
to the concrete template view resolver type if the method is called.

Fixes gh-1437
2014-08-26 09:19:07 +01:00
Dave Syer
5fd9af23d6 Merge branch '1.1.x' 2014-08-25 17:18:36 +01:00
Dave Syer
607f78a779 Add secure sample with JDBC and data.sql
We can't easily solve the problem by not allowing Spring Security to
eagerly instantiate everything, but we can be defensive about data.sql
and make sure it is executed even if the listener isn't yet registered.

Fixes gh-1386
2014-08-25 17:16:32 +01:00
Phillip Webb
658dc10722 Merge branch '1.1.x' 2014-08-21 22:11:40 -07:00
Phillip Webb
d515595ca1 Detect embedded DBs when deducing driver class
Fix DataSourceProperties getUsername() and getPassword() methods to
call getDriverClassName() rather than using `this.driverClassName` to
ensure than deduced driver classes can be used.

Fixes gh-1421
2014-08-21 22:06:01 -07:00
Phillip Webb
e6c18a00a1 Polish 2014-08-21 22:03:19 -07:00
Phillip Webb
77bf558307 Relocate configuration prefix constant
Relocate DataSourceAutoConfiguration.CONFIGURATION_PREFIX to
DataSourceProperties.PREFIX.
2014-08-21 21:44:39 -07:00
Phillip Webb
059bf3aae1 Use org.hsqldb.jdbc.JDBCDriver HSQLDB Driver
Switch driver class to the more conventionally named
`org.hsqldb.jdbc.JDBCDriver`.
2014-08-21 16:16:48 -07:00
Phillip Webb
49805661f0 Merge branch '1.1.x' 2014-08-21 12:44:02 -07:00
Phillip Webb
650e326ae7 Align MessageSource path search fix with SPR-12095
Update ExtendedPathMatchingResourcePatternResolver to use similar
code as the fix for SPR-12095.

Fixes gh-1378
2014-08-21 12:09:07 -07:00
Dave Syer
171b2e452b Make ServerProperties bean conditional on being a webapp 2014-08-20 09:09:19 +01:00
Phillip Webb
83bd36d8e0 Merge branch '1.1.x'
Conflicts:
	spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaProperties.java
2014-08-18 13:02:44 -07:00
Phillip Webb
eb721b1e9f Find 'messages*.properties' in all jar URLs
Update the the PathMatchingResourcePatternResolver used in the
MessageSourceAutoConfiguration condition to deal with the fact
that `classpath*:` patterns do not work with URLClassLoaders when
the pattern doesn't include a folder.

The ExtendedPathMatchingResourcePatternResolver works by searching
all classpath URLs when the `findAllClassPathResources` method is
called with an empty location.

Fixes gh-1378
2014-08-18 12:58:41 -07:00
Phillip Webb
6e6bc25c44 Polish 2014-08-18 09:57:03 -07:00
Dave Syer
91d3edc220 Tidy imports 2014-08-18 14:57:28 +01:00
Phillip Webb
b3ba86390f Relax EntityManagerFactoryBuilder Map generic
Relax the generic signature on EntityManagerFactoryBuilder.properties
so that any object type can be added.

Fixed gh-1376
2014-08-15 11:49:25 -07:00
Phillip Webb
ebd0d265f8 Polish 2014-08-15 11:49:13 -07:00
Phillip Webb
8476a79dd2 Add support for RelaxedDataBinder aliases
Update RelaxedDataBinder to support property aliases and change
DataSourceBuilder to use them.

Fixes gh-1384
2014-08-15 10:46:06 -07:00
Phillip Webb
45c8eca4f2 Add @ConditionalOnMissingBean(MongoDbFactory)
Update MongoAutoConfiguration to be conditional on a missing
MongoDbFactory bean. The assumption is that if the user has declared
a MongoDbFactory they will either use it directly, or they will also
register a Mongo bean.

If the MongoDbFactory class cannot be found the existing Mongo
auto-configuration still applies. This ensures that users that do
not have Spring Data can still access a Mongo bean.

Fixes gh-1341
2014-08-14 21:41:10 -07:00
Phillip Webb
e0c3dd79f9 Add String type attribute to OnBean conditions
Fixes gh-1381
2014-08-14 21:02:35 -07:00
Ramnivas Laddad
912d5cf40b Add auto-configuration for Spring Cloud
Enable if all of the following are true:
- spring-cloud is on the classpath
- There is no Cloud bean present
  (usually done by extending AbstractCloudConfig)
- The "cloud" profile is active

Fixes gh-1302

Autoconfigure spring-cloud
2014-08-14 20:47:59 -07:00
Phillip Webb
21995cc85d Polish 2014-08-14 20:47:39 -07:00
Dave Syer
300910f7d5 Merge branch '1.1.x' 2014-08-11 17:43:14 -07:00
Dave Syer
0cf1c6f0e5 Refactor AuthenticationManagerConfiguration to make sure it works
if user also adds @EnableWebMvcSecurity. The problem is that the ordering
of the init() and configure() methods in the Spring Security configurers
can force things to happen too early unless we are careful. It's still a bit
twitchy I would say, but this relatively small change seems to fix the GS guide
and not break any existing tests.

I added a sample which mimic ths GS guide so we get an integration test that
executes the new code paths.

Fixes gh-1364
2014-08-11 17:42:30 -07:00
Phillip Webb
acb621e84f Polish 2014-08-11 09:04:55 -07:00
Stephane Nicoll
d089685935 Add auto configuration for Spring 4.1 JMS features
This commit adds two additional auto-configuration items that are new
in Spring 4.1

* A JmsMessagingTemplate is automatically created if none is present
* A default JmsListenerContainerFactory is automatically created if
  @EnableJms has been triggered and no default has been set manually

Fixes gh-1298
2014-08-11 11:52:24 +02:00
Stephane Nicoll
6217c1b095 polishing 2014-08-08 18:02:35 +02:00
Dave Syer
178386abc4 Merge branch '1.1.x' 2014-08-06 19:33:57 -07:00
Dave Syer
38f8d65756 Use ApplicationEvent to ensure that authentication event publisher is registered
There was a reference to an old (fixed) issue in Spring which led to some simplification
of the AuthenticationManager layering as well.

Fixes gh-1335
2014-08-06 19:30:27 -07:00
Phillip Webb
13bb23ac5a Merge branch '1.1.x' 2014-08-06 14:17:37 -07:00
Phillip Webb
88828f5097 Use MongoDbFactory to create GridFsTemplate
Update MongoDataAutoConfiguration to use the MongoDbFactory when
creating GridFsTemplate.

Fixes gh-1295
2014-08-06 14:16:18 -07:00
Andy Wilkinson
ce02e86b89 Merge branch '1.1.x' 2014-08-06 15:07:33 +01:00
Andy Wilkinson
7d213950ad Never run data.sql scripts if spring.datasource.initialize is false
Previously, the data scripts were always run in response to the
publication of a DataSourceInitializedEvent, irrespective of
spring.datasource.initialize. While the event won't be published by
DataSourceInitializer if spring.datasource.initialize is false, it
will be published if spring.jpa.hibernate.hbm2ddl.auto has been set.

This commit updates DataSourceInitializer's handling of
DataSourceInitializedEvent to only run the data scripts if
spring.datasource.initialize is true.

Fixes #1336
2014-08-06 14:48:26 +01:00
Dave Syer
68582bbac2 Merge branch '1.1.x' 2014-08-04 08:34:49 -07:00
Dave Syer
6c5f8f9581 Add @Inherited to @EnableAutoConfiguration
Fixes gh-1328
2014-08-04 08:34:06 -07:00
Phillip Webb
8e0b3dd00a Rename some ConditionalOnProperty attributes
Rename the newly introduced @ConditionalOnProperty `match` and
`defaultMatch` attributes to `havingValue` and `matchIfMissing`.

Also added a new `name` attribute as an alternative to `value` to
aid readability.

Closes gh-1000
2014-07-29 09:13:58 -07:00
Phillip Webb
6825a7b42e Polish 2014-07-29 09:12:47 -07:00
Oliver Gierke
81cd11b4ec Improved detection of manual Spring Data repository configuration
The presense of store-specific RepositoryConfigurationExtension beans
is used to disable auto-configuration for JPA, Mongo, and Solr

Closes #1267
2014-07-29 15:56:26 +01:00
Max Bruchmann
ee40fb8cf1 Add auto-configuration for Thymeleaf data dialect
Closes #1120
2014-07-29 11:12:02 +01:00