Remove @Configuration meta-annotation from @Enable*Session annotations

Closes gh-1361
This commit is contained in:
Vedran Pavic
2022-09-21 22:46:37 +02:00
committed by Rob Winch
parent a23090e7e5
commit fb66cf3150
23 changed files with 88 additions and 40 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2019 the original author or authors.
* Copyright 2014-2022 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.
@@ -20,7 +20,6 @@ import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.session.SessionRepository;
import org.springframework.session.events.SessionCreatedEvent;
@@ -34,7 +33,7 @@ import org.springframework.session.events.SessionDestroyedEvent;
*
* <pre>
* <code>
* {@literal @Configuration}
* {@literal @Configuration(proxyBeanMethods = false)}
* {@literal @EnableSpringHttpSession}
* public class SpringHttpSessionConfig {
*
@@ -74,7 +73,6 @@ import org.springframework.session.events.SessionDestroyedEvent;
@Target({ java.lang.annotation.ElementType.TYPE })
@Documented
@Import(SpringHttpSessionConfiguration.class)
@Configuration(proxyBeanMethods = false)
public @interface EnableSpringHttpSession {
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2019 the original author or authors.
* Copyright 2014-2022 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.
@@ -20,7 +20,6 @@ import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
/**
@@ -31,7 +30,7 @@ import org.springframework.context.annotation.Import;
*
* <pre>
* <code>
* {@literal @Configuration}
* {@literal @Configuration(proxyBeanMethods = false)}
* {@literal @EnableSpringWebSession}
* public class SpringWebFluxConfig {
*
@@ -50,7 +49,6 @@ import org.springframework.context.annotation.Import;
@Target({ java.lang.annotation.ElementType.TYPE })
@Documented
@Import(SpringWebSessionConfiguration.class)
@Configuration(proxyBeanMethods = false)
public @interface EnableSpringWebSession {
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2019 the original author or authors.
* Copyright 2014-2022 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.
@@ -24,6 +24,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.UnsatisfiedDependencyException;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.session.ReactiveMapSessionRepository;
import org.springframework.session.ReactiveSessionRepository;
import org.springframework.web.server.adapter.WebHttpHandlerBuilder;
@@ -105,6 +106,7 @@ class SpringWebSessionConfigurationTests {
/**
* A configuration with all the right parts.
*/
@Configuration(proxyBeanMethods = false)
@EnableSpringWebSession
static class GoodConfig {
@@ -122,11 +124,13 @@ class SpringWebSessionConfigurationTests {
/**
* A configuration where no {@link ReactiveSessionRepository} is defined. It's BAD!
*/
@Configuration(proxyBeanMethods = false)
@EnableSpringWebSession
static class BadConfig {
}
@Configuration(proxyBeanMethods = false)
@EnableSpringWebSession
static class OverrideSessionIdResolver {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2016 the original author or authors.
* Copyright 2014-2022 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.
@@ -22,7 +22,6 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.session.data.mongo.MongoIndexedSessionRepository;
@@ -34,6 +33,7 @@ import org.springframework.session.data.mongo.MongoIndexedSessionRepository;
*
* <pre>
* <code>
* {@literal @Configuration(proxyBeanMethods = false)}
* {@literal @EnableMongoHttpSession}
* public class MongoHttpSessionConfig {
*
@@ -52,7 +52,6 @@ import org.springframework.session.data.mongo.MongoIndexedSessionRepository;
@Target(ElementType.TYPE)
@Documented
@Import(MongoHttpSessionConfiguration.class)
@Configuration(proxyBeanMethods = false)
public @interface EnableMongoHttpSession {
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2017 the original author or authors.
* Copyright 2014-2022 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.
@@ -20,7 +20,6 @@ import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.session.data.mongo.ReactiveMongoSessionRepository;
@@ -32,7 +31,7 @@ import org.springframework.session.data.mongo.ReactiveMongoSessionRepository;
*
* <pre>
* <code>
* {@literal @Configuration}
* {@literal @Configuration(proxyBeanMethods = false)}
* {@literal @EnableMongoWebSession}
* public class SpringWebFluxConfig {
*
@@ -52,7 +51,6 @@ import org.springframework.session.data.mongo.ReactiveMongoSessionRepository;
@Target({ java.lang.annotation.ElementType.TYPE })
@Documented
@Import(ReactiveMongoWebSessionConfiguration.class)
@Configuration(proxyBeanMethods = false)
public @interface EnableMongoWebSession {
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2017 the original author or authors.
* Copyright 2014-2022 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.
@@ -286,6 +286,7 @@ public class MongoHttpSessionConfigurationTest {
}
@Configuration(proxyBeanMethods = false)
@EnableMongoHttpSession
static class SessionRepositoryCustomizerConfiguration {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2017 the original author or authors.
* Copyright 2014-2022 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.
@@ -26,6 +26,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.UnsatisfiedDependencyException;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.data.mongodb.core.ReactiveMongoOperations;
import org.springframework.data.mongodb.core.index.IndexOperations;
@@ -239,6 +240,7 @@ public class ReactiveMongoWebSessionConfigurationTest {
/**
* A configuration with all the right parts.
*/
@Configuration(proxyBeanMethods = false)
@EnableMongoWebSession
static class GoodConfig {
@@ -252,11 +254,13 @@ public class ReactiveMongoWebSessionConfigurationTest {
/**
* A configuration where no {@link ReactiveMongoOperations} is defined. It's BAD!
*/
@Configuration(proxyBeanMethods = false)
@EnableMongoWebSession
static class BadConfig {
}
@Configuration(proxyBeanMethods = false)
@EnableMongoWebSession
static class OverrideSessionConverterConfig {
@@ -272,6 +276,7 @@ public class ReactiveMongoWebSessionConfigurationTest {
}
@Configuration(proxyBeanMethods = false)
@EnableMongoWebSession(maxInactiveIntervalInSeconds = 123, collectionName = "test-case")
static class OverrideMongoParametersConfig {
@@ -282,6 +287,7 @@ public class ReactiveMongoWebSessionConfigurationTest {
}
@Configuration(proxyBeanMethods = false)
@EnableMongoWebSession
static class ConfigWithReactiveAndImperativeMongoOperations {
@@ -308,6 +314,7 @@ public class ReactiveMongoWebSessionConfigurationTest {
}
@Configuration(proxyBeanMethods = false)
@EnableSpringWebSession
static class CustomizedReactiveConfiguration extends ReactiveMongoWebSessionConfiguration {
@@ -324,6 +331,7 @@ public class ReactiveMongoWebSessionConfigurationTest {
}
@Configuration(proxyBeanMethods = false)
@EnableMongoWebSession
static class SessionRepositoryCustomizerConfiguration {
@@ -346,6 +354,7 @@ public class ReactiveMongoWebSessionConfigurationTest {
}
@Configuration(proxyBeanMethods = false)
@EnableMongoWebSession
static class CustomIndexResolverConfigurationWithDefaultMongoSessionConverter {
@@ -362,6 +371,7 @@ public class ReactiveMongoWebSessionConfigurationTest {
}
@Configuration(proxyBeanMethods = false)
@EnableMongoWebSession
static class CustomIndexResolverConfigurationWithProvidedtMongoSessionConverter {

View File

@@ -22,7 +22,6 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.session.FlushMode;
@@ -41,7 +40,7 @@ import org.springframework.session.web.http.SessionRepositoryFilter;
* single {@link RedisConnectionFactory} must be provided. For example:
*
* <pre class="code">
* &#064;Configuration
* &#064;Configuration(proxyBeanMethods = false)
* &#064;EnableRedisHttpSession
* public class RedisHttpSessionConfig {
*
@@ -64,7 +63,6 @@ import org.springframework.session.web.http.SessionRepositoryFilter;
@Target(ElementType.TYPE)
@Documented
@Import(RedisHttpSessionConfiguration.class)
@Configuration(proxyBeanMethods = false)
public @interface EnableRedisHttpSession {
/**

View File

@@ -22,7 +22,6 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.session.FlushMode;
@@ -41,7 +40,7 @@ import org.springframework.session.web.http.SessionRepositoryFilter;
* annotation, a single {@link RedisConnectionFactory} must be provided. For example:
*
* <pre class="code">
* &#064;Configuration
* &#064;Configuration(proxyBeanMethods = false)
* &#064;EnableRedisIndexedHttpSession
* public class RedisHttpSessionConfig {
*
@@ -64,7 +63,6 @@ import org.springframework.session.web.http.SessionRepositoryFilter;
@Target(ElementType.TYPE)
@Documented
@Import(RedisIndexedHttpSessionConfiguration.class)
@Configuration(proxyBeanMethods = false)
public @interface EnableRedisIndexedHttpSession {
/**

View File

@@ -22,7 +22,6 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.data.redis.connection.ReactiveRedisConnectionFactory;
import org.springframework.session.MapSession;
@@ -38,7 +37,7 @@ import org.springframework.web.server.session.WebSessionManager;
* {@link ReactiveRedisConnectionFactory} must be provided. For example:
*
* <pre class="code">
* &#064;Configuration
* &#064;Configuration(proxyBeanMethods = false)
* &#064;EnableRedisWebSession
* public class RedisWebSessionConfig {
*
@@ -61,7 +60,6 @@ import org.springframework.web.server.session.WebSessionManager;
@Target(ElementType.TYPE)
@Documented
@Import(RedisWebSessionConfiguration.class)
@Configuration(proxyBeanMethods = false)
public @interface EnableRedisWebSession {
/**

View File

@@ -261,6 +261,7 @@ class RedisHttpsSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableRedisHttpSession(saveMode = SaveMode.ALWAYS)
static class CustomSaveModeExpressionAnnotationConfiguration {
@@ -342,6 +343,7 @@ class RedisHttpsSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableRedisHttpSession
static class SessionRepositoryCustomizerConfiguration {

View File

@@ -296,11 +296,13 @@ class RedisIndexedHttpSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableRedisIndexedHttpSession(cleanupCron = CLEANUP_CRON_EXPRESSION)
static class CustomCleanupCronExpressionAnnotationConfiguration {
}
@Configuration(proxyBeanMethods = false)
@EnableRedisIndexedHttpSession(saveMode = SaveMode.ALWAYS)
static class CustomSaveModeExpressionAnnotationConfiguration {
@@ -405,6 +407,7 @@ class RedisIndexedHttpSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableRedisIndexedHttpSession
static class SessionRepositoryCustomizerConfiguration {

View File

@@ -240,11 +240,13 @@ class RedisWebSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableRedisWebSession
static class DefaultConfig {
}
@Configuration(proxyBeanMethods = false)
@EnableRedisWebSession
static class SpringSessionRedisOperationsResolvingConfig {
@@ -257,16 +259,19 @@ class RedisWebSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableRedisWebSession(redisNamespace = REDIS_NAMESPACE)
static class CustomNamespaceConfig {
}
@Configuration(proxyBeanMethods = false)
@EnableRedisWebSession(maxInactiveIntervalInSeconds = MAX_INACTIVE_INTERVAL_IN_SECONDS)
static class CustomMaxInactiveIntervalConfig {
}
@Configuration(proxyBeanMethods = false)
@EnableRedisWebSession(saveMode = SaveMode.ALWAYS)
static class CustomSaveModeExpressionAnnotationConfiguration {
@@ -281,6 +286,7 @@ class RedisWebSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableRedisWebSession
static class QualifiedConnectionFactoryRedisConfig {
@@ -292,6 +298,7 @@ class RedisWebSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableRedisWebSession
static class PrimaryConnectionFactoryRedisConfig {
@@ -303,6 +310,7 @@ class RedisWebSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableRedisWebSession
static class QualifiedAndPrimaryConnectionFactoryRedisConfig {
@@ -320,6 +328,7 @@ class RedisWebSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableRedisWebSession
static class NamedConnectionFactoryRedisConfig {
@@ -330,6 +339,7 @@ class RedisWebSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableRedisWebSession
static class MultipleConnectionFactoryRedisConfig {
@@ -340,6 +350,7 @@ class RedisWebSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableRedisWebSession
static class CustomRedisSerializerConfig {
@@ -351,6 +362,7 @@ class RedisWebSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableRedisWebSession
static class SessionRepositoryCustomizerConfiguration {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2019 the original author or authors.
* Copyright 2014-2022 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.
@@ -19,11 +19,13 @@ package docs;
import java.util.concurrent.ConcurrentHashMap;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.session.ReactiveMapSessionRepository;
import org.springframework.session.ReactiveSessionRepository;
import org.springframework.session.config.annotation.web.server.EnableSpringWebSession;
// tag::class[]
@Configuration(proxyBeanMethods = false)
@EnableSpringWebSession
public class SpringWebSessionConfig {

View File

@@ -24,7 +24,6 @@ import java.lang.annotation.Target;
import com.hazelcast.core.HazelcastInstance;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.session.FlushMode;
import org.springframework.session.MapSession;
@@ -41,7 +40,7 @@ import org.springframework.session.web.http.SessionRepositoryFilter;
* {@link HazelcastInstance} must be provided. For example:
*
* <pre class="code">
* &#064;Configuration
* &#064;Configuration(proxyBeanMethods = false)
* &#064;EnableHazelcastHttpSession
* public class HazelcastHttpSessionConfig {
*
@@ -67,7 +66,6 @@ import org.springframework.session.web.http.SessionRepositoryFilter;
@Target(ElementType.TYPE)
@Documented
@Import(HazelcastHttpSessionConfiguration.class)
@Configuration(proxyBeanMethods = false)
public @interface EnableHazelcastHttpSession {
/**

View File

@@ -300,6 +300,7 @@ class HazelcastHttpSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableHazelcastHttpSession(saveMode = SaveMode.ALWAYS)
static class CustomSaveModeExpressionAnnotationConfiguration {
@@ -414,6 +415,7 @@ class HazelcastHttpSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableHazelcastHttpSession
static class CustomIndexResolverConfiguration extends BaseConfiguration {
@@ -425,6 +427,7 @@ class HazelcastHttpSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableHazelcastHttpSession
static class SessionRepositoryCustomizerConfiguration extends BaseConfiguration {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2020 the original author or authors.
* Copyright 2014-2022 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.
@@ -31,6 +31,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.jdbc.core.JdbcOperations;
import org.springframework.jdbc.core.JdbcTemplate;
@@ -827,6 +828,7 @@ abstract class AbstractJdbcIndexedSessionRepositoryITests {
return this.changedContext.getAuthentication().getName();
}
@Configuration(proxyBeanMethods = false)
@EnableJdbcHttpSession
static class BaseConfig {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2019 the original author or authors.
* Copyright 2014-2022 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.
@@ -24,7 +24,6 @@ import java.lang.annotation.Target;
import javax.sql.DataSource;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.session.FlushMode;
import org.springframework.session.MapSession;
@@ -42,7 +41,7 @@ import org.springframework.session.web.http.SessionRepositoryFilter;
* {@link DataSource} must be provided. For example:
*
* <pre class="code">
* &#064;Configuration
* &#064;Configuration(proxyBeanMethods = false)
* &#064;EnableJdbcHttpSession
* public class JdbcHttpSessionConfig {
*
@@ -77,7 +76,6 @@ import org.springframework.session.web.http.SessionRepositoryFilter;
@Target(ElementType.TYPE)
@Documented
@Import(JdbcHttpSessionConfiguration.class)
@Configuration(proxyBeanMethods = false)
public @interface EnableJdbcHttpSession {
/**

View File

@@ -317,6 +317,7 @@ class JdbcHttpSessionConfigurationTests {
this.context.refresh();
}
@Configuration(proxyBeanMethods = false)
@EnableJdbcHttpSession
static class NoDataSourceConfiguration {
@@ -337,11 +338,13 @@ class JdbcHttpSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableJdbcHttpSession
static class DefaultConfiguration {
}
@Configuration(proxyBeanMethods = false)
@EnableJdbcHttpSession(tableName = TABLE_NAME)
static class CustomTableNameAnnotationConfiguration {
@@ -356,6 +359,7 @@ class JdbcHttpSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableJdbcHttpSession(maxInactiveIntervalInSeconds = MAX_INACTIVE_INTERVAL_IN_SECONDS)
static class CustomMaxInactiveIntervalInSecondsAnnotationConfiguration {
@@ -370,6 +374,7 @@ class JdbcHttpSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableJdbcHttpSession(cleanupCron = CLEANUP_CRON_EXPRESSION)
static class CustomCleanupCronExpressionAnnotationConfiguration {
@@ -384,6 +389,7 @@ class JdbcHttpSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableJdbcHttpSession(flushMode = FlushMode.IMMEDIATE)
static class CustomFlushModeExpressionAnnotationConfiguration {
@@ -398,6 +404,7 @@ class JdbcHttpSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableJdbcHttpSession(saveMode = SaveMode.ALWAYS)
static class CustomSaveModeExpressionAnnotationConfiguration {
@@ -412,6 +419,7 @@ class JdbcHttpSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableJdbcHttpSession
static class QualifiedDataSourceConfiguration {
@@ -423,6 +431,7 @@ class JdbcHttpSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableJdbcHttpSession
static class PrimaryDataSourceConfiguration {
@@ -434,6 +443,7 @@ class JdbcHttpSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableJdbcHttpSession
static class QualifiedAndPrimaryDataSourceConfiguration {
@@ -451,6 +461,7 @@ class JdbcHttpSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableJdbcHttpSession
static class NamedDataSourceConfiguration {
@@ -461,6 +472,7 @@ class JdbcHttpSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableJdbcHttpSession
static class MultipleDataSourceConfiguration {
@@ -471,6 +483,7 @@ class JdbcHttpSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableJdbcHttpSession
static class CustomTransactionOperationsConfiguration {
@@ -481,6 +494,7 @@ class JdbcHttpSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableJdbcHttpSession
static class CustomIndexResolverConfiguration {
@@ -492,6 +506,7 @@ class JdbcHttpSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableJdbcHttpSession
static class CustomLobHandlerConfiguration {
@@ -502,6 +517,7 @@ class JdbcHttpSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableJdbcHttpSession
static class CustomConversionServiceConfiguration {
@@ -512,6 +528,7 @@ class JdbcHttpSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableJdbcHttpSession(tableName = "${session.jdbc.tableName}")
static class CustomJdbcHttpSessionConfiguration {
@@ -522,6 +539,7 @@ class JdbcHttpSessionConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableJdbcHttpSession
static class SessionRepositoryCustomizerConfiguration {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2016 the original author or authors.
* Copyright 2014-2022 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.
@@ -19,10 +19,12 @@ package org.springframework.session.mongodb.examples.config;
import java.time.Duration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.session.data.mongo.JdkMongoSessionConverter;
import org.springframework.session.data.mongo.config.annotation.web.http.EnableMongoHttpSession;
// tag::class[]
@Configuration(proxyBeanMethods = false)
@EnableMongoHttpSession // <1>
public class HttpSessionConfig {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2019 the original author or authors.
* Copyright 2014-2022 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.
@@ -17,12 +17,14 @@
package sample;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.session.web.http.CookieSerializer;
import org.springframework.session.web.http.DefaultCookieSerializer;
@Configuration(proxyBeanMethods = false)
@Import(EmbeddedRedisConfig.class)
@EnableRedisHttpSession
public class Config {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2019 the original author or authors.
* Copyright 2014-2022 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.
@@ -19,6 +19,7 @@ package sample;
import javax.sql.DataSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
@@ -27,6 +28,7 @@ import org.springframework.session.jdbc.config.annotation.web.http.EnableJdbcHtt
import org.springframework.transaction.PlatformTransactionManager;
// tag::class[]
@Configuration(proxyBeanMethods = false)
@EnableJdbcHttpSession // <1>
public class Config {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2019 the original author or authors.
* Copyright 2014-2022 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.
@@ -17,12 +17,14 @@
package sample;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
@Import(EmbeddedRedisConfig.class)
// tag::class[]
@Configuration(proxyBeanMethods = false)
@EnableRedisHttpSession // <1>
public class Config {