Code Polishing (Sonar)
- remove redundant modifiers - overridable methods called from ctors Polishing - PR Comments
This commit is contained in:
committed by
Artem Bilan
parent
ddb4321e1d
commit
255247ca9a
@@ -155,7 +155,7 @@ public abstract class AbstractCorrelatingMessageHandler extends AbstractMessageP
|
||||
this.lockRegistrySet = true;
|
||||
}
|
||||
|
||||
public void setMessageStore(MessageGroupStore store) {
|
||||
public final void setMessageStore(MessageGroupStore store) {
|
||||
this.messageStore = store;
|
||||
store.registerMessageGroupExpiryCallback(new MessageGroupCallback() {
|
||||
@Override
|
||||
|
||||
@@ -57,7 +57,7 @@ public class ResequencingMessageHandler extends AbstractCorrelatingMessageHandle
|
||||
* than waiting for the next timeout)
|
||||
*/
|
||||
@Override
|
||||
public void setExpireGroupsUponTimeout(boolean expireGroupsUponTimeout) {
|
||||
public final void setExpireGroupsUponTimeout(boolean expireGroupsUponTimeout) {
|
||||
super.setExpireGroupsUponTimeout(expireGroupsUponTimeout);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -31,6 +31,7 @@ import org.springframework.messaging.MessageHeaders;
|
||||
*
|
||||
* @author Mark Fisher
|
||||
* @author Oleg Zhurakousky
|
||||
* @author Gary Russell
|
||||
*/
|
||||
public class PriorityChannel extends QueueChannel {
|
||||
|
||||
@@ -106,7 +107,7 @@ public class PriorityChannel extends QueueChannel {
|
||||
|
||||
private final Comparator<Message<?>> targetComparator;
|
||||
|
||||
public SequenceFallbackComparator(Comparator<Message<?>> targetComparator){
|
||||
private SequenceFallbackComparator(Comparator<Message<?>> targetComparator){
|
||||
this.targetComparator = targetComparator;
|
||||
}
|
||||
|
||||
@@ -135,11 +136,11 @@ public class PriorityChannel extends QueueChannel {
|
||||
}
|
||||
|
||||
//we need this because of INT-2508
|
||||
private class MessageWrapper implements Message<Object>{
|
||||
private class MessageWrapper implements Message<Object> {
|
||||
private final Message<?> rootMessage;
|
||||
private final long sequence;
|
||||
|
||||
public MessageWrapper(Message<?> rootMessage){
|
||||
private MessageWrapper(Message<?> rootMessage){
|
||||
this.rootMessage = rootMessage;
|
||||
this.sequence = sequenceCounter.incrementAndGet();
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ import org.springframework.messaging.support.ExecutorChannelInterceptor;
|
||||
* @param <S> the propagated state object type.
|
||||
*
|
||||
* @author Artem Bilan
|
||||
* @author Gary Russell
|
||||
* @since 4.2
|
||||
*/
|
||||
public abstract class ThreadStatePropagationChannelInterceptor<S>
|
||||
@@ -96,7 +97,7 @@ public abstract class ThreadStatePropagationChannelInterceptor<S>
|
||||
|
||||
private final S state;
|
||||
|
||||
public MessageWithThreadState(Message<?> message, S state) {
|
||||
private MessageWithThreadState(Message<?> message, S state) {
|
||||
this.message = message;
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -43,7 +43,7 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
final class ChannelInitializer implements BeanFactoryAware, InitializingBean {
|
||||
|
||||
private Log logger = LogFactory.getLog(this.getClass());
|
||||
private final Log logger = LogFactory.getLog(this.getClass());
|
||||
|
||||
private volatile BeanFactory beanFactory;
|
||||
|
||||
@@ -54,10 +54,12 @@ final class ChannelInitializer implements BeanFactoryAware, InitializingBean {
|
||||
this.autoCreate = autoCreate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
|
||||
this.beanFactory = beanFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
Assert.notNull(this.beanFactory, "'beanFactory' must not be null");
|
||||
if (!autoCreate){
|
||||
@@ -89,7 +91,7 @@ final class ChannelInitializer implements BeanFactoryAware, InitializingBean {
|
||||
|
||||
private final Collection<String> channelNames;
|
||||
|
||||
public AutoCreateCandidatesCollector(Collection<String> channelNames){
|
||||
AutoCreateCandidatesCollector(Collection<String> channelNames){
|
||||
this.channelNames = channelNames;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -33,6 +33,7 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* @author Oleg Zhurakousky
|
||||
* @author Mark Fisher
|
||||
* @author Gary Russell
|
||||
* @since 2.0
|
||||
*/
|
||||
class ConverterRegistrar implements InitializingBean, BeanFactoryAware {
|
||||
@@ -42,7 +43,7 @@ class ConverterRegistrar implements InitializingBean, BeanFactoryAware {
|
||||
private BeanFactory beanFactory;
|
||||
|
||||
|
||||
public ConverterRegistrar(Set<?> converters) {
|
||||
ConverterRegistrar(Set<?> converters) {
|
||||
this.converters = converters;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public class MessagingTemplate extends GenericMessagingTemplate {
|
||||
* @param defaultChannel the default {@link MessageChannel} for {@code send} operations
|
||||
*/
|
||||
public MessagingTemplate(MessageChannel defaultChannel) {
|
||||
this.setDefaultChannel(defaultChannel);
|
||||
super.setDefaultDestination(defaultChannel);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,242 +1,256 @@
|
||||
/*
|
||||
* Copyright 2002-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.integration.dispatcher;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
|
||||
|
||||
import org.springframework.core.OrderComparator;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Special Set that maintains the following semantics:
|
||||
* All elements that are un-ordered (do not implement {@link Ordered} interface or annotated
|
||||
* {@link Order} annotation) will be stored in the order in which they were added.
|
||||
* However, for all {@link Ordered} elements a
|
||||
* {@link Comparator} (instantiated by default) for this implementation of {@link Set}, will be
|
||||
* used. Those elements will have precedence over un-ordered elements. If elements have the same
|
||||
* order but themselves do not equal to one another the more recent addition will be placed to the
|
||||
* right of (appended next to) the existing element with the same order, thus preserving the order
|
||||
* of the insertion while maintaining the order of insertion for the un-ordered elements.
|
||||
* <p>
|
||||
* The class is package-protected and only intended for use by the AbstractDispatcher. It
|
||||
* <em>must</em> enforce safe concurrent access for all usage by the dispatcher.
|
||||
*
|
||||
* @author Oleg Zhurakousky
|
||||
* @author Mark Fisher
|
||||
* @author Diego Belfer
|
||||
* @since 1.0.3
|
||||
*/
|
||||
@SuppressWarnings({"unchecked"})
|
||||
class OrderedAwareCopyOnWriteArraySet<E> implements Set<E> {
|
||||
|
||||
private final OrderComparator comparator = new OrderComparator();
|
||||
|
||||
private final ReentrantReadWriteLock rwl = new ReentrantReadWriteLock();
|
||||
|
||||
private final ReadLock readLock = rwl.readLock();
|
||||
|
||||
private final WriteLock writeLock = rwl.writeLock();
|
||||
|
||||
private final CopyOnWriteArraySet<E> elements;
|
||||
|
||||
private final Set<E> unmodifiableElements;
|
||||
|
||||
public OrderedAwareCopyOnWriteArraySet() {
|
||||
elements = new CopyOnWriteArraySet<E>();
|
||||
unmodifiableElements = Collections.unmodifiableSet(elements);
|
||||
}
|
||||
|
||||
public Set<E> asUnmodifiableSet() {
|
||||
return unmodifiableElements;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Every time an Ordered element is added via this method this
|
||||
* Set will be re-sorted, otherwise the element is simply added
|
||||
* to the end. Added element must not be null.
|
||||
*/
|
||||
public boolean add(E o) {
|
||||
Assert.notNull(o,"Can not add NULL object");
|
||||
writeLock.lock();
|
||||
try {
|
||||
boolean present = false;
|
||||
if (o instanceof Ordered){
|
||||
present = this.addOrderedElement((Ordered) o);
|
||||
}
|
||||
else {
|
||||
present = elements.add(o);
|
||||
}
|
||||
return present;
|
||||
}
|
||||
finally {
|
||||
writeLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds all elements in this Collection.
|
||||
*/
|
||||
public boolean addAll(Collection<? extends E> c) {
|
||||
Assert.notNull(c,"Can not merge with NULL set");
|
||||
writeLock.lock();
|
||||
try {
|
||||
for (E object : c) {
|
||||
this.add(object);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
finally {
|
||||
writeLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public boolean remove(Object o) {
|
||||
writeLock.lock();
|
||||
try {
|
||||
boolean removed = elements.remove(o);
|
||||
//unmodifiableElements = Collections.unmodifiableSet(this);
|
||||
return removed;
|
||||
}
|
||||
finally {
|
||||
writeLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public boolean removeAll(Collection<?> c){
|
||||
if (CollectionUtils.isEmpty(c)){
|
||||
return false;
|
||||
}
|
||||
writeLock.lock();
|
||||
try {
|
||||
return elements.removeAll(c);
|
||||
}
|
||||
finally {
|
||||
writeLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
public <T> T[] toArray(T[] a) {
|
||||
readLock.lock();
|
||||
try {
|
||||
return elements.toArray(a);
|
||||
}
|
||||
finally {
|
||||
readLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
readLock.lock();
|
||||
try {
|
||||
return StringUtils.collectionToCommaDelimitedString(elements);
|
||||
}
|
||||
finally {
|
||||
readLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private boolean addOrderedElement(Ordered adding) {
|
||||
boolean added = false;
|
||||
E[] tempUnorderedElements = (E[]) elements.toArray();
|
||||
if (elements.contains(adding)) {
|
||||
return false;
|
||||
}
|
||||
elements.clear();
|
||||
|
||||
if (tempUnorderedElements.length == 0) {
|
||||
added = elements.add((E) adding);
|
||||
}
|
||||
else {
|
||||
Set tempSet = new LinkedHashSet();
|
||||
for (E current : tempUnorderedElements) {
|
||||
if (current instanceof Ordered) {
|
||||
if (this.comparator.compare(adding, current) < 0) {
|
||||
added = elements.add((E) adding);
|
||||
elements.add(current);
|
||||
}
|
||||
else {
|
||||
elements.add(current);
|
||||
}
|
||||
}
|
||||
else {
|
||||
tempSet.add(current);
|
||||
}
|
||||
}
|
||||
if (!added) {
|
||||
added = elements.add((E) adding);
|
||||
}
|
||||
for (Object object : tempSet) {
|
||||
elements.add((E) object);
|
||||
}
|
||||
}
|
||||
return added;
|
||||
}
|
||||
|
||||
public Iterator<E> iterator() {
|
||||
return this.elements.iterator();
|
||||
}
|
||||
|
||||
public int size(){
|
||||
return this.elements.size();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return this.elements.isEmpty();
|
||||
}
|
||||
|
||||
public boolean contains(Object o) {
|
||||
return this.elements.contains(o);
|
||||
}
|
||||
|
||||
public Object[] toArray() {
|
||||
return this.elements.toArray();
|
||||
}
|
||||
|
||||
public boolean containsAll(Collection<?> c) {
|
||||
return this.elements.containsAll(c);
|
||||
}
|
||||
|
||||
public boolean retainAll(Collection<?> c) {
|
||||
return this.elements.retainAll(c);
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
this.elements.clear();
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Copyright 2002-2015 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.integration.dispatcher;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
|
||||
|
||||
import org.springframework.core.OrderComparator;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Special Set that maintains the following semantics:
|
||||
* All elements that are un-ordered (do not implement {@link Ordered} interface or annotated
|
||||
* {@link Order} annotation) will be stored in the order in which they were added.
|
||||
* However, for all {@link Ordered} elements a
|
||||
* {@link Comparator} (instantiated by default) for this implementation of {@link Set}, will be
|
||||
* used. Those elements will have precedence over un-ordered elements. If elements have the same
|
||||
* order but themselves do not equal to one another the more recent addition will be placed to the
|
||||
* right of (appended next to) the existing element with the same order, thus preserving the order
|
||||
* of the insertion while maintaining the order of insertion for the un-ordered elements.
|
||||
* <p>
|
||||
* The class is package-protected and only intended for use by the AbstractDispatcher. It
|
||||
* <em>must</em> enforce safe concurrent access for all usage by the dispatcher.
|
||||
*
|
||||
* @author Oleg Zhurakousky
|
||||
* @author Mark Fisher
|
||||
* @author Diego Belfer
|
||||
* @author Gary Russell
|
||||
* @since 1.0.3
|
||||
*/
|
||||
@SuppressWarnings({"unchecked"})
|
||||
class OrderedAwareCopyOnWriteArraySet<E> implements Set<E> {
|
||||
|
||||
private final OrderComparator comparator = new OrderComparator();
|
||||
|
||||
private final ReentrantReadWriteLock rwl = new ReentrantReadWriteLock();
|
||||
|
||||
private final ReadLock readLock = rwl.readLock();
|
||||
|
||||
private final WriteLock writeLock = rwl.writeLock();
|
||||
|
||||
private final CopyOnWriteArraySet<E> elements;
|
||||
|
||||
private final Set<E> unmodifiableElements;
|
||||
|
||||
OrderedAwareCopyOnWriteArraySet() {
|
||||
elements = new CopyOnWriteArraySet<E>();
|
||||
unmodifiableElements = Collections.unmodifiableSet(elements);
|
||||
}
|
||||
|
||||
public Set<E> asUnmodifiableSet() {
|
||||
return unmodifiableElements;
|
||||
}
|
||||
|
||||
/**
|
||||
* Every time an Ordered element is added via this method this
|
||||
* Set will be re-sorted, otherwise the element is simply added
|
||||
* to the end. Added element must not be null.
|
||||
*/
|
||||
@Override
|
||||
public boolean add(E o) {
|
||||
Assert.notNull(o,"Can not add NULL object");
|
||||
writeLock.lock();
|
||||
try {
|
||||
boolean present = false;
|
||||
if (o instanceof Ordered){
|
||||
present = this.addOrderedElement((Ordered) o);
|
||||
}
|
||||
else {
|
||||
present = elements.add(o);
|
||||
}
|
||||
return present;
|
||||
}
|
||||
finally {
|
||||
writeLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds all elements in this Collection.
|
||||
*/
|
||||
@Override
|
||||
public boolean addAll(Collection<? extends E> c) {
|
||||
Assert.notNull(c,"Can not merge with NULL set");
|
||||
writeLock.lock();
|
||||
try {
|
||||
for (E object : c) {
|
||||
this.add(object);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
finally {
|
||||
writeLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean remove(Object o) {
|
||||
writeLock.lock();
|
||||
try {
|
||||
boolean removed = elements.remove(o);
|
||||
//unmodifiableElements = Collections.unmodifiableSet(this);
|
||||
return removed;
|
||||
}
|
||||
finally {
|
||||
writeLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean removeAll(Collection<?> c){
|
||||
if (CollectionUtils.isEmpty(c)){
|
||||
return false;
|
||||
}
|
||||
writeLock.lock();
|
||||
try {
|
||||
return elements.removeAll(c);
|
||||
}
|
||||
finally {
|
||||
writeLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T[] toArray(T[] a) {
|
||||
readLock.lock();
|
||||
try {
|
||||
return elements.toArray(a);
|
||||
}
|
||||
finally {
|
||||
readLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
readLock.lock();
|
||||
try {
|
||||
return StringUtils.collectionToCommaDelimitedString(elements);
|
||||
}
|
||||
finally {
|
||||
readLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private boolean addOrderedElement(Ordered adding) {
|
||||
boolean added = false;
|
||||
E[] tempUnorderedElements = (E[]) elements.toArray();
|
||||
if (elements.contains(adding)) {
|
||||
return false;
|
||||
}
|
||||
elements.clear();
|
||||
|
||||
if (tempUnorderedElements.length == 0) {
|
||||
added = elements.add((E) adding);
|
||||
}
|
||||
else {
|
||||
Set tempSet = new LinkedHashSet();
|
||||
for (E current : tempUnorderedElements) {
|
||||
if (current instanceof Ordered) {
|
||||
if (this.comparator.compare(adding, current) < 0) {
|
||||
added = elements.add((E) adding);
|
||||
elements.add(current);
|
||||
}
|
||||
else {
|
||||
elements.add(current);
|
||||
}
|
||||
}
|
||||
else {
|
||||
tempSet.add(current);
|
||||
}
|
||||
}
|
||||
if (!added) {
|
||||
added = elements.add((E) adding);
|
||||
}
|
||||
for (Object object : tempSet) {
|
||||
elements.add((E) object);
|
||||
}
|
||||
}
|
||||
return added;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<E> iterator() {
|
||||
return this.elements.iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size(){
|
||||
return this.elements.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return this.elements.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(Object o) {
|
||||
return this.elements.contains(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] toArray() {
|
||||
return this.elements.toArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsAll(Collection<?> c) {
|
||||
return this.elements.containsAll(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean retainAll(Collection<?> c) {
|
||||
return this.elements.retainAll(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.elements.clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -315,7 +315,7 @@ public abstract class AbstractPollingEndpoint extends AbstractEndpoint implement
|
||||
private final Callable<Boolean> pollingTask;
|
||||
|
||||
|
||||
public Poller(Callable<Boolean> pollingTask) {
|
||||
private Poller(Callable<Boolean> pollingTask) {
|
||||
this.pollingTask = pollingTask;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -50,6 +50,7 @@ import org.springframework.util.StringUtils;
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @author Mark Fisher
|
||||
* @author Gary Russell
|
||||
* @since 2.0
|
||||
* @see #setCacheSeconds
|
||||
* @see #setBasenames
|
||||
@@ -545,12 +546,12 @@ public class ReloadableResourceBundleExpressionSource implements ExpressionSourc
|
||||
private long refreshTimestamp = -1;
|
||||
|
||||
|
||||
public PropertiesHolder(Properties properties, long fileTimestamp) {
|
||||
private PropertiesHolder(Properties properties, long fileTimestamp) {
|
||||
this.properties = properties;
|
||||
this.fileTimestamp = fileTimestamp;
|
||||
}
|
||||
|
||||
public PropertiesHolder() {
|
||||
private PropertiesHolder() {
|
||||
}
|
||||
|
||||
public Properties getProperties() {
|
||||
|
||||
@@ -68,7 +68,7 @@ public class GatewayCompletableFutureProxyFactoryBean extends GatewayProxyFactor
|
||||
|
||||
private final MethodInvocation invocation;
|
||||
|
||||
public Invoker(MethodInvocation methodInvocation) {
|
||||
private Invoker(MethodInvocation methodInvocation) {
|
||||
this.invocation = methodInvocation;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -104,15 +104,15 @@ class GatewayMethodInboundMessageMapper implements InboundMessageMapper<Object[]
|
||||
|
||||
private final MessageBuilderFactory messageBuilderFactory;
|
||||
|
||||
public GatewayMethodInboundMessageMapper(Method method) {
|
||||
GatewayMethodInboundMessageMapper(Method method) {
|
||||
this(method, null);
|
||||
}
|
||||
|
||||
public GatewayMethodInboundMessageMapper(Method method, Map<String, Expression> headerExpressions) {
|
||||
GatewayMethodInboundMessageMapper(Method method, Map<String, Expression> headerExpressions) {
|
||||
this(method, headerExpressions, null, null, null);
|
||||
}
|
||||
|
||||
public GatewayMethodInboundMessageMapper(Method method, Map<String, Expression> headerExpressions,
|
||||
GatewayMethodInboundMessageMapper(Method method, Map<String, Expression> headerExpressions,
|
||||
Map<String, Expression> globalHeaderExpressions, MethodArgsMessageMapper mapper,
|
||||
MessageBuilderFactory messageBuilderFactory) {
|
||||
Assert.notNull(method, "method must not be null");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
* Copyright 2002-2015 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,26 +16,27 @@
|
||||
|
||||
package org.springframework.integration.gateway;
|
||||
|
||||
import org.springframework.integration.handler.AbstractReplyProducingMessageHandler;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageHandler;
|
||||
import org.springframework.integration.handler.AbstractReplyProducingMessageHandler;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Adapts a {@link RequestReplyExchanger} to the {@link MessageHandler} interface.
|
||||
*
|
||||
*
|
||||
* @author Oleg Zhurakousky
|
||||
* @author Mark Fisher
|
||||
* @author Gary Russell
|
||||
* @since 2.0
|
||||
*/
|
||||
class RequestReplyMessageHandlerAdapter extends AbstractReplyProducingMessageHandler {
|
||||
|
||||
private RequestReplyExchanger exchanger;
|
||||
private final RequestReplyExchanger exchanger;
|
||||
|
||||
/**
|
||||
* @param exchanger
|
||||
*/
|
||||
public RequestReplyMessageHandlerAdapter(RequestReplyExchanger exchanger) {
|
||||
RequestReplyMessageHandlerAdapter(RequestReplyExchanger exchanger) {
|
||||
Assert.notNull(exchanger, "exchanger must not be null");
|
||||
this.exchanger = exchanger;
|
||||
}
|
||||
@@ -43,6 +44,7 @@ class RequestReplyMessageHandlerAdapter extends AbstractReplyProducingMessageHan
|
||||
/**
|
||||
* Delegates to the exchanger.
|
||||
*/
|
||||
@Override
|
||||
protected Object handleRequestMessage(Message<?> requestMessage) {
|
||||
return exchanger.exchange(requestMessage);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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
|
||||
@@ -39,7 +39,7 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
public class LoggingHandler extends AbstractMessageHandler {
|
||||
|
||||
public static enum Level {
|
||||
public enum Level {
|
||||
FATAL, ERROR, WARN, INFO, DEBUG, TRACE
|
||||
}
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ public abstract class AbstractRequestHandlerAdvice extends IntegrationObjectSupp
|
||||
@SuppressWarnings("serial")
|
||||
private class ThrowableHolderException extends RuntimeException {
|
||||
|
||||
public ThrowableHolderException(Throwable cause) {
|
||||
private ThrowableHolderException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -72,7 +72,7 @@ public class RequestHandlerCircuitBreakerAdvice extends AbstractRequestHandlerAd
|
||||
}
|
||||
}
|
||||
|
||||
private class AdvisedMetadata {
|
||||
private static class AdvisedMetadata {
|
||||
|
||||
private final AtomicInteger failures = new AtomicInteger();
|
||||
|
||||
@@ -91,13 +91,17 @@ public class RequestHandlerCircuitBreakerAdvice extends AbstractRequestHandlerAd
|
||||
}
|
||||
}
|
||||
|
||||
private class CircuitBreakerOpenException extends RuntimeException {
|
||||
/**
|
||||
* An exception thrown when the circuit breaker is in an open state.
|
||||
*/
|
||||
public static class CircuitBreakerOpenException extends RuntimeException {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public CircuitBreakerOpenException(String message) {
|
||||
private CircuitBreakerOpenException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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,8 +16,8 @@
|
||||
package org.springframework.integration.json;
|
||||
|
||||
import org.springframework.integration.support.AbstractIntegrationMessageBuilder;
|
||||
import org.springframework.integration.support.json.JsonObjectMapperProvider;
|
||||
import org.springframework.integration.support.json.JsonObjectMapper;
|
||||
import org.springframework.integration.support.json.JsonObjectMapperProvider;
|
||||
import org.springframework.integration.transformer.AbstractTransformer;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageHeaders;
|
||||
@@ -41,7 +41,7 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
public class ObjectToJsonTransformer extends AbstractTransformer {
|
||||
|
||||
public static enum ResultType {
|
||||
public enum ResultType {
|
||||
STRING, NODE
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -30,10 +30,11 @@ import org.springframework.util.Assert;
|
||||
* accordance with this chain's {@link VotingStrategy}.
|
||||
*
|
||||
* @author Mark Fisher
|
||||
* @author Gary Russell
|
||||
*/
|
||||
public class MessageSelectorChain implements MessageSelector {
|
||||
|
||||
public static enum VotingStrategy { ALL, ANY, MAJORITY, MAJORITY_OR_TIE };
|
||||
public enum VotingStrategy { ALL, ANY, MAJORITY, MAJORITY_OR_TIE };
|
||||
|
||||
|
||||
private volatile VotingStrategy votingStrategy = VotingStrategy.ALL;
|
||||
|
||||
@@ -95,7 +95,7 @@ public class SmartLifecycleRoleController implements ApplicationListener<Abstrac
|
||||
* @param role the role.
|
||||
* @param lifecycle the {@link SmartLifecycle}.
|
||||
*/
|
||||
public void addLifecycleToRole(String role, SmartLifecycle lifecycle) {
|
||||
public final void addLifecycleToRole(String role, SmartLifecycle lifecycle) {
|
||||
this.lifecycles.add(role, lifecycle);
|
||||
}
|
||||
|
||||
|
||||
@@ -73,13 +73,13 @@ public class SimpleMessageConverter implements MessageConverter, BeanFactoryAwar
|
||||
}
|
||||
|
||||
|
||||
public void setInboundMessageMapper(InboundMessageMapper<?> inboundMessageMapper) {
|
||||
public final void setInboundMessageMapper(InboundMessageMapper<?> inboundMessageMapper) {
|
||||
this.inboundMessageMapper = (inboundMessageMapper != null)
|
||||
? inboundMessageMapper
|
||||
: new DefaultInboundMessageMapper();
|
||||
}
|
||||
|
||||
public void setOutboundMessageMapper(OutboundMessageMapper<?> outboundMessageMapper) {
|
||||
public final void setOutboundMessageMapper(OutboundMessageMapper<?> outboundMessageMapper) {
|
||||
this.outboundMessageMapper = (outboundMessageMapper != null
|
||||
? outboundMessageMapper
|
||||
: new DefaultOutboundMessageMapper());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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
|
||||
@@ -39,6 +39,7 @@ public class DefaultTransactionSynchronizationFactory implements TransactionSync
|
||||
this.processor = processor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TransactionSynchronization create(Object key) {
|
||||
Assert.notNull(key, "'key' must not be null");
|
||||
DefaultTransactionalResourceSynchronization synchronization = new DefaultTransactionalResourceSynchronization(key);
|
||||
@@ -50,7 +51,7 @@ public class DefaultTransactionSynchronizationFactory implements TransactionSync
|
||||
*/
|
||||
private class DefaultTransactionalResourceSynchronization extends IntegrationResourceHolderSynchronization {
|
||||
|
||||
public DefaultTransactionalResourceSynchronization(Object resourceKey) {
|
||||
private DefaultTransactionalResourceSynchronization(Object resourceKey) {
|
||||
super(new IntegrationResourceHolder(), resourceKey);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user