Checkstyle ImportOrder for main and fixes

This commit is contained in:
Artem Bilan
2017-01-23 12:56:54 -05:00
parent 6ac0c7316a
commit 2659baa821
125 changed files with 396 additions and 323 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 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.
@@ -22,17 +22,16 @@ import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.integration.endpoint.ExpressionMessageProducerSupport;
import org.springframework.messaging.Message;
import org.springframework.util.Assert;
import org.apache.geode.cache.CacheClosedException;
import org.apache.geode.cache.CacheListener;
import org.apache.geode.cache.EntryEvent;
import org.apache.geode.cache.Region;
import org.apache.geode.cache.util.CacheListenerAdapter;
import org.springframework.integration.endpoint.ExpressionMessageProducerSupport;
import org.springframework.messaging.Message;
import org.springframework.util.Assert;
/**
* An inbound endpoint that listens to a GemFire region for events and then publishes Messages to
* a channel. The default supported event types are CREATED and UPDATED. See the {@link EventType}
@@ -45,7 +44,7 @@ import org.apache.geode.cache.util.CacheListenerAdapter;
* @author Artem Bilan
* @since 2.1
*/
@SuppressWarnings({"rawtypes", "unchecked"})
@SuppressWarnings({ "rawtypes", "unchecked" })
public class CacheListeningMessageProducer extends ExpressionMessageProducerSupport {
private final Log logger = LogFactory.getLog(this.getClass());
@@ -104,33 +103,33 @@ public class CacheListeningMessageProducer extends ExpressionMessageProducerSupp
@Override
public void afterCreate(EntryEvent event) {
if (CacheListeningMessageProducer.this.supportedEventTypes.contains(EventType.CREATED)) {
this.processEvent(event);
processEvent(event);
}
}
@Override
public void afterUpdate(EntryEvent event) {
if (CacheListeningMessageProducer.this.supportedEventTypes.contains(EventType.UPDATED)) {
this.processEvent(event);
processEvent(event);
}
}
@Override
public void afterInvalidate(EntryEvent event) {
if (CacheListeningMessageProducer.this.supportedEventTypes.contains(EventType.INVALIDATED)) {
this.processEvent(event);
processEvent(event);
}
}
@Override
public void afterDestroy(EntryEvent event) {
if (CacheListeningMessageProducer.this.supportedEventTypes.contains(EventType.DESTROYED)) {
this.processEvent(event);
processEvent(event);
}
}
private void processEvent(EntryEvent event) {
this.publish(evaluatePayloadExpression(event));
publish(evaluatePayloadExpression(event));
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 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.
@@ -22,6 +22,7 @@ import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.geode.cache.query.CqEvent;
import org.springframework.data.gemfire.listener.ContinuousQueryDefinition;
import org.springframework.data.gemfire.listener.ContinuousQueryListener;
@@ -30,8 +31,6 @@ import org.springframework.integration.endpoint.ExpressionMessageProducerSupport
import org.springframework.messaging.Message;
import org.springframework.util.Assert;
import org.apache.geode.cache.query.CqEvent;
/**
* Responds to a Gemfire continuous query (set using the #query field) that is
* constantly evaluated against a cache

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014 the original author or authors.
* Copyright 2014-2017 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.
@@ -16,13 +16,13 @@
package org.springframework.integration.gemfire.metadata;
import org.springframework.integration.metadata.ConcurrentMetadataStore;
import org.springframework.util.Assert;
import org.apache.geode.cache.Cache;
import org.apache.geode.cache.Region;
import org.apache.geode.cache.Scope;
import org.springframework.integration.metadata.ConcurrentMetadataStore;
import org.springframework.util.Assert;
/**
* Gemfire implementation of {@link ConcurrentMetadataStore}.
* Use this {@link org.springframework.integration.metadata.MetadataStore}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2017 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.
@@ -21,6 +21,10 @@ import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.geode.GemFireCheckedException;
import org.apache.geode.GemFireException;
import org.apache.geode.cache.Region;
import org.springframework.data.gemfire.GemfireCallback;
import org.springframework.data.gemfire.GemfireTemplate;
import org.springframework.expression.EvaluationContext;
@@ -32,10 +36,6 @@ import org.springframework.messaging.Message;
import org.springframework.messaging.MessageHandler;
import org.springframework.util.Assert;
import org.apache.geode.GemFireCheckedException;
import org.apache.geode.GemFireException;
import org.apache.geode.cache.Region;
/**
* A {@link MessageHandler} implementation that writes to a GemFire Region. The
* Message's payload must be an instance of {@link Map} or {@link #cacheEntryExpressions}
@@ -76,7 +76,7 @@ public class CacheWritingMessageHandler extends AbstractMessageHandler {
}
@Override
@SuppressWarnings({"unchecked", "rawtypes"})
@SuppressWarnings({ "unchecked", "rawtypes" })
protected void handleMessageInternal(Message<?> message) {
Object payload = message.getPayload();
Map<?, ?> cacheValues = (this.cacheEntryExpressions.size() > 0) ? evaluateCacheEntries(message) : null;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 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.
@@ -20,6 +20,9 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.apache.geode.cache.Cache;
import org.apache.geode.cache.Region;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.data.gemfire.RegionAttributesFactoryBean;
import org.springframework.data.gemfire.RegionFactoryBean;
@@ -29,9 +32,6 @@ import org.springframework.integration.store.MessageStore;
import org.springframework.util.Assert;
import org.springframework.util.PatternMatchUtils;
import org.apache.geode.cache.Cache;
import org.apache.geode.cache.Region;
/**
* Gemfire implementation of the key/value style {@link MessageStore} and
* {@link MessageGroupStore}
@@ -81,7 +81,9 @@ public class GemfireMessageStore extends AbstractKeyValueMessageStore implements
RegionAttributesFactoryBean attributesFactoryBean = new RegionAttributesFactoryBean();
attributesFactoryBean.setIgnoreJTA(this.ignoreJta);
attributesFactoryBean.afterPropertiesSet();
RegionFactoryBean<Object, Object> messageRegionFactoryBean = new RegionFactoryBean<Object, Object>() { };
RegionFactoryBean<Object, Object> messageRegionFactoryBean = new RegionFactoryBean<Object, Object>() {
};
messageRegionFactoryBean.setBeanName(MESSAGE_STORE_REGION_NAME);
messageRegionFactoryBean.setAttributes(attributesFactoryBean.getObject());
messageRegionFactoryBean.setCache(this.cache);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014 the original author or authors.
* Copyright 2014-2017 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.
@@ -18,13 +18,13 @@ package org.springframework.integration.gemfire.util;
import java.util.concurrent.locks.Lock;
import org.springframework.integration.support.locks.LockRegistry;
import org.springframework.util.Assert;
import org.apache.geode.cache.Cache;
import org.apache.geode.cache.Region;
import org.apache.geode.cache.Scope;
import org.springframework.integration.support.locks.LockRegistry;
import org.springframework.util.Assert;
/**
* Implementation of {@link LockRegistry} providing a distributed lock using Gemfire.
*

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2016 the original author or authors.
* Copyright 2013-2017 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.
@@ -24,6 +24,9 @@ import static org.junit.Assert.fail;
import java.util.concurrent.TimeUnit;
import org.apache.geode.cache.Cache;
import org.apache.geode.cache.Region;
import org.apache.geode.cache.Scope;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.ClassRule;
@@ -43,10 +46,6 @@ import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.PollableChannel;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import org.apache.geode.cache.Cache;
import org.apache.geode.cache.Region;
import org.apache.geode.cache.Scope;
/**
* @author Artem Bilan