diff --git a/spring-data-geode/src/main/java/org/springframework/data/gemfire/GemfireAccessor.java b/spring-data-geode/src/main/java/org/springframework/data/gemfire/GemfireAccessor.java index b05a5dda..fbc032b8 100644 --- a/spring-data-geode/src/main/java/org/springframework/data/gemfire/GemfireAccessor.java +++ b/spring-data-geode/src/main/java/org/springframework/data/gemfire/GemfireAccessor.java @@ -13,23 +13,22 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.springframework.data.gemfire; import org.apache.geode.GemFireCheckedException; import org.apache.geode.GemFireException; import org.apache.geode.cache.Region; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import org.springframework.beans.factory.InitializingBean; import org.springframework.dao.DataAccessException; import org.springframework.util.Assert; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + /** - * {@link GemfireAccessor} is a base class for {@link GemfireTemplate} defining common operations and properties, - * such as {@link Region}. + * {@link GemfireAccessor} is a base class for {@link GemfireTemplate} to encapsulate common operations and properties, + * such as accessors to a {@link Region}. * * This class is not intended to be used directly. * @@ -42,6 +41,7 @@ public class GemfireAccessor implements InitializingBean { protected final Logger logger = LoggerFactory.getLogger(getClass()); + @SuppressWarnings("rawtypes") private Region region; /** @@ -54,7 +54,7 @@ public class GemfireAccessor implements InitializingBean { */ @SuppressWarnings("unchecked") public Region getRegion() { - return region; + return this.region; } /** @@ -67,6 +67,9 @@ public class GemfireAccessor implements InitializingBean { this.region = region; } + /** + * @inheritDoc + */ public void afterPropertiesSet() { Assert.notNull(getRegion(), "Region is required"); } diff --git a/spring-data-geode/src/main/java/org/springframework/data/gemfire/GemfireCallback.java b/spring-data-geode/src/main/java/org/springframework/data/gemfire/GemfireCallback.java index 07028547..18378b5a 100644 --- a/spring-data-geode/src/main/java/org/springframework/data/gemfire/GemfireCallback.java +++ b/spring-data-geode/src/main/java/org/springframework/data/gemfire/GemfireCallback.java @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.springframework.data.gemfire; import org.apache.geode.GemFireCheckedException; @@ -21,7 +20,9 @@ import org.apache.geode.GemFireException; import org.apache.geode.cache.Region; /** - * Callback interface for GemFire code. To be used with {@link GemfireTemplate}'s execution methods, often as anonymous + * Callback interface for GemFire code. + * + * Implementations of this interface are to be used with {@link GemfireTemplate}'s execution methods, often as anonymous * classes within a method implementation. A typical implementation will call Region.get/put/query to perform some * operations on stored objects. * @@ -29,25 +30,27 @@ import org.apache.geode.cache.Region; * @author John Blum * @see org.apache.geode.cache.Region */ +@FunctionalInterface public interface GemfireCallback { /** - * Gets called by {@link GemfireTemplate#execute(GemfireCallback)}. Does not need to care about - * handling transactions or exceptions. + * This methods gets called by {@link GemfireTemplate#execute(GemfireCallback)}. * - * Allows a result object created within the callback to be returned, i.e. a domain object - * or a collection of domain objects. + * The method implementation does not need to care about handling transactions or exceptions. * - * A thrown custom RuntimeException is treated as an application exception: it gets propagated to + * Allows a result {@link Object} created within this callback to be returned, i.e. an application domain object + * or a collection of application domain objects. + * + * A custom thrown {@link RuntimeException} is treated as an application exception; the exception is propagated to * the caller of the template. * - * @param region the GemFire Cache Region upon which the operation of this callback will be performed. - * @return a result object, or null if no result. - * @throws GemFireCheckedException for checked Exceptions occurring in GemFire. - * @throws GemFireException for runtime Exceptions occurring in GemFire. + * @param region {@link Region} on which the operation of this callback will be performed. + * @return a result {@link Object}, or {@literal null} if no result. + * @throws GemFireCheckedException for checked {@link Exception Exceptions} occurring in GemFire. + * @throws GemFireException for {@link RuntimeException RuntimeExceptions} occurring in GemFire. * @see org.springframework.data.gemfire.GemfireTemplate * @see org.apache.geode.cache.Region */ - T doInGemfire(Region region) throws GemFireCheckedException, GemFireException; + T doInGemfire(Region region) throws GemFireCheckedException, GemFireException; } diff --git a/spring-data-geode/src/main/java/org/springframework/data/gemfire/GenericRegionFactoryBean.java b/spring-data-geode/src/main/java/org/springframework/data/gemfire/GenericRegionFactoryBean.java index fc7e85d9..14ea3a00 100644 --- a/spring-data-geode/src/main/java/org/springframework/data/gemfire/GenericRegionFactoryBean.java +++ b/spring-data-geode/src/main/java/org/springframework/data/gemfire/GenericRegionFactoryBean.java @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.springframework.data.gemfire; /** diff --git a/spring-data-geode/src/main/java/org/springframework/data/gemfire/support/NoOpBeanFactoryPostProcessor.java b/spring-data-geode/src/main/java/org/springframework/data/gemfire/support/NoOpBeanFactoryPostProcessor.java index 4b6779da..09b1c010 100644 --- a/spring-data-geode/src/main/java/org/springframework/data/gemfire/support/NoOpBeanFactoryPostProcessor.java +++ b/spring-data-geode/src/main/java/org/springframework/data/gemfire/support/NoOpBeanFactoryPostProcessor.java @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.springframework.data.gemfire.support; import org.springframework.beans.BeansException;