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.
@@ -120,6 +120,8 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl
* Set the {@link Session}. Otherwise, the Session will be created by invocation of
* {@link Session#getInstance(Properties)} or {@link Session#getInstance(Properties, Authenticator)}.
*
* @param session The session.
*
* @see #setJavaMailProperties(Properties)
* @see #setJavaMailAuthenticator(Authenticator)
*/
@@ -132,6 +134,8 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl
* A new {@link Session} will be created with these properties (and the JavaMailAuthenticator if provided).
* Use either this method or {@link #setSession}, but not both.
*
* @param javaMailProperties The javamail properties.
*
* @see #setJavaMailAuthenticator(Authenticator)
* @see #setSession(Session)
*/
@@ -143,6 +147,8 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl
* Optional, sets the Authenticator to be used to obtain a session. This will not be used if
* {@link AbstractMailReceiver#setSession} has been used to configure the {@link Session} directly.
*
* @param javaMailAuthenticator The javamail authenticator.
*
* @see #setSession(Session)
*/
public void setJavaMailAuthenticator(Authenticator javaMailAuthenticator) {
@@ -151,6 +157,8 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl
/**
* Specify the maximum number of Messages to fetch per call to {@link #receive()}.
*
* @param maxFetchSize The max fetch size.
*/
public void setMaxFetchSize(int maxFetchSize) {
this.maxFetchSize = maxFetchSize;
@@ -158,12 +166,16 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl
/**
* Specify whether mail messages should be deleted after retrieval.
*
* @param shouldDeleteMessages true to delete messages.
*/
public void setShouldDeleteMessages(boolean shouldDeleteMessages) {
this.shouldDeleteMessages = shouldDeleteMessages;
}
/**
* Indicates whether the mail messages should be deleted after being received.
*
* @return true when messages will be deleted.
*/
protected boolean shouldDeleteMessages() {
return this.shouldDeleteMessages;
@@ -175,6 +187,9 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl
/**
* Subclasses must implement this method to return new mail messages.
*
* @return An array of messages.
* @throws MessagingException Any MessagingException.
*/
protected abstract Message[] searchForNewMessages() throws MessagingException;
@@ -227,6 +242,7 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl
return this.store.getFolder(this.url);
}
@Override
public Message[] receive() throws javax.mail.MessagingException {
synchronized (this.folderMonitor) {
try {
@@ -363,12 +379,13 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl
* Optional method allowing you to set additional flags.
* Currently only implemented in IMapMailReceiver.
*
* @param message
* @throws MessagingException
* @param message The message.
* @throws MessagingException A MessagingException.
*/
protected void setAdditionalFlags(Message message) throws MessagingException {
}
@Override
public void destroy() throws Exception {
synchronized (this.folderMonitor) {
MailTransportUtils.closeFolder(this.folder, this.shouldDeleteMessages);

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.
@@ -119,6 +119,8 @@ public class ImapIdleChannelAdapter extends MessageProducerSupport implements Be
* Specify whether the IDLE task should reconnect automatically after
* catching a {@link FolderClosedException} while waiting for messages. The
* default value is <code>true</code>.
*
* @param shouldReconnectAutomatically true to reconnect.
*/
public void setShouldReconnectAutomatically(boolean shouldReconnectAutomatically) {
this.shouldReconnectAutomatically = shouldReconnectAutomatically;
@@ -129,6 +131,7 @@ public class ImapIdleChannelAdapter extends MessageProducerSupport implements Be
return "mail:imap-idle-channel-adapter";
}
@Override
public void setBeanClassLoader(ClassLoader classLoader) {
this.classLoader = classLoader;
}
@@ -176,6 +179,7 @@ public class ImapIdleChannelAdapter extends MessageProducerSupport implements Be
private class ReceivingTask implements Runnable {
@Override
public void run() {
try {
idleTask.run();
@@ -194,6 +198,7 @@ public class ImapIdleChannelAdapter extends MessageProducerSupport implements Be
private class IdleTask implements Runnable {
@Override
public void run() {
final TaskScheduler scheduler = getTaskScheduler();
Assert.notNull(scheduler, "'taskScheduler' must not be null" );
@@ -239,6 +244,7 @@ public class ImapIdleChannelAdapter extends MessageProducerSupport implements Be
private Runnable createMessageSendingTask(final Message mailMessage){
Runnable sendingTask = new Runnable() {
@Override
public void run() {
org.springframework.messaging.Message<?> message =
MessageBuilder.withPayload(mailMessage).build();
@@ -282,6 +288,7 @@ public class ImapIdleChannelAdapter extends MessageProducerSupport implements Be
private class PingTask implements Runnable {
@Override
public void run() {
try {
Store store = mailReceiver.getStore();
@@ -299,6 +306,7 @@ public class ImapIdleChannelAdapter extends MessageProducerSupport implements Be
private volatile boolean delayNextExecution;
@Override
public Date nextExecutionTime(TriggerContext triggerContext) {
if (delayNextExecution){
delayNextExecution = false;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 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.
@@ -74,6 +74,8 @@ public class ImapMailReceiver extends AbstractMailReceiver {
/**
* Check if messages should be marked as read.
*
* @return true if messages should be marked as read.
*/
public Boolean isShouldMarkMessagesAsRead() {
return shouldMarkMessagesAsRead;
@@ -83,7 +85,7 @@ public class ImapMailReceiver extends AbstractMailReceiver {
* Provides a way to set custom {@link SearchTermStrategy} to compile a {@link SearchTerm}
* to be applied when retrieving mail
*
* @param searchTermStrategy
* @param searchTermStrategy The search term strategy implementation.
*/
public void setSearchTermStrategy(SearchTermStrategy searchTermStrategy) {
Assert.notNull(searchTermStrategy, "'searchTermStrategy' must not be null");
@@ -92,6 +94,8 @@ public class ImapMailReceiver extends AbstractMailReceiver {
/**
* Specify if messages should be marked as read.
*
* @param shouldMarkMessagesAsRead true if messages should be marked as read.
*/
public void setShouldMarkMessagesAsRead(Boolean shouldMarkMessagesAsRead) {
this.shouldMarkMessagesAsRead = shouldMarkMessagesAsRead;
@@ -100,6 +104,8 @@ public class ImapMailReceiver extends AbstractMailReceiver {
/**
* This method is unique to the IMAP receiver and only works if IMAP IDLE
* is supported (see RFC 2177 for more detail).
*
* @throws MessagingException Any MessagingException.
*/
public void waitForNewMessages() throws MessagingException {
this.openFolder();
@@ -185,6 +191,7 @@ public class ImapMailReceiver extends AbstractMailReceiver {
private class DefaultSearchTermStrategy implements SearchTermStrategy {
@Override
public SearchTerm generateSearchTerm(Flags supportedFlags, Folder folder) {
SearchTerm searchTerm = null;
boolean recentFlagSupported = false;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2007-2011 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.
@@ -94,6 +94,9 @@ public abstract class MailTransportUtils {
/**
* Returns a string representation of the given {@link URLName}, where the
* password has been protected.
*
* @param name The URL name.
* @return The result with password protection.
*/
public static String toPasswordProtectedString(URLName name) {
String protocol = name.getProtocol();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 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.
@@ -33,9 +33,9 @@ public interface SearchTermStrategy {
/**
* Will generate an instance of the {@link SearchTerm}
*
* @param supportedFlags
* @param folder
* @return The search term
* @param supportedFlags The supported flags.
* @param folder The folder.
* @return The search term.
*/
SearchTerm generateSearchTerm(Flags supportedFlags, Folder folder);

View File

@@ -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.
@@ -29,7 +29,7 @@ import org.springframework.util.Assert;
* If the mail message's content is a String, it will be the payload of the
* result Message. If the content is a Multipart, a String will be created from
* an output stream of bytes using the provided charset (or UTF-8 by default).
*
*
* @author Mark Fisher
*/
public class MailToStringTransformer extends AbstractMailMessageTransformer<String> {
@@ -40,6 +40,8 @@ public class MailToStringTransformer extends AbstractMailMessageTransformer<Stri
/**
* Specify the name of the Charset to use when converting from bytes.
* The default is UTF-8.
*
* @param charset The charset.
*/
public void setCharset(String charset) {
Assert.notNull(charset, "charset must not be null");