Re-organize all client/server sample code to separate client and server classes into client and server packages, respectively.
Rename sample.ServerConfig class to sample.server.GemFireServer and apply the GemFireServer Gradle Plugin. Change all 'spring.session.data.gemfire.*' and 'spring.session.data.geode.*' properties to use the SDG property prefixed with 'spring.data.gemfire.*'.
This commit is contained in:
@@ -26,4 +26,4 @@ dependencies {
|
||||
|
||||
}
|
||||
|
||||
mainClassName = "sample.ServerConfig"
|
||||
mainClassName = "sample.server.GemFireServer"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2016 the original author or authors.
|
||||
* Copyright 2017 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.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package sample;
|
||||
package sample.client;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2016 the original author or authors.
|
||||
* Copyright 2017 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.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package sample;
|
||||
package sample.client;
|
||||
|
||||
import org.springframework.session.web.context.AbstractHttpSessionApplicationInitializer;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2016 the original author or authors.
|
||||
* Copyright 2017 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.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package sample;
|
||||
package sample.client;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2016 the original author or authors.
|
||||
* Copyright 2017 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.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package sample;
|
||||
package sample.server;
|
||||
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.data.gemfire.config.annotation.CacheServerApplication;
|
||||
@@ -23,11 +23,11 @@ import org.springframework.session.data.gemfire.config.annotation.web.http.Enabl
|
||||
// tag::class[]
|
||||
@CacheServerApplication(name = "SpringSessionDataGeodeJavaConfigSampleServer", logLevel = "error") // <1>
|
||||
@EnableGemFireHttpSession(maxInactiveIntervalInSeconds = 30) // <2>
|
||||
public class ServerConfig {
|
||||
public class GemFireServer {
|
||||
|
||||
@SuppressWarnings("resource")
|
||||
public static void main(String[] args) {
|
||||
new AnnotationConfigApplicationContext(ServerConfig.class).registerShutdownHook();
|
||||
new AnnotationConfigApplicationContext(GemFireServer.class).registerShutdownHook();
|
||||
}
|
||||
}
|
||||
// end::class[]
|
||||
Reference in New Issue
Block a user