Skip to content

Commit

Permalink
INT-3262 JDK8 Javadoc Commit
Browse files Browse the repository at this point in the history
Increase receive timeout for `Jsr223TransformerTests#testInt3162ScriptExecutorThreadSafety`.

JIRA: https://jira.springsource.org/browse/INT-3262
JIRA: https://jira.springsource.org/browse/INT-3263
  • Loading branch information
garyrussell authored and Artem Bilan committed Jan 15, 2014
1 parent 66efb34 commit c45b708
Show file tree
Hide file tree
Showing 249 changed files with 2,264 additions and 984 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2011 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.
Expand All @@ -17,8 +17,8 @@
package org.springframework.integration.amqp.channel;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.messaging.Message;
import org.springframework.integration.channel.AbstractMessageChannel;
import org.springframework.messaging.Message;
import org.springframework.util.Assert;

/**
Expand All @@ -39,6 +39,8 @@ public abstract class AbstractAmqpChannel extends AbstractMessageChannel {
/**
* Subclasses may override this method to return an Exchange name.
* By default, Messages will be sent to the no-name Direct Exchange.
*
* @return The exchange name.
*/
protected String getExchangeName() {
return "";
Expand All @@ -47,6 +49,8 @@ protected String getExchangeName() {
/**
* Subclasses may override this method to return a routing key.
* By default, there will be no routing key (empty string).
*
* @return The routing key.
*/
protected String getRoutingKey() {
return "";
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -78,7 +78,7 @@ public AbstractSubscribableAmqpChannel(String channelName,
/**
* Specify the maximum number of subscribers supported by the
* channel's dispatcher (if it is an {@link AbstractDispatcher}).
* @param maxSubscribers
* @param maxSubscribers The maximum number of subscribers allowed.
*/
public void setMaxSubscribers(int maxSubscribers) {
this.maxSubscribers = maxSubscribers;
Expand All @@ -87,10 +87,12 @@ public void setMaxSubscribers(int maxSubscribers) {
}
}

@Override
public boolean subscribe(MessageHandler handler) {
return this.dispatcher.addHandler(handler);
}

@Override
public boolean unsubscribe(MessageHandler handler) {
return this.dispatcher.removeHandler(handler);
}
Expand Down Expand Up @@ -148,6 +150,7 @@ private DispatchingMessageListener(MessageConverter converter,
}


@Override
public void onMessage(org.springframework.amqp.core.Message message) {
Message<?> messageToSend = null;
try {
Expand Down Expand Up @@ -186,36 +189,43 @@ else if (this.logger.isWarnEnabled()) {
* 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();
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -41,6 +41,8 @@ public PointToPointSubscribableAmqpChannel(String channelName, SimpleMessageList
/**
* Provide a Queue name to be used. If this is not provided,
* the Queue's name will be the same as the channel name.
*
* @param queueName The queue name.
*/
public void setQueueName(String queueName) {
this.queueName = queueName;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2011 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.
Expand All @@ -21,16 +21,16 @@
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.rabbit.core.RabbitAdmin;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.messaging.Message;
import org.springframework.messaging.PollableChannel;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.util.Assert;

/**
* A {@link PollableChannel} implementation that is backed by an AMQP Queue.
* Messages will be sent to the default (no-name) exchange with that Queue's
* name as the routing key.
*
*
* @author Mark Fisher
* @since 2.1
*/
Expand All @@ -54,6 +54,8 @@ public PollableAmqpChannel(String channelName, AmqpTemplate amqpTemplate) {
* Provide an explicitly configured queue name. If this is not provided, then a Queue will be created
* implicitly with the channelName as its name. The implicit creation will require that either an AmqpAdmin
* instance has been provided or that the configured AmqpTemplate is an instance of RabbitTemplate.
*
* @param queueName The queue name.
*/
public void setQueueName(String queueName) {
this.queueName = queueName;
Expand All @@ -63,6 +65,8 @@ public void setQueueName(String queueName) {
* Provide an instance of AmqpAdmin for implicitly declaring Queues if the queueName is not provided.
* When providing a RabbitTemplate implementation, this is not strictly necessary since a RabbitAdmin
* instance can be created from the template's ConnectionFactory reference.
*
* @param amqpAdmin The amqp admin.
*/
public void setAmqpAdmin(AmqpAdmin amqpAdmin) {
this.amqpAdmin = amqpAdmin;
Expand All @@ -73,7 +77,7 @@ protected void onInit() throws Exception {
AmqpTemplate amqpTemplate = this.getAmqpTemplate();
if (this.queueName == null) {
if (this.amqpAdmin == null && amqpTemplate instanceof RabbitTemplate) {
this.amqpAdmin = new RabbitAdmin(((RabbitTemplate) amqpTemplate).getConnectionFactory());
this.amqpAdmin = new RabbitAdmin(((RabbitTemplate) amqpTemplate).getConnectionFactory());
}
Assert.notNull(this.amqpAdmin,
"If no queueName is configured explicitly, an AmqpAdmin instance must be provided, " +
Expand All @@ -88,6 +92,7 @@ protected String getRoutingKey() {
return this.queueName;
}

@Override
public Message<?> receive() {
if (!this.getInterceptors().preReceive(this)) {
return null;
Expand All @@ -106,6 +111,7 @@ public Message<?> receive() {
return this.getInterceptors().postReceive(replyMessage, this) ;
}

@Override
public Message<?> receive(long timeout) {
if (logger.isInfoEnabled()) {
logger.info("Calling receive with a timeout value on PollableAmqpChannel. " +
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -46,6 +46,8 @@ public PublishSubscribeAmqpChannel(String channelName, SimpleMessageListenerCont
* FanoutExchange will be declared implicitly, and its name will be the same
* as the channel name prefixed by "si.fanout.". In either case, an effectively
* anonymous Queue will be declared automatically.
*
* @param exchange The fanout exchange.
*/
public void setExchange(FanoutExchange exchange) {
this.exchange = exchange;
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -149,6 +149,8 @@ public void setInterceptors(List<ChannelInterceptor> interceptors) {
* is not needed for the message-driven (Subscribable) channels
* since those are able to create a RabbitAdmin instance using
* the underlying listener container's ConnectionFactory.
*
* @param amqpAdmin The amqp admin.
*/
public void setAmqpAdmin(AmqpAdmin amqpAdmin) {
this.amqpAdmin = amqpAdmin;
Expand All @@ -158,6 +160,8 @@ public void setAmqpAdmin(AmqpAdmin amqpAdmin) {
* Set the FanoutExchange to use. This is only relevant for
* publish-subscribe-channels, and even then if not provided,
* a FanoutExchange will be implicitly created.
*
* @param exchange The fanout exchange.
*/
public void setExchange(FanoutExchange exchange) {
this.exchange = exchange;
Expand All @@ -167,6 +171,8 @@ public void setExchange(FanoutExchange exchange) {
* Set the Queue name to use. This is only relevant for
* point-to-point channels, even then if not provided,
* a Queue will be implicitly created.
*
* @param queueName The queue name.
*/
public void setQueueName(String queueName) {
this.queueName = queueName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
public class MessageRejectedException extends MessageHandlingException {

/**
* @param failedMessage The failed message.
* @deprecated since 4.0 in favor of {@code MessageRejectedException(Message, String)}
*/
@Deprecated
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 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. You may obtain a copy of the License at
Expand All @@ -20,6 +20,7 @@

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.springframework.integration.IntegrationMessageHeaderAccessor;
import org.springframework.integration.store.MessageGroup;
import org.springframework.integration.support.MessageBuilder;
Expand All @@ -40,6 +41,7 @@ public abstract class AbstractAggregatingMessageGroupProcessor implements Messag

private final Log logger = LogFactory.getLog(this.getClass());

@Override
public final Object processMessageGroup(MessageGroup group) {
Assert.notNull(group, "MessageGroup must not be null");

Expand All @@ -60,6 +62,9 @@ public final Object processMessageGroup(MessageGroup group) {
* This default implementation simply returns all headers that have no conflicts among the group. An absent header
* on one or more Messages within the group is not considered a conflict. Subclasses may override this method with
* more advanced conflict-resolution strategies if necessary.
*
* @param group The message group.
* @return The aggregated headers.
*/
protected Map<String, Object> aggregateHeaders(MessageGroup group) {
Map<String, Object> aggregatedHeaders = new HashMap<String, Object>();
Expand Down
Original file line number Diff line number Diff line change
@@ -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. You may obtain a copy of the License at
Expand All @@ -26,21 +26,20 @@
import org.springframework.integration.IntegrationMessageHeaderAccessor;
import org.springframework.integration.channel.NullChannel;
import org.springframework.integration.core.MessageProducer;
import org.springframework.integration.core.MessagingTemplate;
import org.springframework.integration.handler.AbstractMessageHandler;
import org.springframework.integration.store.MessageGroup;
import org.springframework.integration.store.MessageGroupStore;
import org.springframework.integration.store.MessageGroupStore.MessageGroupCallback;
import org.springframework.integration.store.MessageStore;
import org.springframework.integration.store.SimpleMessageGroup;
import org.springframework.integration.store.SimpleMessageStore;
import org.springframework.integration.support.converter.SimpleMessageConverter;
import org.springframework.integration.util.DefaultLockRegistry;
import org.springframework.integration.util.LockRegistry;
import org.springframework.integration.util.UUIDConverter;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.MessagingException;
import org.springframework.integration.core.MessagingTemplate;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;

Expand Down Expand Up @@ -257,8 +256,8 @@ protected void handleMessageInternal(Message<?> message) throws Exception {

/**
* Allows you to provide additional logic that needs to be performed after the MessageGroup was released.
* @param group
* @param completedMessages
* @param group The group.
* @param completedMessages The completed messages.
*/
protected abstract void afterRelease(MessageGroup group, Collection<Message<?>> completedMessages);

Expand Down
Original file line number Diff line number Diff line change
@@ -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. You may obtain a copy of the License at
Expand All @@ -15,9 +15,9 @@

import java.util.Collection;

import org.springframework.messaging.Message;
import org.springframework.integration.store.MessageGroup;
import org.springframework.integration.store.MessageGroupStore;
import org.springframework.messaging.Message;

/**
* Aggregator specific implementation of {@link AbstractCorrelatingMessageHandler}.
Expand Down Expand Up @@ -46,7 +46,9 @@ public AggregatingMessageHandler(MessageGroupProcessor processor) {
}

/**
* Will set the 'expireGroupsUponCompletion' flag
* Will set the 'expireGroupsUponCompletion' flag.
*
* @param expireGroupsUponCompletion true when groups should be expired on completion.
*
* @see #afterRelease
*/
Expand Down
Loading

0 comments on commit c45b708

Please sign in to comment.