@ -1,5 +1,5 @@
/ *
/ *
* Copyright 2012 - 20 19 the original author or authors .
* Copyright 2012 - 20 20 the original author or authors .
*
*
* Licensed under the Apache License , Version 2.0 ( the "License" ) ;
* Licensed under the Apache License , Version 2.0 ( the "License" ) ;
* you may not use this file except in compliance with the License .
* you may not use this file except in compliance with the License .
@ -21,8 +21,7 @@ import java.util.Arrays;
import java.util.List ;
import java.util.List ;
import java.util.Locale ;
import java.util.Locale ;
import javax.annotation.PostConstruct ;
import org.springframework.beans.factory.InitializingBean ;
import org.springframework.beans.factory.ObjectProvider ;
import org.springframework.beans.factory.ObjectProvider ;
import org.springframework.boot.WebApplicationType ;
import org.springframework.boot.WebApplicationType ;
import org.springframework.boot.autoconfigure.AutoConfigureAfter ;
import org.springframework.boot.autoconfigure.AutoConfigureAfter ;
@ -226,10 +225,10 @@ public class SessionAutoConfiguration {
this . classLoader = applicationContext . getClassLoader ( ) ;
this . classLoader = applicationContext . getClassLoader ( ) ;
this . sessionProperties = sessionProperties ;
this . sessionProperties = sessionProperties ;
this . candidates = candidates ;
this . candidates = candidates ;
checkAvailableImplementations ( ) ;
}
}
@PostConstruct
private void checkAvailableImplementations ( ) {
void checkAvailableImplementations ( ) {
List < Class < ? > > availableCandidates = new ArrayList < > ( ) ;
List < Class < ? > > availableCandidates = new ArrayList < > ( ) ;
for ( String candidate : this . candidates ) {
for ( String candidate : this . candidates ) {
addCandidateIfAvailable ( availableCandidates , candidate ) ;
addCandidateIfAvailable ( availableCandidates , candidate ) ;
@ -291,7 +290,7 @@ public class SessionAutoConfiguration {
/ * *
/ * *
* Base class for validating that a ( reactive ) session repository bean exists .
* Base class for validating that a ( reactive ) session repository bean exists .
* /
* /
abstract static class AbstractSessionRepositoryValidator {
abstract static class AbstractSessionRepositoryValidator implements InitializingBean {
private final SessionProperties sessionProperties ;
private final SessionProperties sessionProperties ;
@ -303,8 +302,8 @@ public class SessionAutoConfiguration {
this . sessionRepositoryProvider = sessionRepositoryProvider ;
this . sessionRepositoryProvider = sessionRepositoryProvider ;
}
}
@ PostConstruct
@ Override
void checkSessionRepository ( ) {
public void afterPropertiesSet ( ) {
StoreType storeType = this . sessionProperties . getStoreType ( ) ;
StoreType storeType = this . sessionProperties . getStoreType ( ) ;
if ( storeType ! = StoreType . NONE & & this . sessionRepositoryProvider . getIfAvailable ( ) = = null
if ( storeType ! = StoreType . NONE & & this . sessionRepositoryProvider . getIfAvailable ( ) = = null
& & storeType ! = null ) {
& & storeType ! = null ) {