From 179467bdd9d8cc7d107cb0d6aa6d5e7776783e48 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Wed, 20 Jan 2016 18:40:45 +0100 Subject: [PATCH] Make HazelcastJpaDependencyAutoConfiguration public If Both Hazelcast and Hibernate are available, Spring Boot takes the opinion that Hazelcast can be used for 2nd level caching and therefore need to start before Hibernate. Unfortunately, some users require Hibernate in some of their hazelcast use case so the link is actually reversed. One way for such user is to disable the auto-configuration that deals with this link. This class is now public so that users can locate them and exclude them if necessary. Closes gh-4960 --- .../hazelcast/HazelcastJpaDependencyAutoConfiguration.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfiguration.java index 916042df4d..a4d95cbe3a 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,13 +37,14 @@ import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; * the {@code hazelcastInstance} bean. * * @author Stephane Nicoll + * @since 1.3.2 */ @Configuration @ConditionalOnClass({ HazelcastInstance.class, LocalContainerEntityManagerFactoryBean.class }) @AutoConfigureAfter({ HazelcastAutoConfiguration.class, HibernateJpaAutoConfiguration.class }) -class HazelcastJpaDependencyAutoConfiguration { +public class HazelcastJpaDependencyAutoConfiguration { @Bean @Conditional(OnHazelcastAndJpaCondition.class)