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 java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
@@ -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.context.annotation.Configuration;
|
||||
@@ -23,10 +23,10 @@ import org.springframework.context.annotation.ImportResource;
|
||||
// tag::class[]
|
||||
@Configuration // <1>
|
||||
@ImportResource("META-INF/spring/session-server.xml") // <2>
|
||||
public class ServerConfig {
|
||||
public class GemFireServer {
|
||||
|
||||
public static void main(String[] args) {
|
||||
new AnnotationConfigApplicationContext(ServerConfig.class).registerShutdownHook();
|
||||
new AnnotationConfigApplicationContext(GemFireServer.class).registerShutdownHook();
|
||||
}
|
||||
}
|
||||
// tag::end[]
|
||||
@@ -20,17 +20,14 @@
|
||||
<!--1-->
|
||||
<util:properties id="gemfireProperties">
|
||||
<prop key="name">SpringSessionDataGeodeSampleXmlServer</prop>
|
||||
<prop key="log-level">${spring.session.data.geode.log-level:error}</prop>
|
||||
<prop key="log-level">${spring.data.gemfire.cache.log-level:error}</prop>
|
||||
</util:properties>
|
||||
|
||||
<!--2-->
|
||||
<gfe:cache properties-ref="gemfireProperties"/>
|
||||
|
||||
<!--3-->
|
||||
<gfe:cache-server auto-startup="true"
|
||||
bind-address="${spring.session.data.geode.cache.server.host:localhost}"
|
||||
host-name-for-clients="${spring.session.data.geode.cache.server.hostname-for-clients:${spring.data.gemfire.cache.server.hostname-for-clients:localhost}}"
|
||||
port="${spring.session.data.geode.cache.server.port:${spring.data.gemfire.cache.server.port:40404}}"/>
|
||||
<gfe:cache-server port="${spring.data.gemfire.cache.server.port:40404}"/>
|
||||
|
||||
<!--4-->
|
||||
<bean class="org.springframework.session.data.gemfire.config.annotation.web.http.GemFireHttpSessionConfiguration"
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
|
||||
<context:property-placeholder/>
|
||||
|
||||
<bean class="sample.ClientServerReadyBeanPostProcessor"/>
|
||||
<bean class="sample.client.ClientServerReadyBeanPostProcessor"/>
|
||||
|
||||
<!--1-->
|
||||
<util:properties id="gemfireProperties">
|
||||
<prop key="log-level">${spring.session.data.geode.log-level:error}</prop>
|
||||
<prop key="log-level">${spring.data.gemfire.cache.log-level:error}</prop>
|
||||
</util:properties>
|
||||
|
||||
<!--2-->
|
||||
@@ -29,8 +29,7 @@
|
||||
|
||||
<!--3-->
|
||||
<gfe:pool read-timeout="15000" retry-attempts="1" subscription-enabled="true">
|
||||
<gfe:server host="${spring.session.data.geode.cache.server.host:localhost}"
|
||||
port="${spring.session.data.geode.cache.server.port:${spring.data.gemfire.cache.server.port:40404}}"/>
|
||||
<gfe:server host="localhost" port="${spring.data.gemfire.cache.server.port:40404}"/>
|
||||
</gfe:pool>
|
||||
|
||||
<!--4-->
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
<servlet>
|
||||
<servlet-name>session</servlet-name>
|
||||
<servlet-class>sample.SessionServlet</servlet-class>
|
||||
<servlet-class>sample.client.SessionServlet</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<!--1-->
|
||||
<util:properties id="gemfireProperties">
|
||||
<prop key="name">SpringSessionDataGeodeXmlP2pSample</prop>
|
||||
<prop key="log-level">${spring.session.data.geode.log-level:error}</prop>
|
||||
<prop key="log-level">${spring.data.gemfire.cache.log-level:error}</prop>
|
||||
</util:properties>
|
||||
|
||||
<!--2-->
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
<servlet>
|
||||
<servlet-name>session</servlet-name>
|
||||
<servlet-class>sample.SessionServlet</servlet-class>
|
||||
<servlet-class>sample.client.SessionServlet</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
|
||||
Reference in New Issue
Block a user