diff --git a/samples/boot/gemfire-with-scoped-proxies/src/main/java/sample/client/Application.java b/samples/boot/gemfire-with-scoped-proxies/src/main/java/sample/client/Application.java index e47056b..de9ce5b 100644 --- a/samples/boot/gemfire-with-scoped-proxies/src/main/java/sample/client/Application.java +++ b/samples/boot/gemfire-with-scoped-proxies/src/main/java/sample/client/Application.java @@ -73,7 +73,7 @@ public class Application { SpringApplication.run(Application.class, args); } - @ClientCacheApplication(name = "SpringSessionDataGeodeClientWithScopedProxiesBootSample", logLevel = "config", + @ClientCacheApplication(name = "SpringSessionDataGeodeClientWithScopedProxiesBootSample", pingInterval = 5000L, readTimeout = 15000, retryAttempts = 1, subscriptionEnabled = true) // <3> @EnableGemFireHttpSession(poolName = "DEFAULT") // <4> static class ClientCacheConfiguration { @@ -130,7 +130,7 @@ public class Application { } @RequestMapping(method = RequestMethod.GET, path = "/counts") - public String requestAndSessionInstanceCount(HttpServletRequest request, HttpSession session, Model model) { + public String requestAndSessionInstanceCount(HttpServletRequest request, HttpSession session, Model model) { // <7> model.addAttribute("sessionId", session.getId()); model.addAttribute("requestCount", this.requestBean.getCount()); @@ -139,3 +139,4 @@ public class Application { return INDEX_TEMPLATE_VIEW_NAME; } } +// end::class[] diff --git a/samples/boot/gemfire-with-scoped-proxies/src/main/java/sample/client/model/RequestScopedProxyBean.java b/samples/boot/gemfire-with-scoped-proxies/src/main/java/sample/client/model/RequestScopedProxyBean.java index 4dd98dd..d1b0c58 100644 --- a/samples/boot/gemfire-with-scoped-proxies/src/main/java/sample/client/model/RequestScopedProxyBean.java +++ b/samples/boot/gemfire-with-scoped-proxies/src/main/java/sample/client/model/RequestScopedProxyBean.java @@ -28,9 +28,10 @@ import org.springframework.web.context.annotation.RequestScope; * @author John Blum * @since 1.0.0 */ -@Component -@RequestScope(proxyMode = ScopedProxyMode.TARGET_CLASS) @SuppressWarnings("unused") +// tag::class[] +@Component // <1> +@RequestScope(proxyMode = ScopedProxyMode.TARGET_CLASS) // <2> public class RequestScopedProxyBean { private static final AtomicInteger INSTANCE_COUNTER = new AtomicInteger(0); @@ -38,7 +39,7 @@ public class RequestScopedProxyBean { private final int count; public RequestScopedProxyBean() { - this.count = INSTANCE_COUNTER.incrementAndGet(); + this.count = INSTANCE_COUNTER.incrementAndGet(); // <3> } public int getCount() { @@ -50,3 +51,4 @@ public class RequestScopedProxyBean { return String.format("{ @type = '%s', count = %d }", getClass().getName(), getCount()); } } +// end::class[] diff --git a/samples/boot/gemfire-with-scoped-proxies/src/main/java/sample/client/model/SessionScopedProxyBean.java b/samples/boot/gemfire-with-scoped-proxies/src/main/java/sample/client/model/SessionScopedProxyBean.java index c79b599..a71b371 100644 --- a/samples/boot/gemfire-with-scoped-proxies/src/main/java/sample/client/model/SessionScopedProxyBean.java +++ b/samples/boot/gemfire-with-scoped-proxies/src/main/java/sample/client/model/SessionScopedProxyBean.java @@ -29,9 +29,10 @@ import org.springframework.web.context.annotation.SessionScope; * @author John Blum * @since 1.0.0 */ -@Component -@SessionScope(proxyMode = ScopedProxyMode.TARGET_CLASS) @SuppressWarnings("unused") +// tag::class[] +@Component // <1> +@SessionScope(proxyMode = ScopedProxyMode.TARGET_CLASS) // <2> public class SessionScopedProxyBean implements Serializable { private static final AtomicInteger INSTANCE_COUNTER = new AtomicInteger(0); @@ -39,7 +40,7 @@ public class SessionScopedProxyBean implements Serializable { private final int count; public SessionScopedProxyBean() { - this.count = INSTANCE_COUNTER.incrementAndGet(); + this.count = INSTANCE_COUNTER.incrementAndGet(); // <3> } public int getCount() { @@ -51,3 +52,4 @@ public class SessionScopedProxyBean implements Serializable { return String.format("{ @type = '%s', count = %d }", getClass().getName(), getCount()); } } +// end::class[] diff --git a/samples/boot/gemfire-with-scoped-proxies/src/main/java/sample/server/GemFireServer.java b/samples/boot/gemfire-with-scoped-proxies/src/main/java/sample/server/GemFireServer.java index 6eb6fd7..eb74ab5 100644 --- a/samples/boot/gemfire-with-scoped-proxies/src/main/java/sample/server/GemFireServer.java +++ b/samples/boot/gemfire-with-scoped-proxies/src/main/java/sample/server/GemFireServer.java @@ -40,10 +40,10 @@ import org.springframework.session.data.gemfire.config.annotation.web.http.Enabl */ @SuppressWarnings("unused") // tag::class[] -@SpringBootApplication -@CacheServerApplication(name = "SpringSessionDataGeodeServerWithScopedProxiesBootSample", logLevel = "config") -@EnableGemFireHttpSession(maxInactiveIntervalInSeconds = 10) -@EnableManager(start = true) +@SpringBootApplication // <1> +@CacheServerApplication(name = "SpringSessionDataGeodeServerWithScopedProxiesBootSample") // <2> +@EnableGemFireHttpSession(maxInactiveIntervalInSeconds = 10) // <3> +@EnableManager(start = true) // <4> public class GemFireServer { public static void main(String[] args) { @@ -61,7 +61,7 @@ public class GemFireServer { @Bean CacheServerConfigurer cacheServerPortConfigurer( - @Value("${spring.session.data.geode.cache.server.port:40404}") int port) { + @Value("${spring.session.data.geode.cache.server.port:40404}") int port) { // <5> return (beanName, cacheServerFactoryBean) -> cacheServerFactoryBean.setPort(port);