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