SGF-589 - Reorganize and repackage Spring Data Geode API classes by functional concern.

This commit is contained in:
John Blum
2017-01-21 15:58:46 -08:00
parent 5472159198
commit e080b1bef2
62 changed files with 249 additions and 522 deletions

View File

@@ -18,7 +18,6 @@ package org.springframework.data.gemfire;
import org.apache.geode.cache.DataPolicy;
import org.apache.geode.cache.RegionFactory;
import org.apache.geode.cache.Scope;
import org.springframework.data.gemfire.support.RegionShortcutWrapper;
import org.springframework.util.Assert;
/**

View File

@@ -43,7 +43,6 @@ import org.springframework.beans.factory.DisposableBean;
import org.springframework.context.SmartLifecycle;
import org.springframework.core.io.Resource;
import org.springframework.data.gemfire.client.ClientRegionFactoryBean;
import org.springframework.data.gemfire.support.RegionShortcutWrapper;
import org.springframework.data.gemfire.util.ArrayUtils;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;

View File

@@ -1,20 +1,21 @@
/*
* Copyright 2010-2013 the original author or authors.
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.springframework.data.gemfire.support;
package org.springframework.data.gemfire;
import org.apache.geode.cache.DataPolicy;
import org.apache.geode.cache.RegionShortcut;

View File

@@ -1,175 +0,0 @@
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.gemfire;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.geode.cache.CacheListener;
import org.apache.geode.cache.Region;
import org.apache.geode.cache.asyncqueue.AsyncEventQueue;
import org.apache.geode.cache.wan.GatewaySender;
import org.springframework.beans.factory.BeanInitializationException;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
/**
* FactoryBean for creating a Gemfire sub-Regions.
*
* @author David Turanski
* @author John Blum
* @param <K> Region Key Type
* @param <V> Region Value Type
* @deprecated as Spring Data GemFire 1.4.0. Use Region type specific FactoryBeans
* (e.g. ReplicatedRegionFactoryBean) instead.
*/
@Deprecated
@SuppressWarnings({"deprecation", "unused"})
public class SubRegionFactoryBean<K, V> extends org.apache.geode.cache.AttributesFactory<K, V>
implements FactoryBean<Region<K, V>>, InitializingBean {
protected final Log log = LogFactory.getLog(getClass());
private boolean lookupOnly;
private CacheListener<K, V>[] cacheListeners;
private Object[] asyncEventQueues;
private Object[] gatewaySenders;
private Region<?, ?> parentRegion;
private Region<K, V> subRegion;
private String name;
private String regionName;
@Override
public Region<K, V> getObject() throws Exception {
return this.subRegion;
}
@Override
public Class<?> getObjectType() {
// TODO perhaps this should be 'return (subRegion != null ? subRegion.getClass() : Region.class);' for consistency.
return Region.class;
}
@Override
public boolean isSingleton() {
return true;
}
@Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(parentRegion, "The parent Region cannot be null.");
this.subRegion = parentRegion.getSubregion(regionName);
if (this.subRegion == null) {
if (lookupOnly) {
throw new BeanInitializationException(String.format("Cannot find Region [%1$s] in Cache %2$s",
regionName, parentRegion.getRegionService()));
}
else {
log.debug(String.format("Creating sub-Region of [%1$s] with name [%2$s]...",
(parentRegion.getFullPath() != null ? parentRegion.getFullPath() : parentRegion.getName()),
regionName));
if (!ObjectUtils.isEmpty(asyncEventQueues)) {
for (Object asyncEventQueue : asyncEventQueues) {
addAsyncEventQueueId(((AsyncEventQueue) asyncEventQueue).getId());
}
}
if (!ObjectUtils.isEmpty(cacheListeners)) {
for (CacheListener<K, V> listener : cacheListeners) {
addCacheListener(listener);
}
}
if (!ObjectUtils.isEmpty(gatewaySenders)) {
for (Object gatewaySender : gatewaySenders) {
addGatewaySenderId(((GatewaySender) gatewaySender).getId());
}
}
this.subRegion = this.parentRegion.createSubregion(regionName, create());
}
}
}
/**
*
* @param asyncEventQueues defined as Object for backward compatibility with Gemfire 6.
*/
public void setAsyncEventQueues(Object[] asyncEventQueues) {
this.asyncEventQueues = asyncEventQueues;
}
/**
* Sets the cache listeners used for the region used by this factory. Used
* only when a new region is created. Overrides the settings specified
* through setAttributes(org.apache.geode.cache.RegionAttributes).
*
* @param cacheListeners the cacheListeners to set on a newly created region
*/
public void setCacheListeners(CacheListener<K, V>[] cacheListeners) {
this.cacheListeners = cacheListeners;
}
public void setGatewaySenders(Object[] gatewaySenders) {
this.gatewaySenders = gatewaySenders;
}
/**
* Set to true if the subregion should already exist, e.g., specified by
* &lt;lookup-region&gt;
*
* @param lookupOnly a boolean value indicating whether this Subregion should be looked up instead of created.
*/
public void setLookupOnly(boolean lookupOnly) {
this.lookupOnly = lookupOnly;
}
/**
* Set the bean name - the same as the Subregion full path.
*
* @param name the name of this Subregion bean in the Spring context.
*/
public void setName(String name) {
this.name = name;
}
/**
* Set the simple name of this Subregion.
*
* @param regionName the simple name of this Subregion.
*/
public void setRegionName(String regionName) {
this.regionName = regionName;
}
/**
* Set the parent Region.
*
* @param parent a reference to the parent Region.
*/
public void setParent(Region<?, ?> parent) {
this.parentRegion = parent;
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2014 the original author or authors.
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,9 +12,10 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.springframework.data.gemfire.support;
package org.springframework.data.gemfire.cache;
import java.util.concurrent.Callable;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 the original author or authors.
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,9 +12,10 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.springframework.data.gemfire.support;
package org.springframework.data.gemfire.cache;
import java.util.Collection;
import java.util.HashSet;
@@ -140,7 +141,7 @@ public class GemfireCacheManager extends AbstractCacheManager {
*
* @param region GemFire {@link Region} to wrap (adapt).
* @return an instance of {@link GemfireCache} initialized with the given GemFire {@link Region}.
* @see org.springframework.data.gemfire.support.GemfireCache
* @see GemfireCache
* @see org.apache.geode.cache.Region
*/
protected GemfireCache newGemfireCache(Region<?, ?> region) {

View File

@@ -1,20 +1,21 @@
/*
* Copyright 2010-2013 the original author or authors.
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.springframework.data.gemfire;
package org.springframework.data.gemfire.client;
import org.apache.geode.cache.client.ClientRegionShortcut;
import org.springframework.core.convert.converter.Converter;

View File

@@ -1,20 +1,21 @@
/*
* Copyright 2010-2013 the original author or authors.
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.springframework.data.gemfire.support;
package org.springframework.data.gemfire.client;
import org.apache.geode.cache.DataPolicy;
import org.apache.geode.cache.client.ClientRegionShortcut;

View File

@@ -28,8 +28,8 @@ import org.apache.geode.management.internal.cli.functions.GetRegionsFunction;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.data.gemfire.function.execution.GemfireOnServersFunctionTemplate;
import org.springframework.data.gemfire.client.function.ListRegionsOnServerFunction;
import org.springframework.data.gemfire.function.execution.GemfireOnServersFunctionTemplate;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;

View File

@@ -28,8 +28,8 @@ import org.apache.geode.cache.EvictionAttributes;
import org.apache.geode.cache.Region;
import org.apache.geode.cache.util.ObjectSizer;
import org.springframework.context.annotation.Import;
import org.springframework.data.gemfire.EvictionActionType;
import org.springframework.data.gemfire.EvictionPolicyType;
import org.springframework.data.gemfire.eviction.EvictionActionType;
import org.springframework.data.gemfire.eviction.EvictionPolicyType;
/**
* The {@link EnableEviction} annotation marks a Spring {@link org.springframework.context.annotation.Configuration @Configuration}
@@ -73,7 +73,7 @@ public @interface EnableEviction {
*
* Defaults to {@link EvictionActionType#LOCAL_DESTROY}.
*
* @see org.springframework.data.gemfire.EvictionActionType
* @see EvictionActionType
*/
EvictionActionType action() default EvictionActionType.LOCAL_DESTROY;
@@ -106,7 +106,7 @@ public @interface EnableEviction {
*
* Defaults to {@link EvictionPolicyType#ENTRY_COUNT}.
*
* @see org.springframework.data.gemfire.EvictionPolicyType
* @see EvictionPolicyType
*/
EvictionPolicyType type() default EvictionPolicyType.ENTRY_COUNT;

View File

@@ -28,10 +28,10 @@ import java.lang.annotation.Target;
import org.apache.geode.cache.Region;
import org.springframework.context.annotation.Import;
import org.springframework.data.gemfire.ExpirationActionType;
import org.springframework.data.gemfire.support.Expiration;
import org.springframework.data.gemfire.support.IdleTimeoutExpiration;
import org.springframework.data.gemfire.support.TimeToLiveExpiration;
import org.springframework.data.gemfire.expiration.Expiration;
import org.springframework.data.gemfire.expiration.ExpirationActionType;
import org.springframework.data.gemfire.expiration.IdleTimeoutExpiration;
import org.springframework.data.gemfire.expiration.TimeToLiveExpiration;
/**
* The {@link EnableExpiration} annotation marks a Spring {@link org.springframework.context.annotation.Configuration @Configuration}
@@ -41,9 +41,9 @@ import org.springframework.data.gemfire.support.TimeToLiveExpiration;
* @author John Blum
* @see org.springframework.context.annotation.Import
* @see org.springframework.data.gemfire.config.annotation.ExpirationConfiguration
* @see org.springframework.data.gemfire.support.Expiration
* @see org.springframework.data.gemfire.support.IdleTimeoutExpiration
* @see org.springframework.data.gemfire.support.TimeToLiveExpiration
* @see Expiration
* @see IdleTimeoutExpiration
* @see TimeToLiveExpiration
* @see org.apache.geode.cache.Region
* @see <a href="http://docs.spring.io/spring-data-gemfire/docs/current/reference/html/#bootstrap:region:expiration:annotation">Annotation-based Data Expiration</a>
* @see <a href="http://gemfire.docs.pivotal.io/docs-gemfire/latest/developing/expiration/chapter_overview.html">GemFire Expiration</a>

View File

@@ -38,12 +38,12 @@ 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.EvictionActionType;
import org.springframework.data.gemfire.EvictionAttributesFactoryBean;
import org.springframework.data.gemfire.EvictionPolicyType;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.RegionLookupFactoryBean;
import org.springframework.data.gemfire.client.ClientRegionFactoryBean;
import org.springframework.data.gemfire.eviction.EvictionActionType;
import org.springframework.data.gemfire.eviction.EvictionAttributesFactoryBean;
import org.springframework.data.gemfire.eviction.EvictionPolicyType;
import org.springframework.data.gemfire.util.ArrayUtils;
import org.springframework.data.gemfire.util.CollectionUtils;
import org.springframework.util.Assert;
@@ -60,9 +60,9 @@ 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.EvictionActionType
* @see org.springframework.data.gemfire.EvictionAttributesFactoryBean
* @see org.springframework.data.gemfire.EvictionPolicyType
* @see EvictionActionType
* @see EvictionAttributesFactoryBean
* @see EvictionPolicyType
* @see org.springframework.data.gemfire.RegionFactoryBean
* @see org.springframework.data.gemfire.client.ClientRegionFactoryBean
* @see org.apache.geode.cache.EvictionAttributes
@@ -345,7 +345,7 @@ public class EvictionConfiguration implements ApplicationContextAware, ImportAwa
* @param maximum integer value specifying the configured Eviction threshold.
* @param type {@link EvictionPolicyType} specifying the type of Eviction algorithm.
* @return a resolved value for the Eviction maximum/threshold.
* @see org.springframework.data.gemfire.EvictionPolicyType
* @see EvictionPolicyType
*/
protected static Integer resolveThreshold(int maximum, EvictionPolicyType type) {
return (EvictionPolicyType.HEAP_PERCENTAGE.equals(type) ? null : maximum);

View File

@@ -37,8 +37,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.ExpirationActionType;
import org.springframework.data.gemfire.support.AnnotationBasedExpiration;
import org.springframework.data.gemfire.expiration.AnnotationBasedExpiration;
import org.springframework.data.gemfire.expiration.ExpirationActionType;
import org.springframework.data.gemfire.util.ArrayUtils;
import org.springframework.data.gemfire.util.CollectionUtils;
import org.springframework.data.gemfire.util.SpringUtils;
@@ -370,7 +370,7 @@ public class ExpirationConfiguration implements ImportAware {
* meta-data.
* @throws IllegalArgumentException if the {@link ExpirationType} array is empty.
* @see org.springframework.data.gemfire.config.annotation.EnableExpiration.ExpirationType
* @see org.springframework.data.gemfire.ExpirationActionType
* @see ExpirationActionType
* @see #ExpirationPolicyMetaData(ExpirationAttributes, Set, Set)
* @see #newExpirationAttributes(int, ExpirationActionType)
*/
@@ -388,7 +388,7 @@ public class ExpirationConfiguration implements ImportAware {
*
* @param action given {@link ExpirationActionType} to evaluate.
* @return the resolved {@link ExpirationActionType} or the default if {@code action} is {@literal null}.
* @see org.springframework.data.gemfire.ExpirationActionType
* @see ExpirationActionType
*/
protected static ExpirationActionType resolveAction(ExpirationActionType action) {
return SpringUtils.defaultIfNull(action, DEFAULT_ACTION);
@@ -415,7 +415,7 @@ public class ExpirationConfiguration implements ImportAware {
* @param types type of expiration algorithm/behavior (TTI/TTL) configured for the {@link Region}.
* @throws IllegalArgumentException if the {@link ExpirationType} {@link Set} is empty.
* @see org.springframework.data.gemfire.config.annotation.EnableExpiration.ExpirationType
* @see org.springframework.data.gemfire.ExpirationActionType
* @see ExpirationActionType
* @see #ExpirationPolicyMetaData(ExpirationAttributes, Set, Set)
* @see #newExpirationAttributes(int, ExpirationActionType)
* @see #resolveAction(ExpirationActionType)

View File

@@ -28,10 +28,6 @@ import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.core.convert.converter.Converter;
import org.springframework.data.gemfire.EvictionActionConverter;
import org.springframework.data.gemfire.EvictionPolicyConverter;
import org.springframework.data.gemfire.EvictionPolicyType;
import org.springframework.data.gemfire.ExpirationActionConverter;
import org.springframework.data.gemfire.IndexMaintenancePolicyConverter;
import org.springframework.data.gemfire.IndexMaintenancePolicyType;
import org.springframework.data.gemfire.IndexType;
@@ -39,6 +35,10 @@ import org.springframework.data.gemfire.IndexTypeConverter;
import org.springframework.data.gemfire.InterestPolicyConverter;
import org.springframework.data.gemfire.ScopeConverter;
import org.springframework.data.gemfire.client.InterestResultPolicyConverter;
import org.springframework.data.gemfire.eviction.EvictionActionConverter;
import org.springframework.data.gemfire.eviction.EvictionPolicyConverter;
import org.springframework.data.gemfire.eviction.EvictionPolicyType;
import org.springframework.data.gemfire.expiration.ExpirationActionConverter;
import org.springframework.data.gemfire.server.SubscriptionEvictionPolicy;
import org.springframework.data.gemfire.server.SubscriptionEvictionPolicyConverter;
import org.springframework.data.gemfire.support.AbstractPropertyEditorConverterSupport;

View File

@@ -23,10 +23,8 @@ import org.springframework.beans.factory.support.ManagedList;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.data.gemfire.RegionAttributesFactoryBean;
import org.springframework.data.gemfire.client.ClientRegionFactoryBean;
import org.springframework.data.gemfire.client.Interest;
import org.springframework.data.gemfire.client.KeyInterest;
import org.springframework.data.gemfire.client.RegexInterest;
import org.springframework.data.repository.query.QueryLookupStrategy;
import org.springframework.util.StringUtils;
import org.springframework.util.xml.DomUtils;
import org.w3c.dom.Element;

View File

@@ -21,7 +21,7 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.data.gemfire.FunctionServiceFactoryBean;
import org.springframework.data.gemfire.function.FunctionServiceFactoryBean;
import org.springframework.data.gemfire.util.SpringUtils;
import org.springframework.util.xml.DomUtils;
import org.w3c.dom.Element;
@@ -32,7 +32,7 @@ import org.w3c.dom.Element;
* @author David Turanski
* @author John Blum
* @see org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser
* @see org.springframework.data.gemfire.FunctionServiceFactoryBean
* @see FunctionServiceFactoryBean
*/
class FunctionServiceParser extends AbstractSimpleBeanDefinitionParser {

View File

@@ -28,11 +28,11 @@ import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.ManagedList;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.core.Conventions;
import org.springframework.data.gemfire.EvictionAttributesFactoryBean;
import org.springframework.data.gemfire.ExpirationAttributesFactoryBean;
import org.springframework.data.gemfire.GemfireUtils;
import org.springframework.data.gemfire.SubscriptionAttributesFactoryBean;
import org.springframework.data.gemfire.config.support.GemfireFeature;
import org.springframework.data.gemfire.eviction.EvictionAttributesFactoryBean;
import org.springframework.data.gemfire.expiration.ExpirationAttributesFactoryBean;
import org.springframework.data.gemfire.util.SpringUtils;
import org.springframework.util.StringUtils;
import org.springframework.util.xml.DomUtils;

View File

@@ -1,20 +1,21 @@
/*
* Copyright 2010-2013 the original author or authors.
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.springframework.data.gemfire;
package org.springframework.data.gemfire.eviction;
import org.apache.geode.cache.EvictionAction;
import org.springframework.data.gemfire.support.AbstractPropertyEditorConverterSupport;
@@ -24,7 +25,7 @@ import org.springframework.data.gemfire.support.AbstractPropertyEditorConverterS
* an Object value into an instance of GemFire EvictionAction.
*
* @author John Blum
* @see org.springframework.data.gemfire.EvictionActionType
* @see EvictionActionType
* @see org.springframework.data.gemfire.support.AbstractPropertyEditorConverterSupport
* @see org.apache.geode.cache.EvictionAction
* @since 1.6.0

View File

@@ -1,20 +1,21 @@
/*
* Copyright 2010-2013 the original author or authors.
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.springframework.data.gemfire;
package org.springframework.data.gemfire.eviction;
import org.apache.geode.cache.EvictionAction;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 the original author or authors.
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,9 +12,10 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.springframework.data.gemfire;
package org.springframework.data.gemfire.eviction;
import org.apache.geode.cache.EvictionAction;
import org.apache.geode.cache.EvictionAttributes;

View File

@@ -1,20 +1,21 @@
/*
* Copyright 2010-2013 the original author or authors.
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.springframework.data.gemfire;
package org.springframework.data.gemfire.eviction;
import org.springframework.data.gemfire.support.AbstractPropertyEditorConverterSupport;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 the original author or authors.
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,9 +12,10 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.springframework.data.gemfire;
package org.springframework.data.gemfire.eviction;
import org.apache.geode.cache.EvictionAlgorithm;

View File

@@ -1,20 +1,21 @@
/*
* Copyright 2010-2013 the original author or authors.
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.springframework.data.gemfire.support;
package org.springframework.data.gemfire.expiration;
import java.lang.annotation.Annotation;
import java.util.concurrent.atomic.AtomicReference;
@@ -33,8 +34,6 @@ import org.springframework.context.expression.EnvironmentAccessor;
import org.springframework.context.expression.MapAccessor;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.core.convert.ConversionService;
import org.springframework.data.gemfire.ExpirationActionConverter;
import org.springframework.data.gemfire.ExpirationActionType;
import org.springframework.expression.EvaluationContext;
import org.springframework.expression.EvaluationException;
import org.springframework.expression.Expression;
@@ -56,10 +55,10 @@ import org.springframework.util.ObjectUtils;
* @see java.lang.annotation.Annotation
* @see org.springframework.beans.factory.BeanFactory
* @see org.springframework.beans.factory.BeanFactoryAware
* @see org.springframework.data.gemfire.ExpirationActionType
* @see org.springframework.data.gemfire.support.Expiration
* @see org.springframework.data.gemfire.support.IdleTimeoutExpiration
* @see org.springframework.data.gemfire.support.TimeToLiveExpiration
* @see ExpirationActionType
* @see Expiration
* @see IdleTimeoutExpiration
* @see TimeToLiveExpiration
* @see org.apache.geode.cache.CustomExpiry
* @see org.apache.geode.cache.ExpirationAction
* @see org.apache.geode.cache.ExpirationAttributes
@@ -105,8 +104,8 @@ public class AnnotationBasedExpiration<K, V> implements BeanFactoryAware, Custom
* @param <V> {@link Class} type of the {@link Region} entry value.
* @return an {@link AnnotationBasedExpiration} instance to process expired annotated {@link Region} entries
* using Idle Timeout expiration.
* @see org.springframework.data.gemfire.support.AnnotationBasedExpiration
* @see org.springframework.data.gemfire.support.IdleTimeoutExpiration
* @see AnnotationBasedExpiration
* @see IdleTimeoutExpiration
* @see #forIdleTimeout(org.apache.geode.cache.ExpirationAttributes)
*/
public static <K, V> AnnotationBasedExpiration<K, V> forIdleTimeout() {
@@ -124,8 +123,8 @@ public class AnnotationBasedExpiration<K, V> implements BeanFactoryAware, Custom
* was specified on the {@link Region}.
* @return an {@link AnnotationBasedExpiration} instance to process expired annotated {@link Region} entries
* using Idle Timeout expiration.
* @see org.springframework.data.gemfire.support.AnnotationBasedExpiration
* @see org.springframework.data.gemfire.support.IdleTimeoutExpiration
* @see AnnotationBasedExpiration
* @see IdleTimeoutExpiration
* @see #AnnotationBasedExpiration(ExpirationAttributes)
*/
public static <K, V> AnnotationBasedExpiration<K, V> forIdleTimeout(ExpirationAttributes defaultExpirationAttributes) {
@@ -146,8 +145,8 @@ public class AnnotationBasedExpiration<K, V> implements BeanFactoryAware, Custom
* @param <V> {@link Class} type of the {@link Region} entry value.
* @return an {@link AnnotationBasedExpiration} instance to process expired annotated {@link Region} entries
* using Time-To-Live expiration.
* @see org.springframework.data.gemfire.support.AnnotationBasedExpiration
* @see org.springframework.data.gemfire.support.TimeToLiveExpiration
* @see AnnotationBasedExpiration
* @see TimeToLiveExpiration
* @see #forTimeToLive(org.apache.geode.cache.ExpirationAttributes)
*/
public static <K, V> AnnotationBasedExpiration<K, V> forTimeToLive() {
@@ -165,8 +164,8 @@ public class AnnotationBasedExpiration<K, V> implements BeanFactoryAware, Custom
* was specified on the {@link Region}.
* @return an {@link AnnotationBasedExpiration} instance to process expired annotated {@link Region} entries
* using Time-To-Live expiration.
* @see org.springframework.data.gemfire.support.AnnotationBasedExpiration
* @see org.springframework.data.gemfire.support.TimeToLiveExpiration
* @see AnnotationBasedExpiration
* @see TimeToLiveExpiration
* @see #AnnotationBasedExpiration(ExpirationAttributes)
*/
public static <K, V> AnnotationBasedExpiration<K, V> forTimeToLive(ExpirationAttributes defaultExpirationAttributes) {
@@ -288,7 +287,7 @@ public class AnnotationBasedExpiration<K, V> implements BeanFactoryAware, Custom
* @param entry {@link Region} entry used as the source of the expiration policy meta-data.
* @return {@link ExpirationMetaData} extracted from the {@link Region} entry or {@literal null}
* if the expiration policy meta-data could not be determined from the {@link Region} entry.
* @see org.springframework.data.gemfire.support.AnnotationBasedExpiration.ExpirationMetaData
* @see AnnotationBasedExpiration.ExpirationMetaData
*/
protected ExpirationMetaData getExpirationMetaData(Region.Entry<K, V> entry) {
return (isExpirationConfigured(entry) ? ExpirationMetaData.from(getExpiration(entry)) : null);
@@ -304,7 +303,7 @@ public class AnnotationBasedExpiration<K, V> implements BeanFactoryAware, Custom
* @return custom {@link ExpirationAttributes} configured from the application domain object specific
* expiration policy or the default expiration settings if the application domain object has not been
* annotated with custom expiration meta-data.
* @see org.springframework.data.gemfire.support.AnnotationBasedExpiration.ExpirationMetaData
* @see AnnotationBasedExpiration.ExpirationMetaData
* @see org.apache.geode.cache.ExpirationAttributes
* @see #getDefaultExpirationAttributes()
*/
@@ -318,7 +317,7 @@ public class AnnotationBasedExpiration<K, V> implements BeanFactoryAware, Custom
*
* @param entry the Region.Entry to evaluate for the presence of the Expiration Annotation.
* @return a boolean value indicating whether the Region Entry has been annotated with @Expiration.
* @see org.springframework.data.gemfire.support.Expiration
* @see Expiration
* @see #isAnnotationPresent(Object, Class)
*/
protected boolean isExpirationConfigured(Region.Entry<K, V> entry) {
@@ -336,7 +335,7 @@ public class AnnotationBasedExpiration<K, V> implements BeanFactoryAware, Custom
* @param entry the Region.Entry from which to extract the Expiration Annotation meta-data.
* @return the Expiration Annotation meta-data for the given Region Entry or {@code null}
* if the Region Entry has not been annotated with @Expiration.
* @see org.springframework.data.gemfire.support.Expiration
* @see Expiration
* @see #getAnnotation(Object, Class)
*/
protected Expiration getExpiration(Region.Entry<K, V> entry) {
@@ -353,7 +352,7 @@ public class AnnotationBasedExpiration<K, V> implements BeanFactoryAware, Custom
*
* @param entry the Region.Entry to evaluate for the presence of the IdleTimeoutExpiration Annotation.
* @return a boolean value indicating whether the Region Entry has been annotated with @IdleTimeoutExpiration.
* @see org.springframework.data.gemfire.support.IdleTimeoutExpiration
* @see IdleTimeoutExpiration
* @see #isAnnotationPresent(Object, Class)
*/
protected boolean isIdleTimeoutConfigured(Region.Entry<K, V> entry) {
@@ -371,7 +370,7 @@ public class AnnotationBasedExpiration<K, V> implements BeanFactoryAware, Custom
* @param entry the Region.Entry from which to extract the IdleTimeoutExpiration Annotation meta-data.
* @return the IdleTimeoutExpiration Annotation meta-data for the given Region Entry or {@code null}
* if the Region Entry has not been annotated with @IdleTimeoutExpiration.
* @see org.springframework.data.gemfire.support.IdleTimeoutExpiration
* @see IdleTimeoutExpiration
* @see #getAnnotation(Object, Class)
*/
protected IdleTimeoutExpiration getIdleTimeout(Region.Entry<K, V> entry) {
@@ -388,7 +387,7 @@ public class AnnotationBasedExpiration<K, V> implements BeanFactoryAware, Custom
*
* @param entry the Region.Entry to evaluate for the presence of the TimeToLiveExpiration Annotation.
* @return a boolean value indicating whether the Region Entry has been annotated with @TimeToLiveExpiration.
* @see org.springframework.data.gemfire.support.TimeToLiveExpiration
* @see TimeToLiveExpiration
* @see #isAnnotationPresent(Object, Class)
*/
protected boolean isTimeToLiveConfigured(Region.Entry<K, V> entry) {
@@ -406,7 +405,7 @@ public class AnnotationBasedExpiration<K, V> implements BeanFactoryAware, Custom
* @param entry the Region.Entry from which to extract the TimeToLiveExpiration Annotation meta-data.
* @return the TimeToLiveExpiration Annotation meta-data for the given Region Entry or {@code null}
* if the Region Entry has not been annotated with @TimeToLiveExpiration.
* @see org.springframework.data.gemfire.support.TimeToLiveExpiration
* @see TimeToLiveExpiration
* @see #getAnnotation(Object, Class)
*/
protected TimeToLiveExpiration getTimeToLive(Region.Entry<K, V> entry) {

View File

@@ -1,20 +1,21 @@
/*
* Copyright 2010-2013 the original author or authors.
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.springframework.data.gemfire.support;
package org.springframework.data.gemfire.expiration;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
@@ -28,7 +29,7 @@ import java.lang.annotation.Target;
* to express their general expiration policy.
*
* @author John Blum
* @see org.springframework.data.gemfire.ExpirationActionType
* @see ExpirationActionType
* @since 1.7.0
*/
@Documented

View File

@@ -1,20 +1,21 @@
/*
* Copyright 2010-2013 the original author or authors.
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.springframework.data.gemfire;
package org.springframework.data.gemfire.expiration;
import org.apache.geode.cache.ExpirationAction;
import org.springframework.data.gemfire.support.AbstractPropertyEditorConverterSupport;
@@ -26,7 +27,7 @@ import org.springframework.data.gemfire.support.AbstractPropertyEditorConverterS
* @author John Blum
* @see java.beans.PropertyEditorSupport
* @see org.springframework.core.convert.converter.Converter
* @see org.springframework.data.gemfire.ExpirationActionType
* @see ExpirationActionType
* @since 1.6.0
*/
public class ExpirationActionConverter extends AbstractPropertyEditorConverterSupport<ExpirationAction> {
@@ -37,7 +38,7 @@ public class ExpirationActionConverter extends AbstractPropertyEditorConverterSu
* @param source the String to convert into an GemFire ExpirationAction.
* @return an GemFire ExpirationAction value for the given String.
* @throws java.lang.IllegalArgumentException if the String is not a valid GemFire ExpirationAction.
* @see org.springframework.data.gemfire.ExpirationActionType#valueOfIgnoreCase(String)
* @see ExpirationActionType#valueOfIgnoreCase(String)
* @see org.apache.geode.cache.ExpirationAction
*/
@Override

View File

@@ -1,20 +1,21 @@
/*
* Copyright 2010-2013 the original author or authors.
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.springframework.data.gemfire;
package org.springframework.data.gemfire.expiration;
import org.apache.geode.cache.ExpirationAction;

View File

@@ -1,20 +1,21 @@
/*
* Copyright 2010-2013 the original author or authors.
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.springframework.data.gemfire;
package org.springframework.data.gemfire.expiration;
import org.apache.geode.cache.ExpirationAction;
import org.apache.geode.cache.ExpirationAttributes;
@@ -78,7 +79,7 @@ public class ExpirationAttributesFactoryBean implements FactoryBean<ExpirationAt
* Gets the action to perform when a Region or an Entry expires.
*
* @return the type of action to perform on expiration.
* @see org.springframework.data.gemfire.ExpirationActionType
* @see ExpirationActionType
* @see org.apache.geode.cache.ExpirationAttributes#getAction()
*/
public ExpirationAction getAction() {
@@ -110,7 +111,7 @@ public class ExpirationAttributesFactoryBean implements FactoryBean<ExpirationAt
* @throws Exception if the construction of the ExpirationAttributes was not successful.
* @see #getAction()
* @see #getTimeout()
* @see org.springframework.data.gemfire.ExpirationActionType#getExpirationAction()
* @see ExpirationActionType#getExpirationAction()
* @see org.apache.geode.cache.ExpirationAttributes
*/
@Override

View File

@@ -1,20 +1,21 @@
/*
* Copyright 2010-2013 the original author or authors.
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.springframework.data.gemfire.support;
package org.springframework.data.gemfire.expiration;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
@@ -28,8 +29,8 @@ import java.lang.annotation.Target;
* to express their idle-timeout (TTI) expiration policy.
*
* @author John Blum
* @see org.springframework.data.gemfire.ExpirationActionType
* @see org.springframework.data.gemfire.support.Expiration
* @see ExpirationActionType
* @see Expiration
* @since 1.7.0
*/
@Documented

View File

@@ -1,20 +1,21 @@
/*
* Copyright 2010-2013 the original author or authors.
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.springframework.data.gemfire.support;
package org.springframework.data.gemfire.expiration;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
@@ -28,8 +29,8 @@ import java.lang.annotation.Target;
* to express their time-to-live (TTL) expiration policy.
*
* @author John Blum
* @see org.springframework.data.gemfire.ExpirationActionType
* @see org.springframework.data.gemfire.support.Expiration
* @see ExpirationActionType
* @see Expiration
* @since 1.7.0
*/
@Documented

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 the original author or authors.
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,8 +12,9 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.springframework.data.gemfire;
package org.springframework.data.gemfire.function;
import java.util.List;
@@ -71,5 +72,4 @@ public class FunctionServiceFactoryBean implements FactoryBean<FunctionService>,
public boolean isSingleton() {
return true;
}
}