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