DATAGEODE-109 - Rename o.s.d.g.RegionFactoryBean as o.s.d.g.PeerRegionFactoryBean.

Rename o.s.d.g.RegionLookupFactoryBean as o.s.d.g.ResolvableRegionFactoryBean.
This commit is contained in:
John Blum
2018-05-17 15:47:46 -07:00
parent da08c01fd1
commit acd1a20183
34 changed files with 173 additions and 164 deletions

View File

@@ -27,18 +27,26 @@ import java.util.Optional;
import java.util.stream.StreamSupport;
import org.apache.geode.cache.Region;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.data.gemfire.client.ClientRegionFactoryBean;
import org.springframework.data.gemfire.config.annotation.RegionConfigurer;
/**
* The ConfigurableRegionFactoryBean class...
* {@link ConfigurableRegionFactoryBean} is an abstract base class encapsulating functionality common
* to all configurable {@link Region} {@link FactoryBean FactoryBeans}.
*
* A {@literal configurable} {@link Region} {@link FactoryBean} includes all {@link FactoryBean FactoryBeans}
* that create a {@link Region} and allow additional configuration to be applied via a {@link RegionConfigurer}.
*
* @author John Blum
* @see org.springframework.data.gemfire.RegionLookupFactoryBean
* @see org.apache.geode.cache.Region
* @see org.springframework.beans.factory.FactoryBean
* @see org.springframework.data.gemfire.ResolvableRegionFactoryBean
* @see org.springframework.data.gemfire.config.annotation.RegionConfigurer
* @since 2.1.0
*/
@SuppressWarnings("unused")
public abstract class ConfigurableRegionFactoryBean<K, V> extends RegionLookupFactoryBean<K, V> {
public abstract class ConfigurableRegionFactoryBean<K, V> extends ResolvableRegionFactoryBean<K, V> {
private List<RegionConfigurer> regionConfigurers = Collections.emptyList();
@@ -127,9 +135,9 @@ public abstract class ConfigurableRegionFactoryBean<K, V> extends RegionLookupFa
*/
protected void applyRegionConfigurers(String regionName, Iterable<RegionConfigurer> regionConfigurers) {
if (this instanceof RegionFactoryBean) {
if (this instanceof PeerRegionFactoryBean) {
StreamSupport.stream(nullSafeIterable(regionConfigurers).spliterator(), false)
.forEach(regionConfigurer -> regionConfigurer.configure(regionName, (RegionFactoryBean<K, V>) this));
.forEach(regionConfigurer -> regionConfigurer.configure(regionName, (PeerRegionFactoryBean<K, V>) this));
}
else if (this instanceof ClientRegionFactoryBean) {
StreamSupport.stream(nullSafeIterable(regionConfigurers).spliterator(), false)

View File

@@ -17,7 +17,7 @@
package org.springframework.data.gemfire;
/**
* The GenericRegionFactoryBean class is an extension of the abstract, base RegionFactoryBean class enabling developers
* The GenericRegionFactoryBean class is an extension of the abstract, base PeerRegionFactoryBean class enabling developers
* to define a GemFire Cache Region with defaults.
*
* The defaults for DataPolicy is NORMAL and Scope is DISTRIBUTED_NO_ACK, effectively creating a "non-replicate",
@@ -33,12 +33,12 @@ package org.springframework.data.gemfire;
* in certain use cases.
*
* @author John Blum
* @see org.springframework.data.gemfire.RegionFactoryBean
* @see PeerRegionFactoryBean
* @link http://gemfire.docs.pivotal.io/latest/userguide/index.html#developing/region_options/region_types.html
* @link http://gemfire.docs.pivotal.io/latest/userguide/index.html#developing/region_options/storage_distribution_options.html
* @since 1.7.0
*/
@SuppressWarnings("unused")
public class GenericRegionFactoryBean<K, V> extends RegionFactoryBean<K, V> {
public class GenericRegionFactoryBean<K, V> extends PeerRegionFactoryBean<K, V> {
}

View File

@@ -24,7 +24,7 @@ import org.springframework.util.Assert;
* @author David Turanski
* @author John Blum
*/
public class LocalRegionFactoryBean<K, V> extends RegionFactoryBean<K, V> {
public class LocalRegionFactoryBean<K, V> extends PeerRegionFactoryBean<K, V> {
@Override
public void setScope(Scope scope) {

View File

@@ -32,16 +32,16 @@ import org.apache.geode.cache.wan.GatewaySender;
import org.springframework.util.Assert;
/**
* The LookupRegionFactoryBean class is a concrete implementation of RegionLookupFactoryBean for handling
* The LookupRegionFactoryBean class is a concrete implementation of ResolvableRegionFactoryBean for handling
* &gt;gfe:lookup-region/&lt; SDG XML namespace (XSD) elements.
*
* @author John Blum
* @see RegionLookupFactoryBean
* @see org.apache.geode.cache.AttributesMutator
* @see org.springframework.data.gemfire.ResolvableRegionFactoryBean
* @since 1.6.0
*/
@SuppressWarnings("unused")
public class LookupRegionFactoryBean<K, V> extends RegionLookupFactoryBean<K, V> {
public class LookupRegionFactoryBean<K, V> extends ResolvableRegionFactoryBean<K, V> {
private AsyncEventQueue[] asyncEventQueues;

View File

@@ -24,7 +24,7 @@ import org.springframework.util.Assert;
* @author David Turanski
* @author John Blum
*/
public class PartitionedRegionFactoryBean<K, V> extends RegionFactoryBean<K, V> {
public class PartitionedRegionFactoryBean<K, V> extends PeerRegionFactoryBean<K, V> {
@Override
protected void resolveDataPolicy(RegionFactory<K, V> regionFactory, Boolean persistent, DataPolicy dataPolicy) {

View File

@@ -85,13 +85,12 @@ import org.springframework.util.StringUtils;
* @see org.apache.geode.cache.asyncqueue.AsyncEventQueue
* @see org.springframework.beans.factory.DisposableBean
* @see org.springframework.context.SmartLifecycle
* @see RegionLookupFactoryBean
* @see org.springframework.data.gemfire.ResolvableRegionFactoryBean
* @see org.springframework.data.gemfire.client.ClientRegionFactoryBean
* @see org.springframework.data.gemfire.config.annotation.RegionConfigurer
*/
@SuppressWarnings("unused")
// TODO: Rename to PeerRegionFactoryBean in SD Lovelace
public abstract class RegionFactoryBean<K, V> extends ConfigurableRegionFactoryBean<K, V>
public abstract class PeerRegionFactoryBean<K, V> extends ConfigurableRegionFactoryBean<K, V>
implements EvictingRegionFactoryBean, ExpiringRegionFactoryBean<K, V>, DisposableBean, SmartLifecycle {
private boolean close = true;
@@ -212,11 +211,11 @@ public abstract class RegionFactoryBean<K, V> extends ConfigurableRegionFactoryB
/**
* Creates an instance of {@link RegionFactory} with the given {@link Cache} which is then used to construct,
* configure and initialize the {@link Region} specified by this {@link RegionFactoryBean}.
* configure and initialize the {@link Region} specified by this {@link PeerRegionFactoryBean}.
*
* @param cache reference to the {@link Cache}.
* @return a {@link RegionFactory} used to construct, configure and initialized the {@link Region} specified by
* this {@link RegionFactoryBean}.
* this {@link PeerRegionFactoryBean}.
* @see org.apache.geode.cache.Cache#createRegionFactory(org.apache.geode.cache.RegionShortcut)
* @see org.apache.geode.cache.Cache#createRegionFactory(org.apache.geode.cache.RegionAttributes)
* @see org.apache.geode.cache.Cache#createRegionFactory()
@@ -242,7 +241,7 @@ public abstract class RegionFactoryBean<K, V> extends ConfigurableRegionFactoryB
}
/**
* Configures the {@link RegionFactory} based on the configuration settings of this {@link RegionFactoryBean}.
* Configures the {@link RegionFactory} based on the configuration settings of this {@link PeerRegionFactoryBean}.
*
* @param regionFactory {@link RegionFactory} to configure
* @return the given {@link RegionFactory}.
@@ -297,10 +296,10 @@ public abstract class RegionFactoryBean<K, V> extends ConfigurableRegionFactoryB
/**
* Post-process the {@link RegionFactory} used to create the {@link Region} specified by
* this {@link RegionFactoryBean} during initialization.
* this {@link PeerRegionFactoryBean} during initialization.
*
* The {@link RegionFactory} has been already constructed, configured and initialized by
* this {@link RegionFactoryBean} before this method gets invoked.
* this {@link PeerRegionFactoryBean} before this method gets invoked.
*
* @param regionFactory {@link RegionFactory} used to create the {@link Region}.
* @return the given {@link RegionFactory}.
@@ -316,7 +315,7 @@ public abstract class RegionFactoryBean<K, V> extends ConfigurableRegionFactoryB
/*
* (non-Javadoc)
*
* This method is not considered part of the RegionFactoryBean API and is strictly used for testing purposes!
* This method is not considered part of the PeerRegionFactoryBean API and is strictly used for testing purposes!
*
* NOTE: Cannot pass RegionAttributes.class as the "targetType" in the second invocation of getFieldValue(..)
* since the "regionAttributes" field is naively declared as a instance of the implementation class type
@@ -360,7 +359,7 @@ public abstract class RegionFactoryBean<K, V> extends ConfigurableRegionFactoryB
* @param <K> the Class type fo the Region key.
* @param <V> the Class type of the Region value.
* @param regionFactory the GemFire RegionFactory used to configure and create the Region that is the product
* of this RegionFactoryBean.
* of this PeerRegionFactoryBean.
* @param regionAttributes the RegionAttributes containing the Region configuration settings to merge to the
* RegionFactory.
* @return the RegionFactory with the configuration settings of the RegionAttributes merged.
@@ -463,7 +462,7 @@ public abstract class RegionFactoryBean<K, V> extends ConfigurableRegionFactoryB
/*
* (non-Javadoc)
*
* This method is not part of the RegionFactoryBean API and is strictly used for testing purposes!
* This method is not part of the PeerRegionFactoryBean API and is strictly used for testing purposes!
*
* @see org.apache.geode.cache.AttributesFactory#validateAttributes(:RegionAttributes)
*/
@@ -475,7 +474,7 @@ public abstract class RegionFactoryBean<K, V> extends ConfigurableRegionFactoryB
/*
* (non-Javadoc)
*
* This method is not part of the RegionFactoryBean API and is strictly used for testing purposes!
* This method is not part of the PeerRegionFactoryBean API and is strictly used for testing purposes!
*
* NOTE unfortunately, must resort to using a GemFire internal class, ugh!
*

View File

@@ -24,7 +24,7 @@ import org.springframework.util.Assert;
* @author David Turanski
* @author John Blum
*/
public class ReplicatedRegionFactoryBean<K, V> extends RegionFactoryBean<K, V> {
public class ReplicatedRegionFactoryBean<K, V> extends PeerRegionFactoryBean<K, V> {
@Override
protected void resolveDataPolicy(RegionFactory<K, V> regionFactory, Boolean persistent, DataPolicy dataPolicy) {

View File

@@ -36,7 +36,7 @@ import org.springframework.util.StringUtils;
*
* If lookups are disabled or the {@link Region} does not exist, an exception is thrown.
*
* For declaring and configuring new Regions, see {@link RegionFactoryBean}.
* For declaring and configuring new Regions, see {@link PeerRegionFactoryBean}.
*
* @author Costin Leau
* @author John Blum
@@ -47,8 +47,7 @@ import org.springframework.util.StringUtils;
* @see org.springframework.data.gemfire.support.AbstractFactoryBeanSupport
*/
@SuppressWarnings("unused")
// TODO: Rename to ResolvableRegionFactoryBean in SD Lovelace
public abstract class RegionLookupFactoryBean<K, V> extends AbstractFactoryBeanSupport<Region<K, V>>
public abstract class ResolvableRegionFactoryBean<K, V> extends AbstractFactoryBeanSupport<Region<K, V>>
implements InitializingBean {
private Boolean lookupEnabled = false;
@@ -65,7 +64,7 @@ public abstract class RegionLookupFactoryBean<K, V> extends AbstractFactoryBeanS
private String regionName;
/**
* Initializes this {@link RegionLookupFactoryBean} after properties have been set by the Spring container.
* Initializes this {@link ResolvableRegionFactoryBean} after properties have been set by the Spring container.
*
* @throws Exception if initialization fails.
* @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
@@ -170,7 +169,7 @@ public abstract class RegionLookupFactoryBean<K, V> extends AbstractFactoryBeanS
}
/**
* Post-process the {@link Region} created by this {@link RegionFactoryBean}.
* Post-process the {@link Region} created by this {@link PeerRegionFactoryBean}.
*
* @param region {@link Region} to process.
* @see org.apache.geode.cache.Region
@@ -180,9 +179,9 @@ public abstract class RegionLookupFactoryBean<K, V> extends AbstractFactoryBeanS
}
/**
* Returns an object reference to the {@link Region} created by this {@link RegionLookupFactoryBean}.
* Returns an object reference to the {@link Region} created by this {@link ResolvableRegionFactoryBean}.
*
* @return an object reference to the {@link Region} created by this {@link RegionLookupFactoryBean}.
* @return an object reference to the {@link Region} created by this {@link ResolvableRegionFactoryBean}.
* @see org.springframework.beans.factory.FactoryBean#getObject()
* @see org.apache.geode.cache.Region
* @see #getRegion()
@@ -193,9 +192,9 @@ public abstract class RegionLookupFactoryBean<K, V> extends AbstractFactoryBeanS
}
/**
* Returns the {@link Class} type of the {@link Region} produced by this {@link RegionLookupFactoryBean}.
* Returns the {@link Class} type of the {@link Region} produced by this {@link ResolvableRegionFactoryBean}.
*
* @return the {@link Class} type of the {@link Region} produced by this {@link RegionLookupFactoryBean}.
* @return the {@link Class} type of the {@link Region} produced by this {@link ResolvableRegionFactoryBean}.
* @see org.springframework.beans.factory.FactoryBean#getObjectType()
*/
@Override

View File

@@ -47,7 +47,7 @@ import org.springframework.beans.factory.FactoryBean;
import org.springframework.data.gemfire.ConfigurableRegionFactoryBean;
import org.springframework.data.gemfire.DataPolicyConverter;
import org.springframework.data.gemfire.GemfireUtils;
import org.springframework.data.gemfire.RegionLookupFactoryBean;
import org.springframework.data.gemfire.ResolvableRegionFactoryBean;
import org.springframework.data.gemfire.config.annotation.RegionConfigurer;
import org.springframework.data.gemfire.config.xml.GemfireConstants;
import org.springframework.data.gemfire.eviction.EvictingRegionFactoryBean;
@@ -75,7 +75,7 @@ import org.springframework.util.StringUtils;
* @see org.springframework.beans.factory.DisposableBean
* @see org.springframework.beans.factory.FactoryBean
* @see org.springframework.data.gemfire.DataPolicyConverter
* @see RegionLookupFactoryBean
* @see org.springframework.data.gemfire.ResolvableRegionFactoryBean
* @see org.springframework.data.gemfire.config.annotation.RegionConfigurer
*/
@SuppressWarnings("unused")

View File

@@ -40,7 +40,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportAware;
import org.springframework.core.annotation.AnnotationAttributes;
import org.springframework.core.type.AnnotationMetadata;
import org.springframework.data.gemfire.RegionLookupFactoryBean;
import org.springframework.data.gemfire.ResolvableRegionFactoryBean;
import org.springframework.data.gemfire.config.annotation.support.AbstractAnnotationConfigSupport;
import org.springframework.data.gemfire.util.CollectionUtils;
import org.springframework.data.gemfire.util.SpringUtils;
@@ -146,7 +146,7 @@ public class CompressionConfiguration extends AbstractAnnotationConfigSupport im
return Optional.ofNullable(beanDefinition)
.flatMap(it -> resolveBeanClass(it, beanFactory.getBeanClassLoader()))
.filter(beanClass -> RegionLookupFactoryBean.class.isAssignableFrom(beanClass))
.filter(beanClass -> ResolvableRegionFactoryBean.class.isAssignableFrom(beanClass))
.isPresent();
}

View File

@@ -25,6 +25,7 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.context.annotation.Import;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
/**
* The {@link EnableAutoRegionLookup} annotation configures a Spring {@link org.springframework.context.annotation.Configuration}
@@ -36,7 +37,7 @@ import org.springframework.context.annotation.Import;
* expression or a Spring property placeholder.
*
* @author John Blum
* @see org.springframework.data.gemfire.RegionFactoryBean#setLookupEnabled(Boolean)
* @see PeerRegionFactoryBean#setLookupEnabled(Boolean)
* @see org.springframework.data.gemfire.config.annotation.AutoRegionLookupConfiguration
* @since 1.9.0
*/

View File

@@ -32,6 +32,7 @@ import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.core.annotation.AliasFor;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
import org.springframework.data.gemfire.client.ClientRegionFactoryBean;
import org.springframework.data.gemfire.config.annotation.support.CacheTypeAwareRegionFactoryBean;
import org.springframework.data.gemfire.mapping.annotation.ClientRegion;
@@ -54,7 +55,7 @@ import org.springframework.data.gemfire.mapping.annotation.ClientRegion;
* @see org.springframework.context.annotation.ComponentScan.Filter
* @see org.springframework.context.annotation.Import
* @see org.springframework.core.annotation.AliasFor
* @see org.springframework.data.gemfire.RegionFactoryBean
* @see PeerRegionFactoryBean
* @see org.springframework.data.gemfire.client.ClientRegionFactoryBean
* @see org.springframework.data.gemfire.config.annotation.EntityDefinedRegionsConfiguration
* @see org.springframework.data.gemfire.config.annotation.IndexConfiguration

View File

@@ -44,8 +44,8 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportAware;
import org.springframework.core.annotation.AnnotationAttributes;
import org.springframework.core.type.AnnotationMetadata;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.RegionLookupFactoryBean;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
import org.springframework.data.gemfire.ResolvableRegionFactoryBean;
import org.springframework.data.gemfire.client.ClientRegionFactoryBean;
import org.springframework.data.gemfire.config.annotation.support.AbstractAnnotationConfigSupport;
import org.springframework.data.gemfire.eviction.EvictingRegionFactoryBean;
@@ -65,8 +65,8 @@ import org.springframework.util.StringUtils;
* @see org.springframework.context.annotation.Bean
* @see org.springframework.context.annotation.Configuration
* @see org.springframework.context.annotation.ImportAware
* @see org.springframework.data.gemfire.RegionFactoryBean
* @see org.springframework.data.gemfire.RegionLookupFactoryBean
* @see PeerRegionFactoryBean
* @see org.springframework.data.gemfire.ResolvableRegionFactoryBean
* @see org.springframework.data.gemfire.client.ClientRegionFactoryBean
* @see org.springframework.data.gemfire.config.annotation.support.AbstractAnnotationConfigSupport
* @see org.springframework.data.gemfire.eviction.EvictionActionType
@@ -140,7 +140,7 @@ public class EvictionConfiguration extends AbstractAnnotationConfigSupport
* @return a boolean value indicating whether the Spring bean is an instance of {@link EvictingRegionFactoryBean}.
* @see org.springframework.data.gemfire.eviction.EvictingRegionFactoryBean
* @see org.springframework.data.gemfire.client.ClientRegionFactoryBean
* @see org.springframework.data.gemfire.RegionFactoryBean
* @see PeerRegionFactoryBean
*/
protected static boolean isRegionFactoryBean(Object bean) {
return bean instanceof EvictingRegionFactoryBean;
@@ -177,13 +177,13 @@ public class EvictionConfiguration extends AbstractAnnotationConfigSupport
protected interface EvictionPolicyConfigurer {
/**
* Configure the Eviction policy on the given SDG {@link RegionFactoryBean} or {@link ClientRegionFactoryBean}
* Configure the Eviction policy on the given SDG {@link PeerRegionFactoryBean} or {@link ClientRegionFactoryBean}
* used to create a GemFire {@link Region}.
*
* @param regionFactoryBean {@link RegionFactoryBean} or {@link ClientRegionFactoryBean} used to create
* @param regionFactoryBean {@link PeerRegionFactoryBean} or {@link ClientRegionFactoryBean} used to create
* a GemFire {@link Region}.
* @return the given {@code regionFactoryBean}.
* @see org.springframework.data.gemfire.RegionFactoryBean
* @see PeerRegionFactoryBean
* @see org.springframework.data.gemfire.client.ClientRegionFactoryBean
*/
Object configure(Object regionFactoryBean);
@@ -409,24 +409,24 @@ public class EvictionConfiguration extends AbstractAnnotationConfigSupport
}
/**
* Resolves the name of a given {@link Region} from the corresponding {@link RegionLookupFactoryBean} object.
* Resolves the name of a given {@link Region} from the corresponding {@link ResolvableRegionFactoryBean} object.
*
* @param regionFactoryBean {@link RegionLookupFactoryBean} from which to resolve the {@link Region} name.
* @return the resolved name of the {@link Region} created from the given {@link RegionLookupFactoryBean}.
* @see org.springframework.data.gemfire.RegionLookupFactoryBean#resolveRegionName()
* @param regionFactoryBean {@link ResolvableRegionFactoryBean} from which to resolve the {@link Region} name.
* @return the resolved name of the {@link Region} created from the given {@link ResolvableRegionFactoryBean}.
* @see org.springframework.data.gemfire.ResolvableRegionFactoryBean#resolveRegionName()
*/
protected String resolveRegionName(Object regionFactoryBean) {
return regionFactoryBean instanceof RegionLookupFactoryBean
? ((RegionLookupFactoryBean) regionFactoryBean).resolveRegionName()
return regionFactoryBean instanceof ResolvableRegionFactoryBean
? ((ResolvableRegionFactoryBean) regionFactoryBean).resolveRegionName()
: null;
}
/**
* Sets the {@link EvictionAttributes} on the {@link RegionFactoryBean} or {@link ClientRegionFactoryBean}
* Sets the {@link EvictionAttributes} on the {@link PeerRegionFactoryBean} or {@link ClientRegionFactoryBean}
* used to create the targeted {@link Region}.
*
* @param regionFactoryBean {@link RegionFactoryBean} or {@link ClientRegionFactoryBean} on which to
* @param regionFactoryBean {@link PeerRegionFactoryBean} or {@link ClientRegionFactoryBean} on which to
* set the {@link EvictionAttributes} encapsulating the Eviction policy for the targeted {@link Region}.
* @return the {@code regionFactoryBean}.
* @see org.springframework.data.gemfire.eviction.EvictingRegionFactoryBean#setEvictionAttributes(EvictionAttributes)

View File

@@ -40,8 +40,8 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportAware;
import org.springframework.core.annotation.AnnotationAttributes;
import org.springframework.core.type.AnnotationMetadata;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.RegionLookupFactoryBean;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
import org.springframework.data.gemfire.ResolvableRegionFactoryBean;
import org.springframework.data.gemfire.client.ClientRegionFactoryBean;
import org.springframework.data.gemfire.config.annotation.support.AbstractAnnotationConfigSupport;
import org.springframework.data.gemfire.expiration.AnnotationBasedExpiration;
@@ -118,7 +118,7 @@ public class ExpirationConfiguration extends AbstractAnnotationConfigSupport imp
* @return a boolean value indicating whether the Spring bean is an instance of {@link ExpiringRegionFactoryBean}.
* @see org.springframework.data.gemfire.expiration.ExpiringRegionFactoryBean
* @see org.springframework.data.gemfire.client.ClientRegionFactoryBean
* @see org.springframework.data.gemfire.RegionFactoryBean
* @see PeerRegionFactoryBean
*/
protected static boolean isRegionFactoryBean(Object bean) {
return bean instanceof ExpiringRegionFactoryBean;
@@ -478,20 +478,20 @@ public class ExpirationConfiguration extends AbstractAnnotationConfigSupport imp
}
/**
* Resolves the name of a given {@link Region} from the corresponding {@link RegionLookupFactoryBean} object.
* Resolves the name of a given {@link Region} from the corresponding {@link ResolvableRegionFactoryBean} object.
*
* @param regionFactoryBean {@link RegionLookupFactoryBean} from which to resolve the {@link Region} name.
* @return the resolved name of the {@link Region} created from the given {@link RegionLookupFactoryBean}.
* @see org.springframework.data.gemfire.RegionLookupFactoryBean#resolveRegionName()
* @param regionFactoryBean {@link ResolvableRegionFactoryBean} from which to resolve the {@link Region} name.
* @return the resolved name of the {@link Region} created from the given {@link ResolvableRegionFactoryBean}.
* @see org.springframework.data.gemfire.ResolvableRegionFactoryBean#resolveRegionName()
*/
protected String resolveRegionName(Object regionFactoryBean) {
return regionFactoryBean instanceof RegionLookupFactoryBean
? ((RegionLookupFactoryBean) regionFactoryBean).resolveRegionName() : null;
return regionFactoryBean instanceof ResolvableRegionFactoryBean
? ((ResolvableRegionFactoryBean) regionFactoryBean).resolveRegionName() : null;
}
/**
* Configures the Expiration policies on the targeted {@link ExpiringRegionFactoryBean}, which may be
* either a {@link RegionFactoryBean} or {@link ClientRegionFactoryBean}.
* either a {@link PeerRegionFactoryBean} or {@link ClientRegionFactoryBean}.
*
* @param regionFactoryBean {@link ExpiringRegionFactoryBean} to configure.
* @return the given {@link ExpiringRegionFactoryBean}.

View File

@@ -39,7 +39,7 @@ import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.type.AnnotationMetadata;
import org.springframework.data.gemfire.RegionLookupFactoryBean;
import org.springframework.data.gemfire.ResolvableRegionFactoryBean;
import org.springframework.data.gemfire.config.annotation.support.AbstractAnnotationConfigSupport;
import org.springframework.data.gemfire.config.annotation.support.EmbeddedServiceConfigurationSupport;
import org.springframework.data.gemfire.util.CollectionUtils;
@@ -134,7 +134,7 @@ public class OffHeapConfiguration extends EmbeddedServiceConfigurationSupport {
return Optional.ofNullable(beanDefinition)
.flatMap(it -> resolveBeanClass(it, beanFactory.getBeanClassLoader()))
.filter(beanClass -> RegionLookupFactoryBean.class.isAssignableFrom(beanClass))
.filter(beanClass -> ResolvableRegionFactoryBean.class.isAssignableFrom(beanClass))
.isPresent();
}

View File

@@ -18,7 +18,7 @@ package org.springframework.data.gemfire.config.annotation;
import org.apache.geode.cache.Region;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
import org.springframework.data.gemfire.client.ClientRegionFactoryBean;
import org.springframework.data.gemfire.config.annotation.support.CacheTypeAwareRegionFactoryBean;
@@ -29,7 +29,7 @@ import org.springframework.data.gemfire.config.annotation.support.CacheTypeAware
*
* @author John Blum
* @see org.apache.geode.cache.Region
* @see org.springframework.data.gemfire.RegionFactoryBean
* @see PeerRegionFactoryBean
* @see org.springframework.data.gemfire.client.ClientRegionFactoryBean
* @see org.springframework.data.gemfire.config.annotation.EnableEntityDefinedRegions
* @see CacheTypeAwareRegionFactoryBean
@@ -38,14 +38,14 @@ import org.springframework.data.gemfire.config.annotation.support.CacheTypeAware
public interface RegionConfigurer {
/**
* Configuration callback method providing a reference to a {@link RegionFactoryBean} used to construct, configure
* Configuration callback method providing a reference to a {@link PeerRegionFactoryBean} used to construct, configure
* and initialize an instance of a peer {@link Region}.
*
* @param beanName name of {@link Region} bean declared in the Spring application context.
* @param bean reference to the {@link RegionFactoryBean}.
* @see org.springframework.data.gemfire.RegionFactoryBean
* @param bean reference to the {@link PeerRegionFactoryBean}.
* @see PeerRegionFactoryBean
*/
default void configure(String beanName, RegionFactoryBean<?, ?> bean) {
default void configure(String beanName, PeerRegionFactoryBean<?, ?> bean) {
}
/**

View File

@@ -42,8 +42,8 @@ import org.springframework.data.gemfire.GemfireUtils;
import org.springframework.data.gemfire.GenericRegionFactoryBean;
import org.springframework.data.gemfire.LocalRegionFactoryBean;
import org.springframework.data.gemfire.PartitionedRegionFactoryBean;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.RegionLookupFactoryBean;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
import org.springframework.data.gemfire.ResolvableRegionFactoryBean;
import org.springframework.data.gemfire.RegionShortcutWrapper;
import org.springframework.data.gemfire.ReplicatedRegionFactoryBean;
import org.springframework.data.gemfire.client.ClientRegionFactoryBean;
@@ -74,8 +74,8 @@ import org.springframework.util.StringUtils;
* @see org.springframework.data.gemfire.GenericRegionFactoryBean
* @see org.springframework.data.gemfire.LocalRegionFactoryBean
* @see org.springframework.data.gemfire.PartitionedRegionFactoryBean
* @see org.springframework.data.gemfire.RegionFactoryBean
* @see org.springframework.data.gemfire.RegionLookupFactoryBean
* @see PeerRegionFactoryBean
* @see org.springframework.data.gemfire.ResolvableRegionFactoryBean
* @see org.springframework.data.gemfire.ReplicatedRegionFactoryBean
* @see org.springframework.data.gemfire.client.ClientRegionFactoryBean
* @see org.springframework.data.gemfire.config.annotation.RegionConfigurer
@@ -84,7 +84,7 @@ import org.springframework.util.StringUtils;
* @since 1.9.0
*/
@SuppressWarnings("unused")
public class CacheTypeAwareRegionFactoryBean<K, V> extends RegionLookupFactoryBean<K, V>
public class CacheTypeAwareRegionFactoryBean<K, V> extends ResolvableRegionFactoryBean<K, V>
implements EvictingRegionFactoryBean, ExpiringRegionFactoryBean<K, V> {
private GemFireCache gemfireCache;
@@ -189,7 +189,7 @@ public class CacheTypeAwareRegionFactoryBean<K, V> extends RegionLookupFactoryBe
/**
* Constructs, configures and initializes a new server {@link Region} using a sub-class
* of {@link RegionFactoryBean}.
* of {@link PeerRegionFactoryBean}.
*
* @param gemfireCache reference to the {@link GemFireCache} used to create/initialize the factory
* used to create the server {@link Region}.
@@ -203,7 +203,7 @@ public class CacheTypeAwareRegionFactoryBean<K, V> extends RegionLookupFactoryBe
*/
protected Region<K, V> newServerRegion(GemFireCache gemfireCache, String regionName) throws Exception {
RegionFactoryBean<K, V> serverRegionFactory = newRegionFactoryBean();
PeerRegionFactoryBean<K, V> serverRegionFactory = newRegionFactoryBean();
serverRegionFactory.setAttributes(getRegionAttributes());
serverRegionFactory.setBeanFactory(getBeanFactory());
@@ -229,16 +229,16 @@ public class CacheTypeAwareRegionFactoryBean<K, V> extends RegionLookupFactoryBe
}
/**
* Constructs a {@link Class sub-type} of the {@link RegionFactoryBean} class based on
* Constructs a {@link Class sub-type} of the {@link PeerRegionFactoryBean} class based on
* the {@link #getServerRegionShortcut()} and {@link #getDataPolicy()}.
*
* @return a new instance of the {@link RegionFactoryBean}.
* @return a new instance of the {@link PeerRegionFactoryBean}.
* @see org.springframework.data.gemfire.LocalRegionFactoryBean
* @see org.springframework.data.gemfire.PartitionedRegionFactoryBean
* @see org.springframework.data.gemfire.ReplicatedRegionFactoryBean
* @see org.springframework.data.gemfire.RegionFactoryBean
* @see PeerRegionFactoryBean
*/
protected RegionFactoryBean<K, V> newRegionFactoryBean() {
protected PeerRegionFactoryBean<K, V> newRegionFactoryBean() {
RegionShortcutWrapper regionShortcutWrapper = RegionShortcutWrapper.valueOf(getServerRegionShortcut());
@@ -423,10 +423,10 @@ public class CacheTypeAwareRegionFactoryBean<K, V> extends RegionLookupFactoryBe
/**
* Null-safe operation used to set an array of {@link RegionConfigurer RegionConfigurers} used to apply
* additional configuration to this {@link RegionLookupFactoryBean} when using Annotation-based configuration.
* additional configuration to this {@link ResolvableRegionFactoryBean} when using Annotation-based configuration.
*
* @param regionConfigurers array of {@link RegionConfigurer RegionConfigurers} used to apply
* additional configuration to this {@link RegionLookupFactoryBean}.
* additional configuration to this {@link ResolvableRegionFactoryBean}.
* @see org.springframework.data.gemfire.config.annotation.RegionConfigurer
* @see #setRegionConfigurers(List)
*/
@@ -436,10 +436,10 @@ public class CacheTypeAwareRegionFactoryBean<K, V> extends RegionLookupFactoryBe
/**
* Null-safe operation used to set an {@link Iterable} of {@link RegionConfigurer RegionConfigurers} used to apply
* additional configuration to this {@link RegionLookupFactoryBean} when using Annotation-based configuration.
* additional configuration to this {@link ResolvableRegionFactoryBean} when using Annotation-based configuration.
*
* @param regionConfigurers {@link Iterable} of {@link RegionConfigurer RegionConfigurers} used to apply
* additional configuration to this {@link RegionLookupFactoryBean}.
* additional configuration to this {@link ResolvableRegionFactoryBean}.
* @see org.springframework.data.gemfire.config.annotation.RegionConfigurer
*/
public void setRegionConfigurers(List<RegionConfigurer> regionConfigurers) {

View File

@@ -32,6 +32,7 @@ import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.ManagedArray;
import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
@@ -44,7 +45,7 @@ import org.w3c.dom.Element;
* @author David Turanski
* @author John Blum
* @see org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
* @see org.springframework.data.gemfire.RegionFactoryBean
* @see PeerRegionFactoryBean
*/
abstract class AbstractRegionParser extends AbstractSingleBeanDefinitionParser {

View File

@@ -19,14 +19,14 @@ package org.springframework.data.gemfire.config.xml;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.data.gemfire.RegionAttributesFactoryBean;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
import org.w3c.dom.Element;
/**
* Bean definition parser for &lt;gfe:*-region-template&gt; SDG XML namespace (XSD) elements.
*
* @author John Blum
* @see org.springframework.data.gemfire.RegionFactoryBean
* @see PeerRegionFactoryBean
* @see AbstractRegionParser
* @since 1.5.0
*/
@@ -37,7 +37,7 @@ class TemplateRegionParser extends AbstractRegionParser {
*/
@Override
protected Class<?> getRegionFactoryClass() {
return RegionFactoryBean.class;
return PeerRegionFactoryBean.class;
}
/**

View File

@@ -22,14 +22,14 @@ import static org.springframework.data.gemfire.support.GemfireBeanFactoryLocator
import org.apache.geode.cache.CacheCallback;
import org.apache.geode.cache.Declarable;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
/**
* Convenience class for Spring-aware GemFire {@link Declarable} components. Provides subclasses with a reference
* to the current Spring {@link BeanFactory} in orde to perform Spring bean lookups or resource loading.
*
* Note, in most cases, the developer should just declare the same components as Spring beans in the Spring container,
* through {@link RegionFactoryBean}, which gives access to the full Spring container capabilities and does not
* through {@link PeerRegionFactoryBean}, which gives access to the full Spring container capabilities and does not
* enforce the {@link Declarable} interface to be implemented.
*
* @author Costin Leau

View File

@@ -62,14 +62,14 @@ public class GenericRegionFactoryBeanTest {
.set("log-level", "warning")
.create();
RegionFactoryBean<Object, Object> defaultRegionFactory = new GenericRegionFactoryBean<Object, Object>();
PeerRegionFactoryBean<Object, Object> defaultRegionFactory = new GenericRegionFactoryBean<Object, Object>();
defaultRegionFactory.setCache(gemfireCache);
defaultRegionFactory.setName("DefaultRegion");
defaultRegionFactory.afterPropertiesSet();
defaultRegion = defaultRegionFactory.getObject();
RegionFactoryBean<Object, Object> emptyRegionFactory = new GenericRegionFactoryBean<Object, Object>();
PeerRegionFactoryBean<Object, Object> emptyRegionFactory = new GenericRegionFactoryBean<Object, Object>();
emptyRegionFactory.setCache(gemfireCache);
emptyRegionFactory.setDataPolicy(DataPolicy.EMPTY);
emptyRegionFactory.setName("EmptyRegion");
@@ -78,7 +78,7 @@ public class GenericRegionFactoryBeanTest {
emptyRegion = emptyRegionFactory.getObject();
RegionFactoryBean<Object, Object> localRegionFactory = new GenericRegionFactoryBean<Object, Object>();
PeerRegionFactoryBean<Object, Object> localRegionFactory = new GenericRegionFactoryBean<Object, Object>();
localRegionFactory.setCache(gemfireCache);
localRegionFactory.setDataPolicy(DataPolicy.NORMAL);
localRegionFactory.setName("LocalRegion");
@@ -87,7 +87,7 @@ public class GenericRegionFactoryBeanTest {
localRegion = localRegionFactory.getObject();
RegionFactoryBean<Object, Object> normalRegionFactory = new GenericRegionFactoryBean<Object, Object>();
PeerRegionFactoryBean<Object, Object> normalRegionFactory = new GenericRegionFactoryBean<Object, Object>();
normalRegionFactory.setCache(gemfireCache);
normalRegionFactory.setDataPolicy(DataPolicy.NORMAL);
normalRegionFactory.setName("NormalRegion");
@@ -96,7 +96,7 @@ public class GenericRegionFactoryBeanTest {
normalRegion = normalRegionFactory.getObject();
RegionFactoryBean<Object, Object> persistentPartitionRegionFactory = new GenericRegionFactoryBean<Object, Object>();
PeerRegionFactoryBean<Object, Object> persistentPartitionRegionFactory = new GenericRegionFactoryBean<Object, Object>();
persistentPartitionRegionFactory.setCache(gemfireCache);
persistentPartitionRegionFactory.setDataPolicy(DataPolicy.PERSISTENT_PARTITION);
persistentPartitionRegionFactory.setName("PersistentPartitionRegion");
@@ -105,7 +105,7 @@ public class GenericRegionFactoryBeanTest {
persistentPartitionRegion = persistentPartitionRegionFactory.getObject();
RegionFactoryBean<Object, Object> preloadedRegionFactory = new GenericRegionFactoryBean<Object, Object>();
PeerRegionFactoryBean<Object, Object> preloadedRegionFactory = new GenericRegionFactoryBean<Object, Object>();
preloadedRegionFactory.setCache(gemfireCache);
preloadedRegionFactory.setDataPolicy(DataPolicy.PRELOADED);
preloadedRegionFactory.setName("PreloadedRegion");
@@ -113,7 +113,7 @@ public class GenericRegionFactoryBeanTest {
preloadedRegion = preloadedRegionFactory.getObject();
RegionFactoryBean<Object, Object> replicateRegionFactory = new GenericRegionFactoryBean<Object, Object>();
PeerRegionFactoryBean<Object, Object> replicateRegionFactory = new GenericRegionFactoryBean<Object, Object>();
replicateRegionFactory.setCache(gemfireCache);
replicateRegionFactory.setDataPolicy(DataPolicy.REPLICATE);
replicateRegionFactory.setName("ReplicateRegion");

View File

@@ -57,7 +57,7 @@ import org.springframework.data.gemfire.test.support.AbstractRegionFactoryBeanTe
import org.springframework.data.gemfire.util.ArrayUtils;
/**
* Unit tests for {@link RegionFactoryBean}.
* Unit tests for {@link PeerRegionFactoryBean}.
*
* @author David Turanski
* @author John Blum
@@ -68,13 +68,13 @@ import org.springframework.data.gemfire.util.ArrayUtils;
* @see org.apache.geode.cache.RegionAttributes
* @see org.apache.geode.cache.RegionFactory
* @see org.apache.geode.cache.RegionShortcut
* @see org.springframework.data.gemfire.RegionFactoryBean
* @see PeerRegionFactoryBean
* @see org.springframework.data.gemfire.test.support.AbstractRegionFactoryBeanTests
*/
@SuppressWarnings("unchecked")
public class RegionFactoryBeanTest extends AbstractRegionFactoryBeanTests {
public class PeerRegionFactoryBeanTest extends AbstractRegionFactoryBeanTests {
private final RegionFactoryBean factoryBean = new TestRegionFactoryBean();
private final PeerRegionFactoryBean factoryBean = new TestRegionFactoryBean();
@After
public void tearDown() {
@@ -173,7 +173,7 @@ public class RegionFactoryBeanTest extends AbstractRegionFactoryBeanTests {
@Test
public void testIsPersistent() {
RegionFactoryBean<?, ?> factoryBean = new TestRegionFactoryBean<>();
PeerRegionFactoryBean<?, ?> factoryBean = new TestRegionFactoryBean<>();
assertFalse(factoryBean.isPersistent());
@@ -189,7 +189,7 @@ public class RegionFactoryBeanTest extends AbstractRegionFactoryBeanTests {
@Test
public void testIsNotPersistent() {
RegionFactoryBean<?, ?> factoryBean = new TestRegionFactoryBean<>();
PeerRegionFactoryBean<?, ?> factoryBean = new TestRegionFactoryBean<>();
assertFalse(factoryBean.isNotPersistent());
@@ -216,7 +216,7 @@ public class RegionFactoryBeanTest extends AbstractRegionFactoryBeanTests {
AtomicBoolean setDataPolicyCalled = new AtomicBoolean(false);
RegionFactoryBean factoryBean = new RegionFactoryBean() {
PeerRegionFactoryBean factoryBean = new PeerRegionFactoryBean() {
@Override
DataPolicy getDataPolicy(RegionFactory regionFactory, RegionShortcut regionShortcut) {
@@ -255,7 +255,7 @@ public class RegionFactoryBeanTest extends AbstractRegionFactoryBeanTests {
when(mockCache.createRegionFactory(eq(mockRegionAttributes))).thenReturn(mockRegionFactory);
RegionFactoryBean factoryBean = new TestRegionFactoryBean();
PeerRegionFactoryBean factoryBean = new TestRegionFactoryBean();
factoryBean.setAttributes(mockRegionAttributes);
factoryBean.setShortcut(null);
@@ -274,7 +274,7 @@ public class RegionFactoryBeanTest extends AbstractRegionFactoryBeanTests {
when(mockCache.createRegionFactory()).thenReturn(mockRegionFactory);
RegionFactoryBean factoryBean = new TestRegionFactoryBean();
PeerRegionFactoryBean factoryBean = new TestRegionFactoryBean();
factoryBean.setAttributes(null);
factoryBean.setShortcut(null);
@@ -325,7 +325,7 @@ public class RegionFactoryBeanTest extends AbstractRegionFactoryBeanTests {
when(mockRegionAttributes.getStatisticsEnabled()).thenReturn(true);
when(mockRegionAttributes.getSubscriptionAttributes()).thenReturn(testSubscriptionAttributes);
RegionFactoryBean factoryBean = new RegionFactoryBean() {
PeerRegionFactoryBean factoryBean = new PeerRegionFactoryBean() {
@Override boolean isUserSpecifiedEvictionAttributes(final RegionAttributes regionAttributes) {
return true;
}
@@ -436,7 +436,7 @@ public class RegionFactoryBeanTest extends AbstractRegionFactoryBeanTests {
when(mockRegionAttributes.getStatisticsEnabled()).thenReturn(true);
when(mockRegionAttributes.getSubscriptionAttributes()).thenReturn(null);
RegionFactoryBean factoryBean = new RegionFactoryBean() {
PeerRegionFactoryBean factoryBean = new PeerRegionFactoryBean() {
@Override boolean isUserSpecifiedEvictionAttributes(final RegionAttributes regionAttributes) {
return false;
}
@@ -1087,6 +1087,6 @@ public class RegionFactoryBeanTest extends AbstractRegionFactoryBeanTests {
}
}
protected static class TestRegionFactoryBean<K, V> extends RegionFactoryBean<K, V> {
protected static class TestRegionFactoryBean<K, V> extends PeerRegionFactoryBean<K, V> {
}
}

View File

@@ -33,7 +33,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.data.gemfire.PartitionedRegionFactoryBean;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
import org.springframework.data.gemfire.client.ClientRegionFactoryBean;
import org.springframework.data.gemfire.config.annotation.test.entities.CollocatedPartitionRegionEntity;
import org.springframework.data.gemfire.config.annotation.test.entities.NonEntity;
@@ -52,7 +52,7 @@ import org.springframework.data.gemfire.test.GemfireTestBeanPostProcessor;
* @see org.apache.geode.cache.Region
* @see org.springframework.context.ConfigurableApplicationContext
* @see org.springframework.context.annotation.AnnotationConfigApplicationContext
* @see org.springframework.data.gemfire.RegionFactoryBean
* @see PeerRegionFactoryBean
* @see org.springframework.data.gemfire.client.ClientRegionFactoryBean
* @see org.springframework.data.gemfire.config.annotation.RegionConfigurer
* @see org.springframework.data.gemfire.test.GemfireTestBeanPostProcessor
@@ -187,7 +187,7 @@ public class RegionConfigurerIntegrationTests {
private final Set<String> beanNames = new HashSet<>();
@Override
public void configure(String beanName, RegionFactoryBean<?, ?> bean) {
public void configure(String beanName, PeerRegionFactoryBean<?, ?> bean) {
this.beanNames.add(beanName);
}

View File

@@ -33,7 +33,7 @@ import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
import org.springframework.data.gemfire.test.mock.context.GemFireMockObjectsApplicationContextInitializer;
import org.springframework.lang.Nullable;
import org.springframework.test.context.ContextConfiguration;
@@ -133,7 +133,7 @@ public class LuceneIndexRegionBeanFactoryPostProcessorIntegrationTests {
}
private boolean isRegionBean(Object bean) {
return bean instanceof Region || bean instanceof RegionFactoryBean;
return bean instanceof Region || bean instanceof PeerRegionFactoryBean;
}
}
}

View File

@@ -27,7 +27,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
import org.springframework.data.gemfire.TestUtils;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -51,7 +51,7 @@ public class CacheSubscriptionTest{
public void testReplicatedRegionSubscriptionAllPolicy() throws Exception {
assertTrue(context.containsBean("replicALL"));
RegionFactoryBean regionFactoryBean = context.getBean("&replicALL", RegionFactoryBean.class);
PeerRegionFactoryBean regionFactoryBean = context.getBean("&replicALL", PeerRegionFactoryBean.class);
RegionAttributes regionAttributes = TestUtils.readField("attributes", regionFactoryBean);
assertNotNull(regionAttributes);
@@ -66,7 +66,7 @@ public class CacheSubscriptionTest{
public void testPartitionRegionSubscriptionCacheContentPolicy() throws Exception {
assertTrue(context.containsBean("partCACHE_CONTENT"));
RegionFactoryBean regionFactoryBean = context.getBean("&partCACHE_CONTENT", RegionFactoryBean.class);
PeerRegionFactoryBean regionFactoryBean = context.getBean("&partCACHE_CONTENT", PeerRegionFactoryBean.class);
RegionAttributes regionAttributes = TestUtils.readField("attributes", regionFactoryBean);
assertNotNull(regionAttributes);
@@ -81,7 +81,7 @@ public class CacheSubscriptionTest{
public void testPartitionRegionSubscriptionDefaultPolicy() throws Exception {
assertTrue(context.containsBean("partDEFAULT"));
RegionFactoryBean regionFactoryBean = context.getBean("&partDEFAULT", RegionFactoryBean.class);
PeerRegionFactoryBean regionFactoryBean = context.getBean("&partDEFAULT", PeerRegionFactoryBean.class);
RegionAttributes regionAttributes = TestUtils.readField("attributes", regionFactoryBean);
assertNotNull(regionAttributes);

View File

@@ -49,7 +49,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.ApplicationContext;
import org.springframework.data.gemfire.PartitionedRegionFactoryBean;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
import org.springframework.data.gemfire.ReplicatedRegionFactoryBean;
import org.springframework.data.gemfire.SimpleObjectSizer;
import org.springframework.data.gemfire.TestUtils;
@@ -119,7 +119,7 @@ public class DiskStoreAndEvictionRegionParsingTest {
assertTrue(applicationContext.containsBean("replicated-data"));
RegionFactoryBean replicatedDataRegionFactoryBean = applicationContext.getBean("&replicated-data", RegionFactoryBean.class);
PeerRegionFactoryBean replicatedDataRegionFactoryBean = applicationContext.getBean("&replicated-data", PeerRegionFactoryBean.class);
assertTrue(replicatedDataRegionFactoryBean instanceof ReplicatedRegionFactoryBean);
assertEquals(DataPolicy.REPLICATE, replicatedDataRegionFactoryBean.getDataPolicy());
@@ -148,7 +148,7 @@ public class DiskStoreAndEvictionRegionParsingTest {
public void testPartitionDataOptions() throws Exception {
assertTrue(applicationContext.containsBean("partition-data"));
RegionFactoryBean fb = applicationContext.getBean("&partition-data", RegionFactoryBean.class);
PeerRegionFactoryBean fb = applicationContext.getBean("&partition-data", PeerRegionFactoryBean.class);
assertTrue(fb instanceof PartitionedRegionFactoryBean);
assertTrue((Boolean) TestUtils.readField("persistent", fb));
RegionAttributes attrs = TestUtils.readField("attributes", fb);
@@ -169,7 +169,7 @@ public class DiskStoreAndEvictionRegionParsingTest {
assertTrue(applicationContext.containsBean("replicated-data"));
RegionFactoryBean fb = applicationContext.getBean("&replicated-data", RegionFactoryBean.class);
PeerRegionFactoryBean fb = applicationContext.getBean("&replicated-data", PeerRegionFactoryBean.class);
RegionAttributes attrs = TestUtils.readField("attributes", fb);
ExpirationAttributes entryTTL = attrs.getEntryTimeToLive();
@@ -196,7 +196,7 @@ public class DiskStoreAndEvictionRegionParsingTest {
assertTrue(applicationContext.containsBean("replicated-data-custom-expiry"));
RegionFactoryBean fb = applicationContext.getBean("&replicated-data-custom-expiry", RegionFactoryBean.class);
PeerRegionFactoryBean fb = applicationContext.getBean("&replicated-data-custom-expiry", PeerRegionFactoryBean.class);
RegionAttributes attrs = TestUtils.readField("attributes", fb);
assertNotNull(attrs.getCustomEntryIdleTimeout());

View File

@@ -42,7 +42,7 @@ import org.junit.AfterClass;
import org.junit.Test;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.data.gemfire.RecreatingSpringApplicationContextTest;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
import org.springframework.data.gemfire.TestUtils;
import org.springframework.data.gemfire.test.GemfireTestBeanPostProcessor;
import org.springframework.data.gemfire.wan.GatewaySenderFactoryBean;
@@ -144,7 +144,7 @@ public class GemfireV7GatewayNamespaceTest extends RecreatingSpringApplicationCo
assertNotNull(region.getAttributes().getGatewaySenderIds());
assertEquals(2, region.getAttributes().getGatewaySenderIds().size());
RegionFactoryBean regionFactoryBean = applicationContext.getBean("&region-inner-gateway-sender", RegionFactoryBean.class);
PeerRegionFactoryBean regionFactoryBean = applicationContext.getBean("&region-inner-gateway-sender", PeerRegionFactoryBean.class);
Object[] gatewaySenders = TestUtils.readField("gatewaySenders", regionFactoryBean);

View File

@@ -22,7 +22,7 @@ import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
/**
* The InvalidRegionDefinitionUsingBeansNamespaceTest class is a test suite of test cases testing the definition of
@@ -32,7 +32,7 @@ import org.springframework.data.gemfire.RegionFactoryBean;
*
* @author John Blum
* @see org.junit.Test
* @see org.springframework.data.gemfire.RegionFactoryBean
* @see PeerRegionFactoryBean
* @since 1.6.0
*/
public class InvalidRegionDefinitionUsingBeansNamespaceTest {
@@ -57,6 +57,6 @@ public class InvalidRegionDefinitionUsingBeansNamespaceTest {
}
@SuppressWarnings("unused")
public static final class TestRegionFactoryBean<K, V> extends RegionFactoryBean<K, V> { }
public static final class TestRegionFactoryBean<K, V> extends PeerRegionFactoryBean<K, V> { }
}

View File

@@ -34,8 +34,8 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.RegionLookupFactoryBean;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
import org.springframework.data.gemfire.ResolvableRegionFactoryBean;
import org.springframework.data.gemfire.SimpleCacheListener;
import org.springframework.data.gemfire.TestUtils;
import org.springframework.data.gemfire.test.mock.context.GemFireMockObjectsApplicationContextInitializer;
@@ -80,7 +80,7 @@ public class LocalRegionNamespaceTest {
assertTrue(applicationContext.containsBean("pub"));
RegionFactoryBean publisherRegionFactoryBean = applicationContext.getBean("&pub", RegionFactoryBean.class);
PeerRegionFactoryBean publisherRegionFactoryBean = applicationContext.getBean("&pub", PeerRegionFactoryBean.class);
assertNotNull(publisherRegionFactoryBean);
assertEquals(DataPolicy.NORMAL, TestUtils.readField("dataPolicy", publisherRegionFactoryBean));
@@ -99,7 +99,7 @@ public class LocalRegionNamespaceTest {
assertTrue(applicationContext.containsBean("complex"));
RegionFactoryBean complexRegionFactoryBean = applicationContext.getBean("&complex", RegionFactoryBean.class);
PeerRegionFactoryBean complexRegionFactoryBean = applicationContext.getBean("&complex", PeerRegionFactoryBean.class);
assertNotNull(complexRegionFactoryBean);
@@ -149,7 +149,7 @@ public class LocalRegionNamespaceTest {
assertTrue(applicationContext.containsBean("lookup"));
RegionLookupFactoryBean localRegionFactoryBean = applicationContext.getBean("&lookup", RegionLookupFactoryBean.class);
ResolvableRegionFactoryBean localRegionFactoryBean = applicationContext.getBean("&lookup", ResolvableRegionFactoryBean.class);
assertEquals("existing", TestUtils.readField("name", localRegionFactoryBean));
assertSame(existing, applicationContext.getBean("lookup"));

View File

@@ -41,7 +41,7 @@ import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.data.gemfire.PartitionedRegionFactoryBean;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
import org.springframework.data.gemfire.SimpleCacheListener;
import org.springframework.data.gemfire.SimplePartitionResolver;
import org.springframework.data.gemfire.TestUtils;
@@ -96,7 +96,7 @@ public class PartitionedRegionNamespaceTest {
assertThat(options.getName()).isEqualTo("redundant");
assertThat(options.getAttributes().getOffHeap()).isTrue();
RegionFactoryBean optionsRegionFactoryBean = applicationContext.getBean("&options", RegionFactoryBean.class);
PeerRegionFactoryBean optionsRegionFactoryBean = applicationContext.getBean("&options", PeerRegionFactoryBean.class);
assertTrue(optionsRegionFactoryBean instanceof PartitionedRegionFactoryBean);
assertNull(TestUtils.readField("scope", optionsRegionFactoryBean));
@@ -123,7 +123,7 @@ public class PartitionedRegionNamespaceTest {
assertTrue(applicationContext.containsBean("complex"));
RegionFactoryBean complexRegionFactoryBean = applicationContext.getBean("&complex", RegionFactoryBean.class);
PeerRegionFactoryBean complexRegionFactoryBean = applicationContext.getBean("&complex", PeerRegionFactoryBean.class);
CacheListener[] cacheListeners = TestUtils.readField("cacheListeners", complexRegionFactoryBean);
@@ -168,7 +168,7 @@ public class PartitionedRegionNamespaceTest {
@SuppressWarnings("rawtypes")
public void testFixedPartitionRegion() throws Exception {
RegionFactoryBean fixedRegionFactoryBean = applicationContext.getBean("&fixed", RegionFactoryBean.class);
PeerRegionFactoryBean fixedRegionFactoryBean = applicationContext.getBean("&fixed", PeerRegionFactoryBean.class);
assertNotNull(fixedRegionFactoryBean);

View File

@@ -30,7 +30,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
import org.springframework.data.gemfire.TestUtils;
import org.springframework.data.gemfire.test.GemfireTestApplicationContextInitializer;
import org.springframework.test.context.ContextConfiguration;
@@ -45,7 +45,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
* @see org.junit.Test
* @see org.springframework.data.gemfire.PartitionAttributesFactoryBean
* @see org.springframework.data.gemfire.RegionAttributesFactoryBean
* @see org.springframework.data.gemfire.RegionFactoryBean
* @see PeerRegionFactoryBean
* @see org.springframework.data.gemfire.test.GemfireTestApplicationContextInitializer
* @see org.springframework.test.context.ContextConfiguration
* @see org.springframework.test.context.junit4.SpringJUnit4ClassRunner
@@ -82,8 +82,8 @@ public class RegionDefinitionUsingBeansNamespaceTest {
@Test
public void testAnotherExampleRegionFactoryBeanConfiguration() throws Exception {
RegionFactoryBean<?, ?> anotherExampleRegionFactoryBean = context.getBean("&AnotherExample",
RegionFactoryBean.class);
PeerRegionFactoryBean<?, ?> anotherExampleRegionFactoryBean = context.getBean("&AnotherExample",
PeerRegionFactoryBean.class);
assertNotNull(anotherExampleRegionFactoryBean);
assertEquals(DataPolicy.PERSISTENT_PARTITION, anotherExampleRegionFactoryBean.getDataPolicy());
@@ -112,7 +112,7 @@ public class RegionDefinitionUsingBeansNamespaceTest {
assertEquals(2, anotherExample.getAttributes().getPartitionAttributes().getRedundantCopies());
}
public static final class TestRegionFactoryBean<K, V> extends RegionFactoryBean<K, V> {
public static final class TestRegionFactoryBean<K, V> extends PeerRegionFactoryBean<K, V> {
}
}

View File

@@ -35,8 +35,8 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.RegionLookupFactoryBean;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
import org.springframework.data.gemfire.ResolvableRegionFactoryBean;
import org.springframework.data.gemfire.ReplicatedRegionFactoryBean;
import org.springframework.data.gemfire.SimpleCacheListener;
import org.springframework.data.gemfire.TestUtils;
@@ -68,8 +68,8 @@ public class ReplicatedRegionNamespaceTest {
assertTrue(applicationContext.containsBean("simple"));
RegionFactoryBean simpleRegionFactoryBean =
applicationContext.getBean("&simple", RegionFactoryBean.class);
PeerRegionFactoryBean simpleRegionFactoryBean =
applicationContext.getBean("&simple", PeerRegionFactoryBean.class);
assertEquals("simple", TestUtils.readField("beanName", simpleRegionFactoryBean));
assertEquals(false, TestUtils.readField("close", simpleRegionFactoryBean));
@@ -89,8 +89,8 @@ public class ReplicatedRegionNamespaceTest {
assertTrue(applicationContext.containsBean("pub"));
RegionFactoryBean publisherRegionFactoryBean =
applicationContext.getBean("&pub", RegionFactoryBean.class);
PeerRegionFactoryBean publisherRegionFactoryBean =
applicationContext.getBean("&pub", PeerRegionFactoryBean.class);
assertTrue(publisherRegionFactoryBean instanceof ReplicatedRegionFactoryBean);
assertEquals("publisher", TestUtils.readField("name", publisherRegionFactoryBean));
@@ -108,8 +108,8 @@ public class ReplicatedRegionNamespaceTest {
assertTrue(applicationContext.containsBean("complex"));
RegionFactoryBean complexRegionFactoryBean =
applicationContext.getBean("&complex", RegionFactoryBean.class);
PeerRegionFactoryBean complexRegionFactoryBean =
applicationContext.getBean("&complex", PeerRegionFactoryBean.class);
assertNotNull(complexRegionFactoryBean);
assertEquals("complex", TestUtils.readField("beanName", complexRegionFactoryBean));
@@ -181,11 +181,11 @@ public class ReplicatedRegionNamespaceTest {
assertTrue(applicationContext.containsBean("lookup"));
RegionLookupFactoryBean regionLookupFactoryBean =
applicationContext.getBean("&lookup", RegionLookupFactoryBean.class);
ResolvableRegionFactoryBean regionFactoryBean =
applicationContext.getBean("&lookup", ResolvableRegionFactoryBean.class);
assertNotNull(regionLookupFactoryBean);
assertEquals("existing", TestUtils.readField("name", regionLookupFactoryBean));
assertNotNull(regionFactoryBean);
assertEquals("existing", TestUtils.readField("name", regionFactoryBean));
assertSame(existing, applicationContext.getBean("lookup"));
}

View File

@@ -26,7 +26,7 @@ import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
import org.springframework.data.gemfire.test.StubCache;
/**
@@ -81,12 +81,12 @@ public abstract class AbstractRegionFactoryBeanTests {
public Exception exception;
@SuppressWarnings("rawtypes")
public final RegionFactoryBean regionFactoryBean;
public final PeerRegionFactoryBean regionFactoryBean;
public final String regionName;
@SuppressWarnings("rawtypes")
public RegionFactoryBeanConfig(RegionFactoryBean regionFactoryBean, String regionName) {
public RegionFactoryBeanConfig(PeerRegionFactoryBean regionFactoryBean, String regionName) {
this.regionFactoryBean = regionFactoryBean;
this.regionName = regionName;
regionFactoryBean.setBeanName(regionName);

View File

@@ -17,7 +17,7 @@
<gfe:cache properties-ref="gemfireProperties"/>
<bean id="replicate-persistent-region" class="org.springframework.data.gemfire.RegionFactoryBeanTest$TestRegionFactoryBean">
<bean id="replicate-persistent-region" class="org.springframework.data.gemfire.PeerRegionFactoryBeanTest$TestRegionFactoryBean">
<property name="cache" ref="gemfireCache"/>
<property name="dataPolicy" value="REPLICATE_PERSISTENT"/>
</bean>