+ change registration distribution default
+ add parameter to tweak that
This commit is contained in:
Costin Leau
2011-03-29 16:41:38 +03:00
parent 94fc0966d2
commit 89bb365e98

View File

@@ -45,6 +45,7 @@ public class InstantiatorFactoryBean implements BeanClassLoaderAware, FactoryBea
private Collection<Instantiator> list;
private ClassLoader classLoader;
private boolean autoRegister = true;
private boolean distribute = false;
private Map<Class<? extends DataSerializable>, 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;
}
}