From 89bb365e987cf3afef7229f87b67c4f31dec65c5 Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Tue, 29 Mar 2011 16:41:38 +0300 Subject: [PATCH] SGF-39 + change registration distribution default + add parameter to tweak that --- .../serialization/InstantiatorFactoryBean.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/springframework/data/gemfire/serialization/InstantiatorFactoryBean.java b/src/main/java/org/springframework/data/gemfire/serialization/InstantiatorFactoryBean.java index 984b2802..e8830295 100644 --- a/src/main/java/org/springframework/data/gemfire/serialization/InstantiatorFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/serialization/InstantiatorFactoryBean.java @@ -45,6 +45,7 @@ public class InstantiatorFactoryBean implements BeanClassLoaderAware, FactoryBea private Collection list; private ClassLoader classLoader; private boolean autoRegister = true; + private boolean distribute = false; private Map, Integer> types; @@ -67,7 +68,7 @@ public class InstantiatorFactoryBean implements BeanClassLoaderAware, FactoryBea if (autoRegister) { for (Instantiator instantiator : list) { - Instantiator.register(instantiator); + Instantiator.register(instantiator, distribute); } } } @@ -116,4 +117,16 @@ public class InstantiatorFactoryBean implements BeanClassLoaderAware, FactoryBea public void setAutoRegister(boolean autoRegister) { this.autoRegister = autoRegister; } + + + /** + * Sets the distribution of the region of this {@link Instantiator} during the container startup. + * Default is false, meaning the registration will not be distributed to other clients. + * + * @see #register(Instantiator, boolean) + * @param distribute whether the registration is distributable or not + */ + public void setDistribute(boolean distribute) { + this.distribute = distribute; + } } \ No newline at end of file