make close and destroy exclusive
This commit is contained in:
Costin Leau
2011-02-11 18:17:06 +02:00
parent cd7c481455
commit 1da6736931
2 changed files with 17 additions and 2 deletions

View File

@@ -136,7 +136,7 @@ public class RegionFactoryBean<K, V> extends RegionLookupFactoryBean<K, V> imple
}
}
}
if (destroy) {
else if (destroy) {
region.destroyRegion();
}
}
@@ -146,21 +146,33 @@ public class RegionFactoryBean<K, V> extends RegionLookupFactoryBean<K, V> imple
/**
* Indicates whether the region referred by this factory bean,
* will be destroyed on shutdown (default false).
* Note: destroy and close are mutually exclusive. Enabling one will automatically disable the other.
*
* @param destroy whether or not to destroy the region
*
* @see #setClose(boolean)
*/
public void setDestroy(boolean destroy) {
this.destroy = destroy;
if (destroy) {
close = false;
}
}
/**
* Indicates whether the region referred by this factory bean,
* will be closed on shutdown (default true).
* Note: destroy and close are mutually exclusive. Enabling one will automatically disable the other.
*
* @param close whether to close or not the region
* @see #setDestroy(boolean)
*/
public void setClose(boolean close) {
this.close = close;
if (close) {
destroy = false;
}
}
/**

View File

@@ -210,6 +210,8 @@ After the destroy, this region object can not be used any more and any attempt t
RegionDestroyedException.
Default is false, meaning that regions are not destroyed.
Note: destroy and close are mutually exclusive. Enabling one will automatically disable the other.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
@@ -221,7 +223,8 @@ disk files. Additionally it notifies the listeners and callbacks.
Default is true, meaning the regions are closed.
Note: Regions are automatically closed when cache closes.
Note: Regions are automatically closed when cache closes.
Note: destroy and close are mutually exclusive. Enabling one will automatically disable the other.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>