Move Embedded Redis classes to org.springframework.session.redis.embedded

This prevents the embedded redis from being picked up in ComponentScan
in any of the samples unless the @EnableEmebeddedRedis annotation is used.

Polish gh-184
This commit is contained in:
Rob Winch
2015-04-14 16:18:14 -05:00
parent 8c1f1c4c52
commit 865e381c7c
12 changed files with 18 additions and 13 deletions

View File

@@ -16,8 +16,8 @@
package sample.config;
import org.springframework.session.data.redis.config.annotation.web.http.*;
import org.springframework.session.redis.embedded.EnableEmbeddedRedis;
import sample.EnableEmbeddedRedis;
@EnableEmbeddedRedis
// tag::class[]

View File

@@ -7,7 +7,7 @@
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!-- tag::beans[] -->
<bean class="sample.EmbeddedRedisConfiguration"/> <!--1-->
<bean class="org.springframework.session.redis.embedded.EmbeddedRedisConfiguration"/> <!--1-->
<!--2-->
<context:annotation-config/>

View File

@@ -18,6 +18,8 @@ package sample;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.session.redis.embedded.EnableEmbeddedRedis;
import org.springframework.session.redis.embedded.RedisServerPort;
// tag::class[]
@EnableEmbeddedRedis // <1>

View File

@@ -19,6 +19,8 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.session.redis.embedded.EnableEmbeddedRedis;
import org.springframework.session.redis.embedded.RedisServerPort;
import org.springframework.session.web.http.HeaderHttpSessionStrategy;
import org.springframework.session.web.http.HttpSessionStrategy;

View File

@@ -19,6 +19,8 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.session.redis.embedded.EnableEmbeddedRedis;
import org.springframework.session.redis.embedded.RedisServerPort;
// tag::class[]
@Configuration

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package sample;
package org.springframework.session.redis.embedded;
import java.io.IOException;
import java.net.ServerSocket;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package sample;
package org.springframework.session.redis.embedded;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package sample;
package org.springframework.session.redis.embedded;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;

View File

@@ -19,6 +19,8 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.session.redis.embedded.EnableEmbeddedRedis;
import org.springframework.session.redis.embedded.RedisServerPort;
/**
* @author Rob Winch

View File

@@ -22,8 +22,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
import sample.RedisServerPort;
import org.springframework.session.redis.embedded.RedisServerPort;
@Configuration
public class DataSourceConfig {

View File

@@ -34,13 +34,12 @@ import org.springframework.session.Session;
import org.springframework.session.SessionRepository;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.session.events.SessionDestroyedEvent;
import org.springframework.session.redis.embedded.EnableEmbeddedRedis;
import org.springframework.session.redis.embedded.RedisServerPort;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import sample.EnableEmbeddedRedis;
import sample.RedisServerPort;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
@WebAppConfiguration

View File

@@ -34,13 +34,12 @@ import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.session.ExpiringSession;
import org.springframework.session.SessionRepository;
import org.springframework.session.events.SessionDestroyedEvent;
import org.springframework.session.redis.embedded.EnableEmbeddedRedis;
import org.springframework.session.redis.embedded.RedisServerPort;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import sample.EnableEmbeddedRedis;
import sample.RedisServerPort;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
@WebAppConfiguration