INT-3262 JDK8 Javadoc Commit

Increase receive timeout for `Jsr223TransformerTests#testInt3162ScriptExecutorThreadSafety`.

JIRA: https://jira.springsource.org/browse/INT-3262
JIRA: https://jira.springsource.org/browse/INT-3263
This commit is contained in:
Gary Russell
2014-01-15 19:14:53 +02:00
committed by Artem Bilan
parent 66efb34342
commit c45b708341
249 changed files with 2265 additions and 985 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 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.
@@ -97,17 +97,20 @@ public class SubscribableRedisChannel extends AbstractMessageChannel implements
/**
* Specify the maximum number of subscribers supported by the
* channel's dispatcher.
* @param maxSubscribers
*
* @param maxSubscribers The maximum number of subscribers allowed.
*/
public void setMaxSubscribers(int maxSubscribers) {
this.maxSubscribers = maxSubscribers;
this.dispatcher.setMaxSubscribers(maxSubscribers);
}
@Override
public boolean subscribe(MessageHandler handler) {
return this.dispatcher.addHandler(handler);
}
@Override
public boolean unsubscribe(MessageHandler handler) {
return this.dispatcher.removeHandler(handler);
}
@@ -151,36 +154,43 @@ public class SubscribableRedisChannel extends AbstractMessageChannel implements
* SmartLifecycle implementation (delegates to the MessageListener container)
*/
@Override
public boolean isAutoStartup() {
return (this.container != null) ? this.container.isAutoStartup() : false;
}
@Override
public int getPhase() {
return (this.container != null) ? this.container.getPhase() : 0;
}
@Override
public boolean isRunning() {
return (this.container != null) ? this.container.isRunning() : false;
}
@Override
public void start() {
if (this.container != null) {
this.container.start();
}
}
@Override
public void stop() {
if (this.container != null) {
this.container.stop();
}
}
@Override
public void stop(Runnable callback) {
if (this.container != null) {
this.container.stop(callback);
}
}
@Override
public void destroy() throws Exception {
if (this.container != null) {
this.container.destroy();

View File

@@ -115,14 +115,14 @@ public class RedisQueueMessageDrivenEndpoint extends MessageProducerSupport impl
/**
* This timeout (milliseconds) is used when retrieving elements from the queue
* specified by {@link #boundListOperations}.
* <p/>
* <p>
* If the queue does contain elements, the data is retrieved immediately. However,
* if the queue is empty, the Redis connection is blocked until either an element
* can be retrieved from the queue or until the specified timeout passes.
* <p/>
* <p>
* A timeout of zero can be used to block indefinitely. If not set explicitly
* the timeout value will default to {@code 1000}
* <p/>
* <p>
* See also: http://redis.io/commands/brpop
*
* @param receiveTimeout Must be non-negative. Specified in milliseconds.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 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.
@@ -27,12 +27,12 @@ import org.springframework.data.redis.support.collections.RedisCollectionFactory
import org.springframework.data.redis.support.collections.RedisStore;
import org.springframework.expression.Expression;
import org.springframework.expression.spel.support.StandardEvaluationContext;
import org.springframework.messaging.Message;
import org.springframework.integration.context.IntegrationObjectSupport;
import org.springframework.integration.core.MessageSource;
import org.springframework.integration.expression.ExpressionUtils;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.integration.transaction.IntegrationResourceHolder;
import org.springframework.messaging.Message;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.util.Assert;
/**
@@ -64,8 +64,8 @@ public class RedisStoreMessageSource extends IntegrationObjectSupport
* It assumes that {@link RedisTemplate} is fully initialized and ready to be used.
* The 'keyExpression' will be evaluated on every call to the {@link #receive()} method.
*
* @param redisTemplate
* @param keyExpression
* @param redisTemplate The Redis template.
* @param keyExpression The key expression.
*/
public RedisStoreMessageSource(RedisTemplate<String, ?> redisTemplate,
Expression keyExpression) {
@@ -85,8 +85,8 @@ public class RedisStoreMessageSource extends IntegrationObjectSupport
*
* The 'keyExpression' will be evaluated on every call to the {@link #receive()} method.
*
* @param connectionFactory
* @param keyExpression
* @param connectionFactory The connection factory.
* @param keyExpression The key expression.
*/
public RedisStoreMessageSource(RedisConnectionFactory connectionFactory,
Expression keyExpression) {
@@ -110,6 +110,7 @@ public class RedisStoreMessageSource extends IntegrationObjectSupport
* Returns a Message with the view into a {@link RedisStore} identified
* by {@link #keyExpression}
*/
@Override
@SuppressWarnings("unchecked")
public Message<RedisStore> receive() {
String key = this.keyExpression.getValue(this.evaluationContext, String.class);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2014 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
@@ -37,6 +37,8 @@ public class RedisMetadataStore implements MetadataStore {
/**
* Specifies the {@link RedisProperties} backend for this {@link MetadataStore}.
*
* @param properties The properties.
*/
public RedisMetadataStore(RedisProperties properties) {
Assert.notNull(properties, "'properties' must not be null.");
@@ -46,6 +48,8 @@ public class RedisMetadataStore implements MetadataStore {
/**
* Initializes the {@link RedisProperties} by provided {@link RedisConnectionFactory}
* and default hash key - {@link #KEY}.
*
* @param connectionFactory The connection factory.
*/
public RedisMetadataStore(RedisConnectionFactory connectionFactory) {
this(connectionFactory, KEY);
@@ -53,6 +57,9 @@ public class RedisMetadataStore implements MetadataStore {
/**
* Initializes the {@link RedisProperties} by provided {@link RedisConnectionFactory} and key.
*
* @param connectionFactory The connection factory.
* @param key The key.
*/
public RedisMetadataStore(RedisConnectionFactory connectionFactory, String key) {
Assert.notNull(connectionFactory, "'connectionFactory' must not be null.");
@@ -65,6 +72,8 @@ public class RedisMetadataStore implements MetadataStore {
/**
* Initializes the {@link RedisProperties} by provided {@link RedisConnectionFactory}
* and default hash key - {@link #KEY}.
*
* @param operations The Redis operations object.
*/
public RedisMetadataStore(RedisOperations<String, ?> operations) {
this(operations, KEY);
@@ -72,6 +81,9 @@ public class RedisMetadataStore implements MetadataStore {
/**
* Initializes the {@link RedisProperties} by provided {@link RedisConnectionFactory} and key.
*
* @param operations The Redis operations object.
* @param key The key.
*/
public RedisMetadataStore(RedisOperations<String, ?> operations, String key) {
Assert.notNull(operations, "'operations' must not be null.");
@@ -86,6 +98,7 @@ public class RedisMetadataStore implements MetadataStore {
* @param key Must not be null
* @param value Must not be null
*/
@Override
public void put(String key, String value) {
Assert.notNull(key, "'key' must not be null.");
Assert.notNull(value, "'value' must not be null.");
@@ -97,6 +110,7 @@ public class RedisMetadataStore implements MetadataStore {
*
* @param key Must not be null
*/
@Override
public String get(String key) {
Assert.notNull(key, "'key' must not be null.");
return (String) this.properties.get(key);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2007-2013 the original author or authors
* Copyright 2007-2014 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.
@@ -71,6 +71,8 @@ public class RedisPublishingMessageHandler extends AbstractMessageHandler implem
}
/**
* @param defaultTopic The default topic.
*
* @deprecated in favor of {@link #setTopicExpression(Expression)} or {@link #setTopic(String)}
*/
@Deprecated

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2007-2013 the original author or authors
* Copyright 2007-2014 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.
@@ -45,12 +45,12 @@ import org.springframework.expression.Expression;
import org.springframework.expression.common.LiteralExpression;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.expression.spel.support.StandardEvaluationContext;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageHandlingException;
import org.springframework.messaging.MessageHandler;
import org.springframework.integration.expression.ExpressionUtils;
import org.springframework.integration.handler.AbstractMessageHandler;
import org.springframework.integration.redis.support.RedisHeaders;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageHandler;
import org.springframework.messaging.MessageHandlingException;
import org.springframework.util.Assert;
import org.springframework.util.NumberUtils;
@@ -108,7 +108,7 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler {
* Constructs an instance using the provided {@link RedisTemplate}.
* The RedisTemplate must be fully initialized.
*
* @param redisTemplate
* @param redisTemplate The Redis template.
*/
public RedisStoreWritingMessageHandler(RedisTemplate<String, ?> redisTemplate) {
Assert.notNull(redisTemplate, "'redisTemplate' must not be null");
@@ -124,7 +124,7 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler {
* hash values, when it is false.
*
* @see #setExtractPayloadElements(boolean)
* @param connectionFactory
* @param connectionFactory The connection factory.
*/
public RedisStoreWritingMessageHandler(RedisConnectionFactory connectionFactory) {
Assert.notNull(connectionFactory, "'connectionFactory' must not be null");
@@ -138,7 +138,7 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler {
* If neither setter is called, the default expression will be 'headers.{@link RedisHeaders#KEY}'.
*
* @see #setKeyExpression(Expression)
* @param key
* @param key The key.
*/
public void setKey(String key) {
Assert.hasText(key, "key must not be empty");
@@ -152,7 +152,7 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler {
* If neither setter is called, the default expression will be 'headers.{@link RedisHeaders#KEY}'.
*
* @see #setKey(String)
* @param keyExpression
* @param keyExpression The key expression.
*/
public void setKeyExpression(Expression keyExpression) {
Assert.notNull(keyExpression, "keyExpression must not be null");
@@ -162,7 +162,7 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler {
/**
* Sets the collection type for this handler as per {@link CollectionType}.
*
* @param collectionType
* @param collectionType The collection type.
*/
public void setCollectionType(CollectionType collectionType) {
this.collectionType = collectionType;
@@ -176,7 +176,7 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler {
* the value of this attribute is meaningless as the payload will always be
* stored as a single entry.
*
* @param extractPayloadElements
* @param extractPayloadElements true if payload elements should be extracted.
*/
public void setExtractPayloadElements(boolean extractPayloadElements) {
this.extractPayloadElements = extractPayloadElements;
@@ -185,7 +185,8 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler {
/**
* Sets the expression used as the key for Map and Properties entries.
* Default is 'headers.{@link RedisHeaders#MAP_KEY}'
* @param mapKeyExpression
*
* @param mapKeyExpression The map key expression.
*/
public void setMapKeyExpression(Expression mapKeyExpression) {
Assert.notNull(mapKeyExpression, "'mapKeyExpression' must not be null");
@@ -288,6 +289,7 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler {
if ((payload instanceof Map<?, ?> && this.verifyAllMapValuesOfTypeNumber((Map<?, ?>) payload))) {
final Map<Object, Number> payloadAsMap = (Map<Object, Number>) payload;
this.processInPipeline(new PipelineCallback() {
@Override
public void process() {
for (Entry<Object, Number> entry : payloadAsMap.entrySet()) {
Number d = entry.getValue();
@@ -301,6 +303,7 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler {
}
else if (payload instanceof Collection<?>) {
this.processInPipeline(new PipelineCallback() {
@Override
public void process() {
for (Object object : ((Collection<?>)payload)) {
incrementOrOverwrite(ops, object, determineScore(message), zsetIncrementHeader);
@@ -348,6 +351,7 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler {
(BoundSetOperations<String, Object>) this.redisTemplate.boundSetOps(set.getKey());
this.processInPipeline(new PipelineCallback() {
@Override
public void process() {
for (Object object : ((Collection<?>)payload)) {
ops.add(object);
@@ -365,6 +369,7 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler {
final Object payload = message.getPayload();
if (this.extractPayloadElements && payload instanceof Map<?, ?>) {
this.processInPipeline(new PipelineCallback() {
@Override
public void process() {
map.putAll((Map<? extends Object, ? extends Object>) payload);
}
@@ -380,6 +385,7 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler {
final Object payload = message.getPayload();
if (this.extractPayloadElements && payload instanceof Properties) {
this.processInPipeline(new PipelineCallback() {
@Override
public void process() {
properties.putAll((Properties) payload);
}