diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/GenericTypeAwareAutowireCandidateResolver.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/GenericTypeAwareAutowireCandidateResolver.java index c2b7be9cec..3aaf1b15e0 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/GenericTypeAwareAutowireCandidateResolver.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/GenericTypeAwareAutowireCandidateResolver.java @@ -63,8 +63,8 @@ public class GenericTypeAwareAutowireCandidateResolver implements AutowireCandid } /** - * Match the given dependency type with its generic type information - * against the given candidate bean definition. + * Match the given dependency type with its generic type information against the given + * candidate bean definition. */ protected boolean checkGenericTypeMatch(BeanDefinitionHolder bdHolder, DependencyDescriptor descriptor) { ResolvableType dependencyType = descriptor.getResolvableType(); @@ -124,8 +124,8 @@ public class GenericTypeAwareAutowireCandidateResolver implements AutowireCandid /** - * This implementation always returns {@code null}, - * leaving suggested value support up to subclasses. + * This implementation always returns {@code null}, leaving suggested value support up + * to subclasses. */ @Override public Object getSuggestedValue(DependencyDescriptor descriptor) { @@ -133,8 +133,8 @@ public class GenericTypeAwareAutowireCandidateResolver implements AutowireCandid } /** - * This implementation always returns {@code null}, - * leaving lazy resolution support up to subclasses. + * This implementation always returns {@code null}, leaving lazy resolution support up + * to subclasses. */ @Override public Object getLazyResolutionProxyIfNecessary(DependencyDescriptor descriptor, String beanName) { diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ZoneIdEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ZoneIdEditor.java index 4cd104a0bb..63bb9c44e8 100644 --- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ZoneIdEditor.java +++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ZoneIdEditor.java @@ -20,9 +20,8 @@ import java.beans.PropertyEditorSupport; import java.time.ZoneId; /** - * Editor for {@code java.time.ZoneId}, translating zone ID Strings into - * {@code ZoneId} objects. Exposes the {@code TimeZone} ID as a text - * representation. + * Editor for {@code java.time.ZoneId}, translating zone ID Strings into {@code ZoneId} + * objects. Exposes the {@code TimeZone} ID as a text representation. * * @author Nicholas Williams * @since 4.0 diff --git a/spring-context/src/main/java/org/springframework/context/annotation/ContextAnnotationAutowireCandidateResolver.java b/spring-context/src/main/java/org/springframework/context/annotation/ContextAnnotationAutowireCandidateResolver.java index d6fb3e0452..62d8fe840d 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/ContextAnnotationAutowireCandidateResolver.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/ContextAnnotationAutowireCandidateResolver.java @@ -29,9 +29,10 @@ import org.springframework.core.annotation.AnnotationUtils; import org.springframework.util.Assert; /** - * Complete implementation of the {@link org.springframework.beans.factory.support.AutowireCandidateResolver} - * strategy interface, providing support for qualifier annotations as well as for lazy resolution driven - * by the {@link Lazy} annotation in the {@code context.annotation} package. + * Complete implementation of the + * {@link org.springframework.beans.factory.support.AutowireCandidateResolver} strategy + * interface, providing support for qualifier annotations as well as for lazy resolution + * driven by the {@link Lazy} annotation in the {@code context.annotation} package. * * @author Juergen Hoeller * @since 4.0 diff --git a/spring-context/src/main/java/org/springframework/format/datetime/joda/LocalDateParser.java b/spring-context/src/main/java/org/springframework/format/datetime/joda/LocalDateParser.java index d197ccf06e..d398aaa084 100644 --- a/spring-context/src/main/java/org/springframework/format/datetime/joda/LocalDateParser.java +++ b/spring-context/src/main/java/org/springframework/format/datetime/joda/LocalDateParser.java @@ -25,7 +25,8 @@ import org.joda.time.format.DateTimeFormatter; import org.springframework.format.Parser; /** - * Parses Joda {@link org.joda.time.LocalDate} instances using a {@link org.joda.time.format.DateTimeFormatter}. + * Parses Joda {@link org.joda.time.LocalDate} instances using a + * {@link org.joda.time.format.DateTimeFormatter}. * * @author Juergen Hoeller * @since 4.0 diff --git a/spring-context/src/main/java/org/springframework/format/datetime/joda/LocalDateTimeParser.java b/spring-context/src/main/java/org/springframework/format/datetime/joda/LocalDateTimeParser.java index 5867f63828..b91f9a8be7 100644 --- a/spring-context/src/main/java/org/springframework/format/datetime/joda/LocalDateTimeParser.java +++ b/spring-context/src/main/java/org/springframework/format/datetime/joda/LocalDateTimeParser.java @@ -25,7 +25,8 @@ import org.joda.time.format.DateTimeFormatter; import org.springframework.format.Parser; /** - * Parses Joda {@link org.joda.time.LocalDateTime} instances using a {@link org.joda.time.format.DateTimeFormatter}. + * Parses Joda {@link org.joda.time.LocalDateTime} instances using a + * {@link org.joda.time.format.DateTimeFormatter}. * * @author Juergen Hoeller * @since 4.0 diff --git a/spring-context/src/main/java/org/springframework/format/datetime/joda/LocalTimeParser.java b/spring-context/src/main/java/org/springframework/format/datetime/joda/LocalTimeParser.java index d7c86cb62e..4142ec917f 100644 --- a/spring-context/src/main/java/org/springframework/format/datetime/joda/LocalTimeParser.java +++ b/spring-context/src/main/java/org/springframework/format/datetime/joda/LocalTimeParser.java @@ -25,7 +25,8 @@ import org.joda.time.format.DateTimeFormatter; import org.springframework.format.Parser; /** - * Parses Joda {@link org.joda.time.LocalTime} instances using a {@link org.joda.time.format.DateTimeFormatter}. + * Parses Joda {@link org.joda.time.LocalTime} instances using a + * {@link org.joda.time.format.DateTimeFormatter}. * * @author Juergen Hoeller * @since 4.0 diff --git a/spring-context/src/main/java/org/springframework/format/datetime/standard/Jsr310DateTimeFormatAnnotationFormatterFactory.java b/spring-context/src/main/java/org/springframework/format/datetime/standard/Jsr310DateTimeFormatAnnotationFormatterFactory.java index 42f91475fc..0b3597ede1 100644 --- a/spring-context/src/main/java/org/springframework/format/datetime/standard/Jsr310DateTimeFormatAnnotationFormatterFactory.java +++ b/spring-context/src/main/java/org/springframework/format/datetime/standard/Jsr310DateTimeFormatAnnotationFormatterFactory.java @@ -36,8 +36,8 @@ import org.springframework.format.annotation.DateTimeFormat; import org.springframework.util.StringValueResolver; /** - * Formats fields annotated with the {@link DateTimeFormat} annotation using - * the JSR-310 java.time package in JDK 8. + * Formats fields annotated with the {@link DateTimeFormat} annotation using the JSR-310 + * java.time package in JDK 8. * * @author Juergen Hoeller * @since 4.0 diff --git a/spring-context/src/main/java/org/springframework/scripting/support/StandardScriptEvaluator.java b/spring-context/src/main/java/org/springframework/scripting/support/StandardScriptEvaluator.java index 6fc2a6ad8d..d2fd038b27 100644 --- a/spring-context/src/main/java/org/springframework/scripting/support/StandardScriptEvaluator.java +++ b/spring-context/src/main/java/org/springframework/scripting/support/StandardScriptEvaluator.java @@ -33,8 +33,8 @@ import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; /** - * {@code javax.script} (JSR-223) based implementation of - * Spring's {@link ScriptEvaluator} strategy interface. + * {@code javax.script} (JSR-223) based implementation of Spring's {@link ScriptEvaluator} + * strategy interface. * * @author Juergen Hoeller * @author Costin Leau diff --git a/spring-context/src/test/java/org/springframework/context/annotation/AnnotationProcessorPerformanceTests.java b/spring-context/src/test/java/org/springframework/context/annotation/AnnotationProcessorPerformanceTests.java index f1e5406abd..aa08f0d7ad 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/AnnotationProcessorPerformanceTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/AnnotationProcessorPerformanceTests.java @@ -119,7 +119,7 @@ public class AnnotationProcessorPerformanceTests { @Test public void testPrototypeCreationWithOverriddenAutowiredPropertiesIsFastEnough() { - Assume.group(TestGroup.PERFORMANCE); + // Assume.group(TestGroup.PERFORMANCE); Assume.notLogging(factoryLog); GenericApplicationContext ctx = new GenericApplicationContext(); AnnotationConfigUtils.registerAnnotationConfigProcessors(ctx); @@ -138,7 +138,7 @@ public class AnnotationProcessorPerformanceTests { assertSame(spouse, tb.getSpouse()); } sw.stop(); - //System.out.println(sw.getTotalTimeMillis()); + System.out.println(sw.getTotalTimeMillis()); assertTrue("Prototype creation took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 4500); } diff --git a/spring-core/src/main/java/org/springframework/core/StandardReflectionParameterNameDiscoverer.java b/spring-core/src/main/java/org/springframework/core/StandardReflectionParameterNameDiscoverer.java index b77ba06c19..92014fed84 100644 --- a/spring-core/src/main/java/org/springframework/core/StandardReflectionParameterNameDiscoverer.java +++ b/spring-core/src/main/java/org/springframework/core/StandardReflectionParameterNameDiscoverer.java @@ -21,8 +21,8 @@ import java.lang.reflect.Method; import java.lang.reflect.Parameter; /** - * {@link ParameterNameDiscoverer} implementation which uses JDK 8's - * reflection facilities for introspecting parameter names. + * {@link ParameterNameDiscoverer} implementation which uses JDK 8's reflection facilities + * for introspecting parameter names. * * @author Juergen Hoeller * @since 4.0 diff --git a/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java b/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java index da50710602..d32a2910d3 100644 --- a/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java +++ b/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java @@ -27,7 +27,8 @@ import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; /** - * Utility class used to collect all annotation values including those declared on meta-annotations. + * Utility class used to collect all annotation values including those declared on + * meta-annotations. * * @author Phillip Webb * @author Juergen Hoeller diff --git a/spring-core/src/main/java/org/springframework/util/AlternativeJdkIdGenerator.java b/spring-core/src/main/java/org/springframework/util/AlternativeJdkIdGenerator.java index 4011e0590c..604b508b7e 100644 --- a/spring-core/src/main/java/org/springframework/util/AlternativeJdkIdGenerator.java +++ b/spring-core/src/main/java/org/springframework/util/AlternativeJdkIdGenerator.java @@ -22,9 +22,9 @@ import java.util.Random; import java.util.UUID; /** - * A variation of {@link UUID#randomUUID()} that uses {@link SecureRandom} only for - * the initial seed and {@link Random} thereafter. This provides better performance - * in exchange for less securely random id's. + * A variation of {@link UUID#randomUUID()} that uses {@link SecureRandom} only for the + * initial seed and {@link Random} thereafter. This provides better performance in + * exchange for less securely random id's. * * @author Rossen Stoyanchev * @author Rob Winch diff --git a/spring-core/src/main/java/org/springframework/util/MimeType.java b/spring-core/src/main/java/org/springframework/util/MimeType.java index b8a7f337b0..5ef5a7705d 100644 --- a/spring-core/src/main/java/org/springframework/util/MimeType.java +++ b/spring-core/src/main/java/org/springframework/util/MimeType.java @@ -171,7 +171,8 @@ public class MimeType implements Comparable, Serializable { } /** - * Checks the given token string for illegal characters, as defined in RFC 2616, section 2.2. + * Checks the given token string for illegal characters, as defined in RFC 2616, + * section 2.2. * @throws IllegalArgumentException in case of illegal characters * @see HTTP 1.1, section 2.2 */ @@ -214,15 +215,17 @@ public class MimeType implements Comparable, Serializable { } /** - * Indicates whether the {@linkplain #getType() type} is the wildcard character {@code *} or not. + * Indicates whether the {@linkplain #getType() type} is the wildcard character + * {@code *} or not. */ public boolean isWildcardType() { return WILDCARD_TYPE.equals(getType()); } /** - * Indicates whether the {@linkplain #getSubtype() subtype} is the wildcard character {@code *} - * or the wildcard character followed by a sufiix (e.g. {@code *+xml}), or not. + * Indicates whether the {@linkplain #getSubtype() subtype} is the wildcard character + * {@code *} or the wildcard character followed by a sufiix (e.g. + * {@code *+xml}), or not. * @return whether the subtype is {@code *} */ public boolean isWildcardSubtype() { @@ -230,8 +233,8 @@ public class MimeType implements Comparable, Serializable { } /** - * Indicates whether this media type is concrete, i.e. whether neither the type or subtype is a wildcard - * character {@code *}. + * Indicates whether this media type is concrete, i.e. whether neither the type or + * subtype is a wildcard character {@code *}. * @return whether this media type is concrete */ public boolean isConcrete() { @@ -280,10 +283,12 @@ public class MimeType implements Comparable, Serializable { /** * Indicate whether this {@code MediaType} includes the given media type. - *

For instance, {@code text/*} includes {@code text/plain} and {@code text/html}, and {@code application/*+xml} - * includes {@code application/soap+xml}, etc. This method is not symmetric. + *

For instance, {@code text/*} includes {@code text/plain} and {@code text/html}, + * and {@code application/*+xml} includes {@code application/soap+xml}, etc. This + * method is not symmetric. * @param other the reference media type with which to compare - * @return {@code true} if this media type includes the given media type; {@code false} otherwise + * @return {@code true} if this media type includes the given media type; + * {@code false} otherwise */ public boolean includes(MimeType other) { if (other == null) { diff --git a/spring-core/src/main/java/org/springframework/util/MimeTypeUtils.java b/spring-core/src/main/java/org/springframework/util/MimeTypeUtils.java index 750e2232c6..2b2cd16fcf 100644 --- a/spring-core/src/main/java/org/springframework/util/MimeTypeUtils.java +++ b/spring-core/src/main/java/org/springframework/util/MimeTypeUtils.java @@ -29,6 +29,7 @@ import java.util.Map; import org.springframework.util.MimeType.SpecificityComparator; /** + * Miscellaneous {@link MimeType} utility methods. * * @author Arjen Poutsma * @author Rossen Stoyanchev @@ -289,8 +290,7 @@ public abstract class MimeTypeUtils { /** * Sorts the given list of {@code MimeType} objects by specificity. - *

- * Given two mime types: + *

Given two mime types: *

    *
  1. if either mime type has a {@linkplain MimeType#isWildcardType() wildcard type}, * then the mime type without the wildcard is ordered before the other.
  2. @@ -304,12 +304,10 @@ public abstract class MimeTypeUtils { * {@linkplain MimeType#getParameter(String) parameters}, then the mime type with the most * parameters is ordered before the other. *
- *

- * For example:

audio/basic < audio/* < */*
+ *

For example:

audio/basic < audio/* < */*
*
audio/basic;level=1 < audio/basic
*
audio/basic == text/html
audio/basic == * audio/wave
- * * @param mimeTypes the list of mime types to be sorted * @see HTTP 1.1, section * 14.1 diff --git a/spring-core/src/main/java/org/springframework/util/SocketUtils.java b/spring-core/src/main/java/org/springframework/util/SocketUtils.java index 4f6958ca71..28444526ad 100644 --- a/spring-core/src/main/java/org/springframework/util/SocketUtils.java +++ b/spring-core/src/main/java/org/springframework/util/SocketUtils.java @@ -29,7 +29,7 @@ import javax.net.ServerSocketFactory; * for finding available ports on {@code localhost}. * *

Within this class, a TCP port refers to a port for a {@link ServerSocket}; - * whereas, a UDP port refers to a port for a {@link DatagramSocket}. + * whereas, a UDP port refers to a port for a {@link DatagramSocket}. * * @author Sam Brannen * @author Ben Hale @@ -37,7 +37,7 @@ import javax.net.ServerSocketFactory; * @author Gunnar Hillert * @since 4.0 */ -public final class SocketUtils { +public abstract class SocketUtils { /** * The default minimum value for port ranges used when finding an available @@ -51,13 +51,14 @@ public final class SocketUtils { */ public static final int PORT_RANGE_MAX = 65535; + private static final Random random = new Random(System.currentTimeMillis()); /** * Although {@code SocketUtils} consists solely of static utility methods, * this constructor is intentionally {@code public}. - * + * *

Rationale

* *

Static methods from this class may be invoked from within XML @@ -81,10 +82,10 @@ public final class SocketUtils { /* no-op */ } + /** * Find an available TCP port randomly selected from the range * [{@value #PORT_RANGE_MIN}, {@value #PORT_RANGE_MAX}]. - * * @return an available TCP port number * @throws IllegalStateException if no available port could be found */ @@ -95,7 +96,6 @@ public final class SocketUtils { /** * Find an available TCP port randomly selected from the range * [{@code minPort}, {@value #PORT_RANGE_MAX}]. - * * @param minPort the minimum port number * @return an available TCP port number * @throws IllegalStateException if no available port could be found @@ -107,7 +107,6 @@ public final class SocketUtils { /** * Find an available TCP port randomly selected from the range * [{@code minPort}, {@code maxPort}]. - * * @param minPort the minimum port number * @param maxPort the maximum port number * @return an available TCP port number @@ -120,7 +119,6 @@ public final class SocketUtils { /** * Find the requested number of available TCP ports, each randomly selected * from the range [{@value #PORT_RANGE_MIN}, {@value #PORT_RANGE_MAX}]. - * * @param numRequested the number of available ports to find * @return a sorted set of available TCP port numbers * @throws IllegalStateException if the requested number of available ports could not be found @@ -132,7 +130,6 @@ public final class SocketUtils { /** * Find the requested number of available TCP ports, each randomly selected * from the range [{@code minPort}, {@code maxPort}]. - * * @param numRequested the number of available ports to find * @param minPort the minimum port number * @param maxPort the maximum port number @@ -146,7 +143,6 @@ public final class SocketUtils { /** * Find an available UDP port randomly selected from the range * [{@value #PORT_RANGE_MIN}, {@value #PORT_RANGE_MAX}]. - * * @return an available UDP port number * @throws IllegalStateException if no available port could be found */ @@ -157,7 +153,6 @@ public final class SocketUtils { /** * Find an available UDP port randomly selected from the range * [{@code minPort}, {@value #PORT_RANGE_MAX}]. - * * @param minPort the minimum port number * @return an available UDP port number * @throws IllegalStateException if no available port could be found @@ -169,7 +164,6 @@ public final class SocketUtils { /** * Find an available UDP port randomly selected from the range * [{@code minPort}, {@code maxPort}]. - * * @param minPort the minimum port number * @param maxPort the maximum port number * @return an available UDP port number @@ -182,7 +176,6 @@ public final class SocketUtils { /** * Find the requested number of available UDP ports, each randomly selected * from the range [{@value #PORT_RANGE_MIN}, {@value #PORT_RANGE_MAX}]. - * * @param numRequested the number of available ports to find * @return a sorted set of available UDP port numbers * @throws IllegalStateException if the requested number of available ports could not be found @@ -194,7 +187,6 @@ public final class SocketUtils { /** * Find the requested number of available UDP ports, each randomly selected * from the range [{@code minPort}, {@code maxPort}]. - * * @param numRequested the number of available ports to find * @param minPort the minimum port number * @param maxPort the maximum port number @@ -247,7 +239,6 @@ public final class SocketUtils { /** * Find a pseudo-random port number within the range * [{@code minPort}, {@code maxPort}]. - * * @param minPort the minimum port number * @param maxPort the maximum port number * @return a random port number within the specified range @@ -260,7 +251,6 @@ public final class SocketUtils { /** * Find an available port for this {@code SocketType}, randomly selected * from the range [{@code minPort}, {@code maxPort}]. - * * @param minPort the minimum port number * @param maxPort the maximum port number * @return an available port number for this socket type @@ -289,7 +279,6 @@ public final class SocketUtils { /** * Find the requested number of available ports for this {@code SocketType}, * each randomly selected from the range [{@code minPort}, {@code maxPort}]. - * * @param numRequested the number of available ports to find * @param minPort the minimum port number * @param maxPort the maximum port number diff --git a/spring-core/src/main/java/org/springframework/util/concurrent/ListenableFutureTask.java b/spring-core/src/main/java/org/springframework/util/concurrent/ListenableFutureTask.java index 79b5e334b5..f5f5612cba 100644 --- a/spring-core/src/main/java/org/springframework/util/concurrent/ListenableFutureTask.java +++ b/spring-core/src/main/java/org/springframework/util/concurrent/ListenableFutureTask.java @@ -33,8 +33,8 @@ public class ListenableFutureTask extends FutureTask new ListenableFutureCallbackRegistry(); /** - * Creates a new {@code ListenableFutureTask} that will, upon running, execute the given - * {@link Callable}. + * Creates a new {@code ListenableFutureTask} that will, upon running, execute the + * given {@link Callable}. * @param callable the callable task */ public ListenableFutureTask(Callable callable) { diff --git a/spring-core/src/test/java/org/springframework/util/SocketUtilsTests.java b/spring-core/src/test/java/org/springframework/util/SocketUtilsTests.java index e69767c491..dd5767cd58 100644 --- a/spring-core/src/test/java/org/springframework/util/SocketUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/util/SocketUtilsTests.java @@ -27,7 +27,6 @@ import static org.springframework.util.SocketUtils.*; * Unit tests for {@link SocketUtils}. * * @author Sam Brannen - * @since 4.0 */ public class SocketUtilsTests { diff --git a/spring-messaging/src/main/java/org/springframework/messaging/MessageChannel.java b/spring-messaging/src/main/java/org/springframework/messaging/MessageChannel.java index 2907230b2c..5321a3beba 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/MessageChannel.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/MessageChannel.java @@ -35,7 +35,6 @@ public interface MessageChannel { * non-recoverable errors. Otherwise, if the Message cannot be sent for a non-fatal * reason this method will return 'false', and if the Message is sent successfully, it * will return 'true'. - * *

Depending on the implementation, this method may block indefinitely. To provide a * maximum wait time, use {@link #send(Message, long)}. * @param message the {@link Message} to send diff --git a/spring-messaging/src/main/java/org/springframework/messaging/MessageHandler.java b/spring-messaging/src/main/java/org/springframework/messaging/MessageHandler.java index 65af926ff3..39b88b860f 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/MessageHandler.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/MessageHandler.java @@ -32,11 +32,9 @@ public interface MessageHandler { * message, but fails to do so, a {@code MessageHandlingException} is * thrown. In the last case it is recommended to treat the message as tainted * and go into an error scenario. - *

- * When the handling results in a failure of another message being sent + *

When the handling results in a failure of another message being sent * (e.g. a "reply" message), that failure will trigger a * {@code MessageDeliveryException}. - * * @param message the message to be handled * reply related to the handling of the message */ diff --git a/spring-messaging/src/main/java/org/springframework/messaging/MessageHeaders.java b/spring-messaging/src/main/java/org/springframework/messaging/MessageHeaders.java index 47f672dcef..c5f3502f68 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/MessageHeaders.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/MessageHeaders.java @@ -100,6 +100,7 @@ public final class MessageHeaders implements Map, Serializable { this.headers.put(TIMESTAMP, new Long(System.currentTimeMillis())); } + public UUID getId() { return this.get(ID, UUID.class); } @@ -109,12 +110,12 @@ public final class MessageHeaders implements Map, Serializable { } public Object getReplyChannel() { - return this.get(REPLY_CHANNEL); - } + return this.get(REPLY_CHANNEL); + } - public Object getErrorChannel() { - return this.get(ERROR_CHANNEL); - } + public Object getErrorChannel() { + return this.get(ERROR_CHANNEL); + } @SuppressWarnings("unchecked") public T get(Object key, Class type) { diff --git a/spring-messaging/src/main/java/org/springframework/messaging/PollableChannel.java b/spring-messaging/src/main/java/org/springframework/messaging/PollableChannel.java index 92c5e3538e..5254fb4ff6 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/PollableChannel.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/PollableChannel.java @@ -35,9 +35,9 @@ public interface PollableChannel extends MessageChannel { * Receive a message from this channel, blocking until either a message is available * or the specified timeout period elapses. * @param timeout the timeout in milliseconds or - * {@link MessageChannel#INDEFINITE_TIMEOUT}. + * {@link MessageChannel#INDEFINITE_TIMEOUT}. * @return the next available {@link Message} or {@code null} if the specified timeout - * period elapses or the message reception is interrupted + * period elapses or the message reception is interrupted */ Message receive(long timeout); diff --git a/spring-messaging/src/main/java/org/springframework/messaging/SubscribableChannel.java b/spring-messaging/src/main/java/org/springframework/messaging/SubscribableChannel.java index c7b895c116..9cb0b8b04d 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/SubscribableChannel.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/SubscribableChannel.java @@ -16,7 +16,6 @@ package org.springframework.messaging; - /** * Interface for any MessageChannel implementation that accepts subscribers. * The subscribers must implement the {@link MessageHandler} interface and @@ -30,14 +29,14 @@ public interface SubscribableChannel extends MessageChannel { /** * Register a {@link MessageHandler} as a subscriber to this channel. * @return {@code true} if the channel was not already subscribed to the specified - * handler + * handler */ boolean subscribe(MessageHandler handler); /** * Remove a {@link MessageHandler} from the subscribers of this channel. * @return {@code true} if the channel was previously subscribed to the specified - * handler + * handler */ boolean unsubscribe(MessageHandler handler); diff --git a/spring-messaging/src/main/java/org/springframework/messaging/core/BeanFactoryMessageChannelDestinationResolver.java b/spring-messaging/src/main/java/org/springframework/messaging/core/BeanFactoryMessageChannelDestinationResolver.java index ad0e2b35b4..36bc979d9a 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/core/BeanFactoryMessageChannelDestinationResolver.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/core/BeanFactoryMessageChannelDestinationResolver.java @@ -21,8 +21,10 @@ import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.messaging.MessageChannel; import org.springframework.util.Assert; - /** + * {@link DestinationResolver} that resolves against named beans contained in a + * {@link BeanFactory}. + * * @author Mark Fisher * @since 4.0 */ @@ -36,7 +38,6 @@ public class BeanFactoryMessageChannelDestinationResolver implements Destination *

The BeanFactory to access must be set via setBeanFactory. * This will happen automatically if this resolver is defined within an * ApplicationContext thereby receiving the callback upon initialization. - * * @see #setBeanFactory */ public BeanFactoryMessageChannelDestinationResolver() { @@ -51,7 +52,6 @@ public class BeanFactoryMessageChannelDestinationResolver implements Destination * replaced by the {@link BeanFactory} that creates it (c.f. the * {@link BeanFactoryAware} contract). So only use this constructor if you * are instantiating this object explicitly rather than defining a bean. - * * @param beanFactory the bean factory to be used to lookup {@link MessageChannel}s. */ public BeanFactoryMessageChannelDestinationResolver(BeanFactory beanFactory) { @@ -62,7 +62,7 @@ public class BeanFactoryMessageChannelDestinationResolver implements Destination @Override public MessageChannel resolveDestination(String name) { - Assert.state(this.beanFactory != null, "BeanFactory is required"); + Assert.state(this.beanFactory != null, "BeanFactory must not be null"); try { return this.beanFactory.getBean(name, MessageChannel.class); } diff --git a/spring-messaging/src/main/java/org/springframework/messaging/core/DestinationResolvingMessageReceivingOperations.java b/spring-messaging/src/main/java/org/springframework/messaging/core/DestinationResolvingMessageReceivingOperations.java index d109788342..1eca928832 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/core/DestinationResolvingMessageReceivingOperations.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/core/DestinationResolvingMessageReceivingOperations.java @@ -18,7 +18,6 @@ package org.springframework.messaging.core; import org.springframework.messaging.Message; import org.springframework.messaging.MessagingException; - /** * A {@link MessageReceivingOperations} that can resolve a String-based destinations. * diff --git a/spring-messaging/src/main/java/org/springframework/messaging/core/DestinationResolvingMessageRequestReplyOperations.java b/spring-messaging/src/main/java/org/springframework/messaging/core/DestinationResolvingMessageRequestReplyOperations.java index 48ad64e881..a562582b58 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/core/DestinationResolvingMessageRequestReplyOperations.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/core/DestinationResolvingMessageRequestReplyOperations.java @@ -20,7 +20,6 @@ import java.util.Map; import org.springframework.messaging.Message; import org.springframework.messaging.MessagingException; - /** * A {@link MessageRequestReplyOperations} that can resolve a String-based destinations. * diff --git a/spring-messaging/src/main/java/org/springframework/messaging/core/DestinationResolvingMessageSendingOperations.java b/spring-messaging/src/main/java/org/springframework/messaging/core/DestinationResolvingMessageSendingOperations.java index 1c1ccf5429..0f9e7b69ce 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/core/DestinationResolvingMessageSendingOperations.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/core/DestinationResolvingMessageSendingOperations.java @@ -20,7 +20,6 @@ import java.util.Map; import org.springframework.messaging.Message; import org.springframework.messaging.MessagingException; - /** * A {@link MessageSendingOperations} that can resolve a String-based destinations. * diff --git a/spring-messaging/src/main/java/org/springframework/messaging/core/GenericMessagingTemplate.java b/spring-messaging/src/main/java/org/springframework/messaging/core/GenericMessagingTemplate.java index 5a9786e9e0..efa019ef8d 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/core/GenericMessagingTemplate.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/core/GenericMessagingTemplate.java @@ -31,7 +31,6 @@ import org.springframework.messaging.PollableChannel; import org.springframework.messaging.support.MessageBuilder; import org.springframework.util.Assert; - /** * A messaging template for sending to and/or receiving messages from a * {@link MessageChannel}. diff --git a/spring-messaging/src/main/java/org/springframework/messaging/core/MessageReceivingOperations.java b/spring-messaging/src/main/java/org/springframework/messaging/core/MessageReceivingOperations.java index afede2f8e4..41a4d681a9 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/core/MessageReceivingOperations.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/core/MessageReceivingOperations.java @@ -18,7 +18,6 @@ package org.springframework.messaging.core; import org.springframework.messaging.Message; import org.springframework.messaging.MessagingException; - /** * A set of operations receiving messages from a destination. * diff --git a/spring-messaging/src/main/java/org/springframework/messaging/core/MessageRequestReplyOperations.java b/spring-messaging/src/main/java/org/springframework/messaging/core/MessageRequestReplyOperations.java index 88ee719cdb..4354193202 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/core/MessageRequestReplyOperations.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/core/MessageRequestReplyOperations.java @@ -20,7 +20,6 @@ import java.util.Map; import org.springframework.messaging.Message; import org.springframework.messaging.MessagingException; - /** * A set of operations for exchanging messages to and from a destination. * diff --git a/spring-messaging/src/main/java/org/springframework/messaging/core/MessageSendingOperations.java b/spring-messaging/src/main/java/org/springframework/messaging/core/MessageSendingOperations.java index 32b7ed5817..a5407d5f86 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/core/MessageSendingOperations.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/core/MessageSendingOperations.java @@ -20,7 +20,6 @@ import java.util.Map; import org.springframework.messaging.Message; import org.springframework.messaging.MessagingException; - /** * A set of operations sending messages to a destination. * diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/Header.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/Header.java index 31ef8cb613..0d4f1d2637 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/Header.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/Header.java @@ -22,7 +22,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; - /** * Annotation which indicates that a method parameter should be bound to a message header. * diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/Headers.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/Headers.java index 460ef8b70d..93eef2a1e0 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/Headers.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/Headers.java @@ -22,7 +22,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; - /** * Annotation which indicates that a method parameter should be bound to the headers of a * message. The annotated parameter must be assignable to {@link java.util.Map} with diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/MessageExceptionHandler.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/MessageExceptionHandler.java index 6fed9a259f..f7fdc4086d 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/MessageExceptionHandler.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/MessageExceptionHandler.java @@ -23,12 +23,10 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; - /** * Annotation for handling exceptions from message-handling methods within specific * handler methods. * - * * @author Rossen Stoyanchev * @since 4.0 */ diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/MessageMapping.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/MessageMapping.java index 7b91921aa9..64800d1726 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/MessageMapping.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/MessageMapping.java @@ -24,7 +24,6 @@ import java.lang.annotation.Target; import org.springframework.messaging.Message; - /** * Annotation for mapping a {@link Message} onto message-handling methods by matching * to the message destination. This annotation can also be used on the type-level in @@ -32,8 +31,8 @@ import org.springframework.messaging.Message; * annotations including method-level * {@link org.springframework.messaging.simp.annotation.SubscribeMapping @SubscribeMapping} * annotations. - *

- * Handler methods which are annotated with this annotation are allowed to have + * + *

Handler methods which are annotated with this annotation are allowed to have * flexible signatures. They may have arguments of the following types, in arbitrary * order: *

    @@ -62,12 +61,12 @@ import org.springframework.messaging.Message; * WebSocket session on which the message was received. Regular HTTP-based * authentication (e.g. Spring Security based) can be used to secure the * HTTP handshake that initiates WebSocket sessions. - *
- *

- * By default the return value is wrapped as a message and sent to the destination + * + *

By default the return value is wrapped as a message and sent to the destination * specified with an {@link SendTo} method-level annotation. - *

- * STOMP over WebSocket: an {@link SendTo} annotation is not strictly required -- + * + *

STOMP over WebSocket: an {@link SendTo} annotation is not strictly required -- * by default the message will be sent to the same destination as the incoming * message but with an additional prefix ("/topic" by default). It is also possible * to use {@link org.springframework.messaging.simp.annotation.SendToUser} to @@ -87,8 +86,7 @@ public @interface MessageMapping { /** * Destination-based mapping expressed by this annotation. - *

- * For STOMP over WebSocket messages: this is the destination of the STOMP message + *

For STOMP over WebSocket messages: this is the destination of the STOMP message * (e.g. "/positions"). Ant-style path patterns (e.g. "/price.stock.*") are supported * and so are path template variables (e.g. "/price.stock.{ticker}""). */ diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/Payload.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/Payload.java index af40fa889a..c2dfdfbd17 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/Payload.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/Payload.java @@ -24,7 +24,6 @@ import java.lang.annotation.Target; import org.springframework.messaging.support.converter.MessageConverter; - /** * Annotation that binds a method parameter to the payload of a message. The payload may * be passed through a {@link MessageConverter} to convert it from serialized form with a @@ -43,16 +42,14 @@ public @interface Payload { * This attribute may or may not be supported depending on whether the message being * handled contains a non-primitive Object as its payload or is in serialized form * and requires message conversion. - *

- * When processing STOMP over WebSocket messages this attribute is not supported. + *

When processing STOMP over WebSocket messages this attribute is not supported. */ String value() default ""; /** * Whether payload content is required. - *

- * Default is {@code true}, leading to an exception if there is no payload. Switch to - * {@code false} to have {@code null} passed when there is no payload. + *

Default is {@code true}, leading to an exception if there is no payload. Switch + * to {@code false} to have {@code null} passed when there is no payload. */ boolean required() default true; diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/SendTo.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/SendTo.java index 9704f8e0a6..8cfc90dcef 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/SendTo.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/SendTo.java @@ -24,7 +24,6 @@ import java.lang.annotation.Target; import org.springframework.messaging.Message; - /** * Annotation that indicates a method's return value should be converted to * a {@link Message} and sent to the specified destination. diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/AbstractNamedValueMethodArgumentResolver.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/AbstractNamedValueMethodArgumentResolver.java index a8341ab7e0..7a1027c638 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/AbstractNamedValueMethodArgumentResolver.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/AbstractNamedValueMethodArgumentResolver.java @@ -33,7 +33,6 @@ import org.springframework.messaging.handler.method.HandlerMethodArgumentResolve import org.springframework.util.Assert; import org.springframework.util.ClassUtils; - /** * Abstract base class for resolving method arguments from a named value. Message headers, * and path variables are examples of named values. Each may have a name, a required flag, diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/AnnotationExceptionHandlerMethodResolver.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/AnnotationExceptionHandlerMethodResolver.java index 44b13fd6f1..289c573707 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/AnnotationExceptionHandlerMethodResolver.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/AnnotationExceptionHandlerMethodResolver.java @@ -29,7 +29,6 @@ import org.springframework.messaging.handler.method.AbstractExceptionHandlerMeth import org.springframework.messaging.handler.method.HandlerMethodSelector; import org.springframework.util.ReflectionUtils.MethodFilter; - /** * A sub-class of {@link AbstractExceptionHandlerMethodResolver} that looks for * {@link MessageExceptionHandler}-annotated methods in a given class. The actual diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/HeaderMethodArgumentResolver.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/HeaderMethodArgumentResolver.java index c3b7a7153f..a46013f5e1 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/HeaderMethodArgumentResolver.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/HeaderMethodArgumentResolver.java @@ -22,7 +22,6 @@ import org.springframework.core.convert.ConversionService; import org.springframework.messaging.Message; import org.springframework.messaging.handler.annotation.Header; - /** * Resolves method parameters annotated with {@link Header @Header}. * diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/HeadersMethodArgumentResolver.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/HeadersMethodArgumentResolver.java index 3be9f9a48b..66d6575ebd 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/HeadersMethodArgumentResolver.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/HeadersMethodArgumentResolver.java @@ -29,7 +29,6 @@ import org.springframework.messaging.support.MessageHeaderAccessor; import org.springframework.util.ClassUtils; import org.springframework.util.ReflectionUtils; - /** * Resolves the following method parameters: *

    diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/MessageHandlingException.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/MessageHandlingException.java index c2f07a91bd..8f41a79fc8 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/MessageHandlingException.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/MessageHandlingException.java @@ -19,7 +19,6 @@ package org.springframework.messaging.handler.annotation.support; import org.springframework.messaging.Message; import org.springframework.messaging.MessagingException; - /** * Thrown when the handling of a message results in an unrecoverable exception. * diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/MessageMethodArgumentResolver.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/MessageMethodArgumentResolver.java index 9ef044c0cb..48c4939565 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/MessageMethodArgumentResolver.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/MessageMethodArgumentResolver.java @@ -20,7 +20,6 @@ import org.springframework.core.MethodParameter; import org.springframework.messaging.Message; import org.springframework.messaging.handler.method.HandlerMethodArgumentResolver; - /** * A {@link HandlerMethodArgumentResolver} for {@link Message} parameters. * diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/PayloadArgumentResolver.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/PayloadArgumentResolver.java index fa42fcf175..69527c806f 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/PayloadArgumentResolver.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/PayloadArgumentResolver.java @@ -25,13 +25,11 @@ import org.springframework.util.Assert; import org.springframework.util.ClassUtils; import org.springframework.util.StringUtils; - /** * A resolver to extract and convert the payload of a message using a * {@link MessageConverter}. * - *

    - * This {@link HandlerMethodArgumentResolver} should be ordered last as it supports all + *

    This {@link HandlerMethodArgumentResolver} should be ordered last as it supports all * types and does not require the {@link Payload} annotation. * * @author Rossen Stoyanchev @@ -43,7 +41,7 @@ public class PayloadArgumentResolver implements HandlerMethodArgumentResolver { public PayloadArgumentResolver(MessageConverter messageConverter) { - Assert.notNull(messageConverter, "converter is required"); + Assert.notNull(messageConverter, "converter must not be null"); this.converter = messageConverter; } diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/condition/AbstractMessageCondition.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/condition/AbstractMessageCondition.java index fb6098ffae..ad6ea0cb3d 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/condition/AbstractMessageCondition.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/condition/AbstractMessageCondition.java @@ -28,7 +28,6 @@ import java.util.Iterator; */ public abstract class AbstractMessageCondition> implements MessageCondition { - /** * @return the collection of objects the message condition is composed of * (e.g. destination patterns), never {@code null} diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/condition/DestinationPatternsMessageCondition.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/condition/DestinationPatternsMessageCondition.java index a3ef608862..93d2bbe0c5 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/condition/DestinationPatternsMessageCondition.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/condition/DestinationPatternsMessageCondition.java @@ -59,7 +59,6 @@ public final class DestinationPatternsMessageCondition /** * Additional constructor with flags for using suffix pattern (.*) and * trailing slash matches. - * * @param patterns the URL patterns to use; if 0, the condition will match to every request. * @param pathMatcher for path matching with patterns */ @@ -140,12 +139,10 @@ public final class DestinationPatternsMessageCondition * Check if any of the patterns match the given Message destination and return an instance * that is guaranteed to contain matching patterns, sorted via * {@link org.springframework.util.PathMatcher#getPatternComparator(String)}. - * * @param message the message to match to - * * @return the same instance if the condition contains no patterns; - * or a new condition with sorted matching patterns; - * or {@code null} either if a destination can not be extracted or there is no match + * or a new condition with sorted matching patterns; + * or {@code null} either if a destination can not be extracted or there is no match */ @Override public DestinationPatternsMessageCondition getMatchingCondition(Message message) { @@ -180,7 +177,6 @@ public final class DestinationPatternsMessageCondition * {@link org.springframework.util.PathMatcher#getPatternComparator(String)}. * If all compared patterns match equally, but one instance has more patterns, * it is considered a closer match. - * *

    It is assumed that both instances have been obtained via * {@link #getMatchingCondition(Message)} to ensure they * contain only patterns that match the request and are sorted with diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/condition/MessageCondition.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/condition/MessageCondition.java index a723c308a3..c828827f8f 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/condition/MessageCondition.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/condition/MessageCondition.java @@ -18,7 +18,6 @@ package org.springframework.messaging.handler.condition; import org.springframework.messaging.Message; - /** * Contract for mapping conditions to messages. * @@ -26,8 +25,7 @@ import org.springframework.messaging.Message; * matched to a specific Message, as well as compared to each other in the * context of a Message to determine which one matches a request more closely. * - * @param The kind of condition that this condition can be combined - * with or compared to + * @param The kind of condition that this condition can be combined with or compared to * * @author Rossen Stoyanchev * @since 4.0 @@ -37,7 +35,6 @@ public interface MessageCondition { /** * Define the rules for combining this condition with another. * For example combining type- and method-level conditions. - * * @param other the condition to combine with * @return the resulting message condition */ @@ -48,9 +45,7 @@ public interface MessageCondition { * potentially new condition with content tailored to the current message. * For example a condition with destination patterns might return a new * condition with sorted, matching patterns only. - * - * @return a condition instance in case of a match; - * or {@code null} if there is no match. + * @return a condition instance in case of a match; or {@code null} if there is no match. */ T getMatchingCondition(Message message); diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/method/AbstractExceptionHandlerMethodResolver.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/method/AbstractExceptionHandlerMethodResolver.java index dbdcc38705..75d1d2495e 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/method/AbstractExceptionHandlerMethodResolver.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/method/AbstractExceptionHandlerMethodResolver.java @@ -46,7 +46,7 @@ public abstract class AbstractExceptionHandlerMethodResolver { * Protected constructor accepting exception-to-method mappings. */ protected AbstractExceptionHandlerMethodResolver(Map, Method> mappedMethods) { - Assert.notNull(mappedMethods, "'mappedMethods' is required"); + Assert.notNull(mappedMethods, "Mapped Methods must not be null"); this.mappedMethods.putAll(mappedMethods); } diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/method/AbstractMethodMessageHandler.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/method/AbstractMethodMessageHandler.java index 4dd3734d7a..dd94fa3fac 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/method/AbstractMethodMessageHandler.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/method/AbstractMethodMessageHandler.java @@ -41,8 +41,8 @@ import java.util.concurrent.ConcurrentHashMap; * Also supports discovering and invoking exception handling methods to process * exceptions raised during message handling. * - * @param the type of the Object that contains information mapping - * a {@link HandlerMethod} to incoming messages + * @param the type of the Object that contains information mapping a + * {@link HandlerMethod} to incoming messages * * @author Rossen Stoyanchev * @since 4.0 @@ -80,8 +80,7 @@ public abstract class AbstractMethodMessageHandler * matching part is removed from destination before performing a lookup for a matching * message handling method. Prefixes without a trailing slash will have one appended * automatically. - *

    - * By default the list of prefixes is empty in which case all destinations match. + *

    By default the list of prefixes is empty in which case all destinations match. */ public void setDestinationPrefixes(Collection prefixes) { this.destinationPrefixes.clear(); @@ -103,7 +102,6 @@ public abstract class AbstractMethodMessageHandler /** * Sets the list of custom {@code HandlerMethodArgumentResolver}s that will be used * after resolvers for supported argument type. - * * @param customArgumentResolvers the list of resolvers; never {@code null}. */ public void setCustomArgumentResolvers(List customArgumentResolvers) { @@ -118,7 +116,6 @@ public abstract class AbstractMethodMessageHandler /** * Set the list of custom {@code HandlerMethodReturnValueHandler}s that will be used * after return value handlers for known types. - * * @param customReturnValueHandlers the list of custom return value handlers, never {@code null}. */ public void setCustomReturnValueHandlers(List customReturnValueHandlers) { @@ -202,8 +199,7 @@ public abstract class AbstractMethodMessageHandler /** * Return the list of argument resolvers to use. Invoked only if the resolvers * have not already been set via {@link #setArgumentResolvers(java.util.List)}. - *

    - * Sub-classes should also take into account custom argument types configured via + *

    Sub-classes should also take into account custom argument types configured via * {@link #setCustomArgumentResolvers(java.util.List)}. */ protected abstract List initArgumentResolvers(); @@ -211,9 +207,8 @@ public abstract class AbstractMethodMessageHandler /** * Return the list of return value handlers to use. Invoked only if the return * value handlers have not already been set via {@link #setReturnValueHandlers(java.util.List)}. - *

    - * Sub-classes should also take into account custom return value types configured via - * {@link #setCustomReturnValueHandlers(java.util.List)}. + *

    Sub-classes should also take into account custom return value types configured + * via {@link #setCustomReturnValueHandlers(java.util.List)}. */ protected abstract List initReturnValueHandlers(); @@ -226,7 +221,6 @@ public abstract class AbstractMethodMessageHandler /** * Detect if the given handler has any methods that can handle messages and if * so register it with the extracted mapping information. - * * @param handler the handler to check, either an instance of a Spring bean name */ protected final void detectHandlerMethods(Object handler) { @@ -251,10 +245,8 @@ public abstract class AbstractMethodMessageHandler /** * Provide the mapping for a handler method. - * * @param method the method to provide a mapping for * @param handlerType the handler type, possibly a sub-type of the method's declaring class - * * @return the mapping, or {@code null} if the method is not mapped */ protected abstract T getMappingForMethod(Method method, Class handlerType); @@ -262,11 +254,9 @@ public abstract class AbstractMethodMessageHandler /** * Register a handler method and its unique mapping. - * * @param handler the bean name of the handler or the handler instance * @param method the method to register * @param mapping the mapping conditions associated with the handler method - * * @throws IllegalStateException if another method was already registered * under the same mapping */ @@ -345,9 +335,7 @@ public abstract class AbstractMethodMessageHandler /** * Find if the given destination matches any of the configured allowed destination * prefixes and if a match is found return the destination with the prefix removed. - *

    - * If no destination prefixes are configured, the destination is returned as is. - * + *

    If no destination prefixes are configured, the destination is returned as is. * @return the destination to use to find matching message handling methods * or {@code null} if the destination does not match */ @@ -422,10 +410,8 @@ public abstract class AbstractMethodMessageHandler /** * Check if a mapping matches the current message and return a possibly * new mapping with conditions relevant to the current request. - * * @param mapping the mapping to get a match for * @param message the message being handled - * * @return the match or {@code null} if there is no match */ protected abstract T getMatchingMapping(T mapping, Message message); @@ -433,7 +419,6 @@ public abstract class AbstractMethodMessageHandler /** * Return a comparator for sorting matching mappings. * The returned comparator should sort 'better' matches higher. - * * @param message the current Message * @return the comparator, never {@code null} */ diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/method/HandlerMethod.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/method/HandlerMethod.java index 3ef66dc302..e83602381a 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/method/HandlerMethod.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/method/HandlerMethod.java @@ -64,8 +64,8 @@ public class HandlerMethod { * Create an instance from a bean instance and a method. */ public HandlerMethod(Object bean, Method method) { - Assert.notNull(bean, "bean is required"); - Assert.notNull(method, "method is required"); + Assert.notNull(bean, "bean must not be null"); + Assert.notNull(method, "method must not be null"); this.bean = bean; this.beanFactory = null; this.method = method; @@ -78,8 +78,8 @@ public class HandlerMethod { * @throws NoSuchMethodException when the method cannot be found */ public HandlerMethod(Object bean, String methodName, Class... parameterTypes) throws NoSuchMethodException { - Assert.notNull(bean, "bean is required"); - Assert.notNull(methodName, "method is required"); + Assert.notNull(bean, "bean must not be null"); + Assert.notNull(methodName, "method must not be null"); this.bean = bean; this.beanFactory = null; this.method = bean.getClass().getMethod(methodName, parameterTypes); @@ -93,9 +93,9 @@ public class HandlerMethod { * re-create the {@code HandlerMethod} with an initialized the bean. */ public HandlerMethod(String beanName, BeanFactory beanFactory, Method method) { - Assert.hasText(beanName, "beanName is required"); - Assert.notNull(beanFactory, "beanFactory is required"); - Assert.notNull(method, "method is required"); + Assert.hasText(beanName, "beanName must not be null"); + Assert.notNull(beanFactory, "beanFactory must not be null"); + Assert.notNull(method, "method must not be null"); Assert.isTrue(beanFactory.containsBean(beanName), "Bean factory [" + beanFactory + "] does not contain bean [" + beanName + "]"); this.bean = beanName; @@ -109,7 +109,7 @@ public class HandlerMethod { * Copy constructor for use in sub-classes. */ protected HandlerMethod(HandlerMethod handlerMethod) { - Assert.notNull(handlerMethod, "HandlerMethod is required"); + Assert.notNull(handlerMethod, "HandlerMethod must not be null"); this.bean = handlerMethod.bean; this.beanFactory = handlerMethod.beanFactory; this.method = handlerMethod.method; @@ -121,8 +121,8 @@ public class HandlerMethod { * Re-create HandlerMethod with the resolved handler. */ private HandlerMethod(HandlerMethod handlerMethod, Object handler) { - Assert.notNull(handlerMethod, "handlerMethod is required"); - Assert.notNull(handler, "handler is required"); + Assert.notNull(handlerMethod, "handlerMethod must not be null"); + Assert.notNull(handler, "handler must not be null"); this.bean = handler; this.beanFactory = handlerMethod.beanFactory; this.method = handlerMethod.method; diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/method/HandlerMethodArgumentResolver.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/method/HandlerMethodArgumentResolver.java index 7aa53357f8..55da8fcc9a 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/method/HandlerMethodArgumentResolver.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/method/HandlerMethodArgumentResolver.java @@ -19,7 +19,6 @@ package org.springframework.messaging.handler.method; import org.springframework.core.MethodParameter; import org.springframework.messaging.Message; - /** * Strategy interface for resolving method parameters into argument values in * the context of a given {@link Message}. @@ -32,25 +31,20 @@ public interface HandlerMethodArgumentResolver { /** * Whether the given {@linkplain MethodParameter method parameter} is * supported by this resolver. - * * @param parameter the method parameter to check * @return {@code true} if this resolver supports the supplied parameter; * {@code false} otherwise */ boolean supportsParameter(MethodParameter parameter); - /** * Resolves a method parameter into an argument value from a given message. - * * @param parameter the method parameter to resolve. This parameter must * have previously been passed to * {@link #supportsParameter(org.springframework.core.MethodParameter)} * and it must have returned {@code true} * @param message - * * @return the resolved argument value, or {@code null}. - * * @throws Exception in case of errors with the preparation of argument values */ Object resolveArgument(MethodParameter parameter, Message message) throws Exception; diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/method/HandlerMethodReturnValueHandler.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/method/HandlerMethodReturnValueHandler.java index 0999173db0..95076ca6a2 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/method/HandlerMethodReturnValueHandler.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/method/HandlerMethodReturnValueHandler.java @@ -19,7 +19,6 @@ package org.springframework.messaging.handler.method; import org.springframework.core.MethodParameter; import org.springframework.messaging.Message; - /** * Strategy interface to handle the value returned from the invocation of a * method handling a {@link Message}. @@ -32,7 +31,6 @@ public interface HandlerMethodReturnValueHandler { /** * Whether the given {@linkplain MethodParameter method return type} is * supported by this handler. - * * @param returnType the method return type to check * @return {@code true} if this handler supports the supplied return type; * {@code false} otherwise @@ -41,7 +39,6 @@ public interface HandlerMethodReturnValueHandler { /** * Handle the given return value. - * * @param returnValue the value returned from the handler method * @param returnType the type of the return value. This type must have * previously been passed to diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/method/HandlerMethodSelector.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/method/HandlerMethodSelector.java index 95ae629d9d..899c22bb0c 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/method/HandlerMethodSelector.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/method/HandlerMethodSelector.java @@ -39,7 +39,6 @@ public abstract class HandlerMethodSelector { /** * Selects handler methods for the given handler type. Callers of this method define handler methods * of interest through the {@link MethodFilter} parameter. - * * @param handlerType the handler type to search handler methods on * @param handlerMethodFilter a {@link MethodFilter} to help recognize handler methods of interest * @return the selected methods, or an empty set diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/SimpMessageHeaderAccessor.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/SimpMessageHeaderAccessor.java index 847993a8b5..69d26190b2 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/SimpMessageHeaderAccessor.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/SimpMessageHeaderAccessor.java @@ -24,15 +24,14 @@ import org.springframework.messaging.Message; import org.springframework.messaging.support.NativeMessageHeaderAccessor; import org.springframework.util.Assert; - /** * A base class for working with message headers in simple messaging protocols that * support basic messaging patterns. Provides uniform access to specific values common * across protocols such as a destination, message type (e.g. publish, subscribe, etc), * session id, and others. - *

    - * Use one of the static factory method in this class, then call getters and setters, and - * at the end if necessary call {@link #toMap()} to obtain the updated headers. + * + *

    Use one of the static factory method in this class, then call getters and setters, + * and at the end if necessary call {@link #toMap()} to obtain the updated headers. * * @author Rossen Stoyanchev * @since 4.0 @@ -58,7 +57,7 @@ public class SimpMessageHeaderAccessor extends NativeMessageHeaderAccessor { */ protected SimpMessageHeaderAccessor(SimpMessageType messageType, Map> externalSourceHeaders) { super(externalSourceHeaders); - Assert.notNull(messageType, "messageType is required"); + Assert.notNull(messageType, "MessageType must not be null"); setHeader(MESSAGE_TYPE_HEADER, messageType); } @@ -104,7 +103,7 @@ public class SimpMessageHeaderAccessor extends NativeMessageHeaderAccessor { } public void setDestination(String destination) { - Assert.notNull(destination, "destination is required"); + Assert.notNull(destination, "Destination must not be null"); setHeader(DESTINATION_HEADER, destination); } diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/SimpMessageSendingOperations.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/SimpMessageSendingOperations.java index 802b7471d3..156bbc7d5d 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/SimpMessageSendingOperations.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/SimpMessageSendingOperations.java @@ -22,7 +22,6 @@ import org.springframework.messaging.MessagingException; import org.springframework.messaging.core.MessagePostProcessor; import org.springframework.messaging.core.MessageSendingOperations; - /** * A specialization of {@link MessageSendingOperations} with methods for use with * the Spring Framework support for simple messaging protocols (like STOMP). @@ -34,19 +33,24 @@ public interface SimpMessageSendingOperations extends MessageSendingOperations headers) throws MessagingException; /** * Send a message to a specific user. - * * @param user the user that should receive the message. * @param destination the destination to send the message to. * @param payload the payload to send @@ -55,6 +59,14 @@ public interface SimpMessageSendingOperations extends MessageSendingOperations headers, MessagePostProcessor postProcessor) throws MessagingException; diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/SimpMessageType.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/SimpMessageType.java index b8a340de7e..7257d15544 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/SimpMessageType.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/SimpMessageType.java @@ -16,7 +16,6 @@ package org.springframework.messaging.simp; - /** * A generic representation of different kinds of messages found in simple messaging * protocols like STOMP. diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/SimpMessagingTemplate.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/SimpMessagingTemplate.java index d36fe79324..1185649857 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/SimpMessagingTemplate.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/SimpMessagingTemplate.java @@ -26,7 +26,6 @@ import org.springframework.messaging.core.MessagePostProcessor; import org.springframework.messaging.support.MessageBuilder; import org.springframework.util.Assert; - /** * A specialization of {@link AbstractMessageSendingTemplate} that adds String-based * destinations as a message header. @@ -44,8 +43,12 @@ public class SimpMessagingTemplate extends AbstractMessageSendingTemplate message) { - Assert.notNull(destination, "destination is required"); + Assert.notNull(destination, "Destination must not be null"); SimpMessageHeaderAccessor headers = SimpMessageHeaderAccessor.wrap(message); headers.setDestination(destination); @@ -146,8 +149,7 @@ public class SimpMessagingTemplate extends AbstractMessageSendingTemplate headers, MessagePostProcessor postProcessor) throws MessagingException { - - Assert.notNull(user, "user is required"); + Assert.notNull(user, "User must not be null"); super.convertAndSend(this.userDestinationPrefix + user + destination, payload, headers, postProcessor); } diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/SendToUser.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/SendToUser.java index e262216f2c..03b33b8037 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/SendToUser.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/SendToUser.java @@ -25,7 +25,6 @@ import java.lang.annotation.Target; import org.springframework.messaging.Message; import org.springframework.messaging.simp.SimpMessageHeaderAccessor; - /** * Annotation that can be used on methods processing an input message to indicate that the * method's return value should be converted to a {@link Message} and sent to the @@ -36,7 +35,6 @@ import org.springframework.messaging.simp.SimpMessageHeaderAccessor; * * @author Rossen Stoyanchev * @since 4.0 - * * @see org.springframework.messaging.handler.annotation.SendTo * @see org.springframework.messaging.simp.handler.UserDestinationMessageHandler */ diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/SubscribeMapping.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/SubscribeMapping.java index 3ffe6ba056..b1143c85ac 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/SubscribeMapping.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/SubscribeMapping.java @@ -22,20 +22,19 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; - /** * Annotation for mapping subscription messages onto specific handler methods based * on the destination of a subscription. Supported with STOMP over WebSocket only * (e.g. STOMP SUBSCRIBE frame). - *

    - * This is a method-level annotations that can be combined with a type-level + * + *

    This is a method-level annotations that can be combined with a type-level * {@link org.springframework.messaging.handler.annotation.MessageMapping @MessageMapping} - *

    - * Supports the same method arguments as + * + *

    Supports the same method arguments as * {@link org.springframework.messaging.handler.annotation.MessageMapping}, however * subscription messages typically do not have a body. - *

    - * The return value also follows the same rules as for + * + *

    The return value also follows the same rules as for * {@link org.springframework.messaging.handler.annotation.MessageMapping} except if * the method is not annotated with * {@link org.springframework.messaging.handler.annotation.SendTo} or {@link SendToUser}, @@ -52,8 +51,7 @@ public @interface SubscribeMapping { /** * Destination-based mapping expressed by this annotation. - *

    - * For STOMP over WebSocket messages: this is the destination of the STOMP message + *

    For STOMP over WebSocket messages: this is the destination of the STOMP message * (e.g. "/positions"). Ant-style path patterns (e.g. "/price.stock.*") are supported * and so are path template variables (e.g. "/price.stock.{ticker}""). */ diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/support/MissingSessionUserException.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/support/MissingSessionUserException.java index 80e371f975..aaedbd251b 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/support/MissingSessionUserException.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/support/MissingSessionUserException.java @@ -19,9 +19,7 @@ package org.springframework.messaging.simp.annotation.support; import org.springframework.messaging.Message; import org.springframework.messaging.MessagingException; - /** - * * @author Rossen Stoyanchev * @since 4.0 */ diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/support/PrincipalMethodArgumentResolver.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/support/PrincipalMethodArgumentResolver.java index 90dbd6f423..b718a80264 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/support/PrincipalMethodArgumentResolver.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/support/PrincipalMethodArgumentResolver.java @@ -23,14 +23,12 @@ import org.springframework.messaging.Message; import org.springframework.messaging.handler.method.HandlerMethodArgumentResolver; import org.springframework.messaging.simp.SimpMessageHeaderAccessor; - /** * @author Rossen Stoyanchev * @since 4.0 */ public class PrincipalMethodArgumentResolver implements HandlerMethodArgumentResolver { - @Override public boolean supportsParameter(MethodParameter parameter) { Class paramType = parameter.getParameterType(); diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/support/SendToMethodReturnValueHandler.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/support/SendToMethodReturnValueHandler.java index fd10a0f78b..898a25e3ce 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/support/SendToMethodReturnValueHandler.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/support/SendToMethodReturnValueHandler.java @@ -32,12 +32,11 @@ import org.springframework.messaging.support.MessageBuilder; import org.springframework.util.Assert; import org.springframework.util.ObjectUtils; - /** * A {@link HandlerMethodReturnValueHandler} for sending to destinations specified in a * {@link SendTo} or {@link SendToUser} method-level annotations. - *

    - * The value returned from the method is converted, and turned to a {@link Message} and + * + *

    The value returned from the method is converted, and turned to a {@link Message} and * sent through the provided {@link MessageChannel}. The * message is then enriched with the sessionId of the input message as well as the * destination from the annotation(s). If multiple destinations are specified, a copy of @@ -58,7 +57,7 @@ public class SendToMethodReturnValueHandler implements HandlerMethodReturnValueH public SendToMethodReturnValueHandler(SimpMessageSendingOperations messagingTemplate, boolean annotationRequired) { - Assert.notNull(messagingTemplate, "messagingTemplate is required"); + Assert.notNull(messagingTemplate, "messagingTemplate must not be null"); this.messagingTemplate = messagingTemplate; this.annotationRequired = annotationRequired; } @@ -68,8 +67,7 @@ public class SendToMethodReturnValueHandler implements HandlerMethodReturnValueH * Configure a default prefix to add to message destinations in cases where a method * is not annotated with {@link SendTo @SendTo} or does not specify any destinations * through the annotation's value attribute. - *

    - * By default, the prefix is set to "/topic". + *

    By default, the prefix is set to "/topic". */ public void setDefaultDestinationPrefix(String defaultDestinationPrefix) { this.defaultDestinationPrefix = defaultDestinationPrefix; @@ -87,8 +85,7 @@ public class SendToMethodReturnValueHandler implements HandlerMethodReturnValueH * Configure a default prefix to add to message destinations in cases where a * method is annotated with {@link SendToUser @SendToUser} but does not specify * any destinations through the annotation's value attribute. - *

    - * By default, the prefix is set to "/queue". + *

    By default, the prefix is set to "/queue". */ public void setDefaultUserDestinationPrefix(String prefix) { this.defaultUserDestinationPrefix = prefix; diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/support/SubscriptionMethodReturnValueHandler.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/support/SubscriptionMethodReturnValueHandler.java index 0d6b358241..e236ea9f2a 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/support/SubscriptionMethodReturnValueHandler.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/support/SubscriptionMethodReturnValueHandler.java @@ -29,7 +29,6 @@ import org.springframework.messaging.simp.annotation.SubscribeMapping; import org.springframework.messaging.support.MessageBuilder; import org.springframework.util.Assert; - /** * A {@link HandlerMethodReturnValueHandler} for replying directly to a subscription. It * supports methods annotated with {@link org.springframework.messaging.simp.annotation.SubscribeMapping} unless they're also annotated @@ -49,10 +48,10 @@ public class SubscriptionMethodReturnValueHandler implements HandlerMethodReturn /** * @param messagingTemplate a messaging template for sending messages directly - * to clients, e.g. in response to a subscription + * to clients, e.g. in response to a subscription */ public SubscriptionMethodReturnValueHandler(MessageSendingOperations messagingTemplate) { - Assert.notNull(messagingTemplate, "messagingTemplate is required"); + Assert.notNull(messagingTemplate, "messagingTemplate must not be null"); this.messagingTemplate = messagingTemplate; } diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/config/AbstractBrokerRegistration.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/config/AbstractBrokerRegistration.java index 84c7fc1137..573fbd2e7c 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/config/AbstractBrokerRegistration.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/config/AbstractBrokerRegistration.java @@ -39,7 +39,7 @@ public abstract class AbstractBrokerRegistration { public AbstractBrokerRegistration(MessageChannel clientOutboundChannel, String[] destinationPrefixes) { - Assert.notNull(clientOutboundChannel, "'clientOutboundChannel' is required"); + Assert.notNull(clientOutboundChannel, "'clientOutboundChannel' must not be null"); this.clientOutboundChannel = clientOutboundChannel; this.destinationPrefixes = (destinationPrefixes != null) ? Arrays.asList(destinationPrefixes) : Collections.emptyList(); diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/config/AbstractMessageBrokerConfiguration.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/config/AbstractMessageBrokerConfiguration.java index 6c5945ac0e..748f0c9c51 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/config/AbstractMessageBrokerConfiguration.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/config/AbstractMessageBrokerConfiguration.java @@ -30,7 +30,6 @@ import org.springframework.util.MimeTypeUtils; import java.util.ArrayList; import java.util.List; - /** * Provides essential configuration for handling messages with simple messaging * protocols such as STOMP. @@ -278,12 +277,15 @@ public abstract class AbstractMessageBrokerConfiguration { @Override protected void startInternal() { } + @Override protected void stopInternal() { } + @Override protected void handleMessageInternal(Message message) { } + }; } diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/config/ChannelRegistration.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/config/ChannelRegistration.java index 52103d9dd0..27d969a109 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/config/ChannelRegistration.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/config/ChannelRegistration.java @@ -22,7 +22,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; - /** * A registration class for customizing the configuration for a * {@link org.springframework.messaging.MessageChannel}. diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/config/MessageBrokerRegistry.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/config/MessageBrokerRegistry.java index a250ff7374..1525dbf0f7 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/config/MessageBrokerRegistry.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/config/MessageBrokerRegistry.java @@ -74,12 +74,10 @@ public class MessageBrokerRegistry { * annotated methods. For example destinations prefixed with "/app" may be * processed by annotated methods while other destinations may target the * message broker (e.g. "/topic", "/queue"). - *

    - * When messages are processed, the matching prefix is removed from the destination in - * order to form the lookup path. This means annotations should not contain the + *

    When messages are processed, the matching prefix is removed from the destination + * in order to form the lookup path. This means annotations should not contain the * destination prefix. - *

    - * Prefixes that do not have a trailing slash will have one automatically appended. + *

    Prefixes that do not have a trailing slash will have one automatically appended. */ public MessageBrokerRegistry setApplicationDestinationPrefixes(String... prefixes) { this.applicationDestinationPrefixes = prefixes; @@ -91,14 +89,12 @@ public class MessageBrokerRegistry { * provide the ability for a user to subscribe to queue names unique to their * session as well as for others to send messages to those unique, * user-specific queues. - *

    - * For example when a user attempts to subscribe to "/user/queue/position-updates", + *

    For example when a user attempts to subscribe to "/user/queue/position-updates", * the destination may be translated to "/queue/position-updatesi9oqdfzo" yielding a * unique queue name that does not collide with any other user attempting to do the same. * Subsequently when messages are sent to "/user/{username}/queue/position-updates", * the destination is translated to "/queue/position-updatesi9oqdfzo". - *

    - * The default prefix used to identify such destinations is "/user/". + *

    The default prefix used to identify such destinations is "/user/". */ public MessageBrokerRegistry setUserDestinationPrefix(String destinationPrefix) { this.userDestinationPrefix = destinationPrefix; diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/config/SimpleBrokerRegistration.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/config/SimpleBrokerRegistration.java index ac38336b6f..a9db100c91 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/config/SimpleBrokerRegistration.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/config/SimpleBrokerRegistration.java @@ -19,7 +19,6 @@ package org.springframework.messaging.simp.config; import org.springframework.messaging.MessageChannel; import org.springframework.messaging.simp.handler.SimpleBrokerMessageHandler; - /** * Registration class for configuring a {@link SimpleBrokerMessageHandler}. * @@ -33,6 +32,7 @@ public class SimpleBrokerRegistration extends AbstractBrokerRegistration { super(clientOutboundChannel, destinationPrefixes); } + @Override protected SimpleBrokerMessageHandler getMessageHandler() { return new SimpleBrokerMessageHandler(getClientOutboundChannel(), getDestinationPrefixes()); diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/config/StompBrokerRelayRegistration.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/config/StompBrokerRelayRegistration.java index 8b73855a2c..394e3769cb 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/config/StompBrokerRelayRegistration.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/config/StompBrokerRelayRegistration.java @@ -90,8 +90,7 @@ public class StompBrokerRelayRegistration extends AbstractBrokerRegistration { * Set the interval, in milliseconds, at which the "system" relay session will, * in the absence of any other data being sent, send a heartbeat to the STOMP broker. * A value of zero will prevent heartbeats from being sent to the broker. - *

    - * The default value is 10000. + *

    The default value is 10000. */ public StompBrokerRelayRegistration setSystemHeartbeatSendInterval(long systemHeartbeatSendInterval) { this.systemHeartbeatSendInterval = systemHeartbeatSendInterval; @@ -103,8 +102,7 @@ public class StompBrokerRelayRegistration extends AbstractBrokerRegistration { * expects, in the absence of any other data, to receive a heartbeat from the STOMP * broker. A value of zero will configure the relay session to expect not to receive * heartbeats from the broker. - *

    - * The default value is 10000. + *

    The default value is 10000. */ public StompBrokerRelayRegistration setSystemHeartbeatReceiveInterval(long heartbeatReceiveInterval) { this.systemHeartbeatReceiveInterval = heartbeatReceiveInterval; @@ -114,8 +112,7 @@ public class StompBrokerRelayRegistration extends AbstractBrokerRegistration { /** * Configure whether the {@link StompBrokerRelayMessageHandler} should start * automatically when the Spring ApplicationContext is refreshed. - *

    - * The default setting is {@code true}. + *

    The default setting is {@code true}. */ public StompBrokerRelayRegistration setAutoStartup(boolean autoStartup) { this.autoStartup = autoStartup; diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/AbstractBrokerMessageHandler.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/AbstractBrokerMessageHandler.java index 3521b69b16..381f19a510 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/AbstractBrokerMessageHandler.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/AbstractBrokerMessageHandler.java @@ -30,9 +30,7 @@ import org.springframework.messaging.MessageHandler; import org.springframework.messaging.simp.BrokerAvailabilityEvent; import org.springframework.util.CollectionUtils; - /** - * * @author Rossen Stoyanchev * @since 4.0 */ diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/AbstractSubscriptionRegistry.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/AbstractSubscriptionRegistry.java index 0c1d55d6aa..7505b617ce 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/AbstractSubscriptionRegistry.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/AbstractSubscriptionRegistry.java @@ -23,7 +23,6 @@ import org.springframework.messaging.simp.SimpMessageHeaderAccessor; import org.springframework.messaging.simp.SimpMessageType; import org.springframework.util.MultiValueMap; - /** * @author Rossen Stoyanchev * @since 4.0 diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/DefaultSubscriptionRegistry.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/DefaultSubscriptionRegistry.java index 70940105ea..d8accd01b3 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/DefaultSubscriptionRegistry.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/DefaultSubscriptionRegistry.java @@ -227,7 +227,7 @@ public class DefaultSubscriptionRegistry extends AbstractSubscriptionRegistry { public SessionSubscriptionInfo(String sessionId) { - Assert.notNull(sessionId, "sessionId is required"); + Assert.notNull(sessionId, "sessionId must not be null"); this.sessionId = sessionId; } diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/DefaultUserDestinationResolver.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/DefaultUserDestinationResolver.java index 3be5bd5f5e..7205643b22 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/DefaultUserDestinationResolver.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/DefaultUserDestinationResolver.java @@ -30,8 +30,8 @@ import java.util.Set; /** * A default implementation of {@link UserDestinationResolver}. - *

    - * Resolves messages sent to destination patterns "/user/{user-name}/**" as well as + * + *

    Resolves messages sent to destination patterns "/user/{user-name}/**" as well as * subscriptions to destinations "/user/queue/**" where the "/user/" prefix used to * recognize such destinations is customizable via * {@link #setUserDestinationPrefix(String)}. @@ -54,24 +54,21 @@ public class DefaultUserDestinationResolver implements UserDestinationResolver { /** * Create an instance that will access user session id information through * the provided registry. - * * @param userSessionRegistry the registry, never {@code null} */ public DefaultUserDestinationResolver(UserSessionRegistry userSessionRegistry) { - Assert.notNull(userSessionRegistry, "'userSessionRegistry' is required"); + Assert.notNull(userSessionRegistry, "'userSessionRegistry' must not be null"); this.userSessionRegistry = userSessionRegistry; } /** * The prefix used to identify user destinations. Any destinations that do not * start with the given prefix are not be resolved. - *

    - * The default value is "/user/". - * + *

    The default value is "/user/". * @param prefix the prefix to use */ public void setUserDestinationPrefix(String prefix) { - Assert.hasText(prefix, "prefix is required"); + Assert.hasText(prefix, "prefix must not be empty"); this.destinationPrefix = prefix.endsWith("/") ? prefix : prefix + "/"; this.subscriptionDestinationPrefix = this.destinationPrefix + "queue/"; } @@ -79,8 +76,7 @@ public class DefaultUserDestinationResolver implements UserDestinationResolver { /** * Return the prefix used to identify user destinations. Any destinations that do not * start with the given prefix are not be resolved. - *

    - * By default "/user/queue/". + *

    By default "/user/queue/". */ public String getDestinationPrefix() { return this.destinationPrefix; @@ -88,8 +84,7 @@ public class DefaultUserDestinationResolver implements UserDestinationResolver { /** * Return the prefix used to identify user destinations for (un)subscribe messages. - *

    - * By default "/user/queue/". + *

    By default "/user/queue/". */ public String getSubscriptionDestinationPrefix() { return this.subscriptionDestinationPrefix; diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/DefaultUserSessionRegistry.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/DefaultUserSessionRegistry.java index 91340da743..bd4ef6e62d 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/DefaultUserSessionRegistry.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/DefaultUserSessionRegistry.java @@ -46,10 +46,8 @@ public class DefaultUserSessionRegistry implements UserSessionRegistry { @Override public void registerSessionId(String user, String sessionId) { - - Assert.notNull(user, "'user' is required"); - Assert.notNull(user, "'sessionId' is required"); - + Assert.notNull(user, "User must not be null"); + Assert.notNull(sessionId, "Session ID must not be null"); synchronized (this.lock) { Set set = this.userSessionIds.get(user); if (set == null) { @@ -62,10 +60,8 @@ public class DefaultUserSessionRegistry implements UserSessionRegistry { @Override public void unregisterSessionId(String userName, String sessionId) { - - Assert.notNull(userName, "'userName' is required"); - Assert.notNull(userName, "'sessionId' is required"); - + Assert.notNull(userName, "User Name must not be null"); + Assert.notNull(sessionId, "Session ID must not be null"); synchronized (lock) { Set set = this.userSessionIds.get(userName); if (set != null) { diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/SimpAnnotationMethodMessageHandler.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/SimpAnnotationMethodMessageHandler.java index 9f5e853f61..15172cea0a 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/SimpAnnotationMethodMessageHandler.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/SimpAnnotationMethodMessageHandler.java @@ -64,7 +64,6 @@ import org.springframework.util.Assert; import org.springframework.util.ClassUtils; import org.springframework.util.PathMatcher; - /** * A handler for messages delegating to {@link org.springframework.messaging.simp.annotation.SubscribeMapping @SubscribeMapping} and * {@link MessageMapping @MessageMapping} annotated methods. @@ -95,8 +94,8 @@ public class SimpAnnotationMethodMessageHandler extends AbstractMethodMessageHan public SimpAnnotationMethodMessageHandler(SimpMessageSendingOperations brokerTemplate, MessageChannel clientOutboundChannel) { - Assert.notNull(brokerTemplate, "brokerTemplate is required"); - Assert.notNull(clientOutboundChannel, "clientOutboundChannel is required"); + Assert.notNull(brokerTemplate, "BrokerTemplate must not be null"); + Assert.notNull(clientOutboundChannel, "ClientOutboundChannel must not be null"); this.brokerTemplate = brokerTemplate; this.clientMessagingTemplate = new SimpMessagingTemplate(clientOutboundChannel); @@ -111,7 +110,6 @@ public class SimpAnnotationMethodMessageHandler extends AbstractMethodMessageHan * from serialize form with a specific MIME type to an Object matching the target * method parameter. The converter is also used when sending message to the message * broker. - * * @see CompositeMessageConverter */ public void setMessageConverter(MessageConverter converter) { @@ -131,8 +129,7 @@ public class SimpAnnotationMethodMessageHandler extends AbstractMethodMessageHan /** * Configure a {@link ConversionService} to use when resolving method arguments, for * example message header values. - *

    - * By default an instance of {@link DefaultFormattingConversionService} is used. + *

    By default an instance of {@link DefaultFormattingConversionService} is used. */ public void setConversionService(ConversionService conversionService) { this.conversionService = conversionService; @@ -148,8 +145,7 @@ public class SimpAnnotationMethodMessageHandler extends AbstractMethodMessageHan /** * Set the PathMatcher implementation to use for matching destinations * against configured destination patterns. - *

    - * By default AntPathMatcher is used + *

    By default AntPathMatcher is used */ public void setPathMatcher(PathMatcher pathMatcher) { Assert.notNull(pathMatcher, "PathMatcher must not be null"); diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/SimpMessageTypeMessageCondition.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/SimpMessageTypeMessageCondition.java index 582ed40c5c..30c1845cb2 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/SimpMessageTypeMessageCondition.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/SimpMessageTypeMessageCondition.java @@ -45,11 +45,10 @@ public class SimpMessageTypeMessageCondition extends AbstractMessageCondition destinationPrefixes) { super(destinationPrefixes); - Assert.notNull(messageChannel, "messageChannel is required"); + Assert.notNull(messageChannel, "MessageChannel must not be null"); this.messageChannel = messageChannel; } @@ -55,7 +54,7 @@ public class SimpleBrokerMessageHandler extends AbstractBrokerMessageHandler { } public void setSubscriptionRegistry(SubscriptionRegistry subscriptionRegistry) { - Assert.notNull(subscriptionRegistry, "subscriptionRegistry is required"); + Assert.notNull(subscriptionRegistry, "SubscriptionRegistry must not be null"); this.subscriptionRegistry = subscriptionRegistry; } diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/SubscriptionRegistry.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/SubscriptionRegistry.java index 6e42369de4..52d500bbb4 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/SubscriptionRegistry.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/SubscriptionRegistry.java @@ -46,7 +46,6 @@ public interface SubscriptionRegistry { /** * Find all subscriptions that should receive the given message. - * * @param message the message * @return a {@link MultiValueMap} from sessionId to subscriptionId's, possibly empty. */ diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/UserDestinationMessageHandler.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/UserDestinationMessageHandler.java index a3a5796eef..f194217f95 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/UserDestinationMessageHandler.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/UserDestinationMessageHandler.java @@ -50,17 +50,14 @@ public class UserDestinationMessageHandler implements MessageHandler { /** * Create an instance of the handler with the given messaging template and a * user destination resolver. - * * @param messagingTemplate a messaging template to use for sending messages - * with translated user destinations + * with translated user destinations * @param userDestinationResolver the resolver to use to find queue suffixes for a user */ public UserDestinationMessageHandler(MessageSendingOperations messagingTemplate, UserDestinationResolver userDestinationResolver) { - - Assert.notNull(messagingTemplate, "messagingTemplate is required"); - Assert.notNull(userDestinationResolver, "destinationResolver is required"); - + Assert.notNull(messagingTemplate, "MessagingTemplate must not be null"); + Assert.notNull(userDestinationResolver, "DestinationResolver must not be null"); this.messagingTemplate = messagingTemplate; this.userDestinationResolver = userDestinationResolver; } diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/UserDestinationResolver.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/UserDestinationResolver.java index 420c7ec6d7..71f999f861 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/UserDestinationResolver.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/UserDestinationResolver.java @@ -20,13 +20,12 @@ import org.springframework.messaging.Message; import java.util.Set; - /** * A strategy for resolving unique, user destinations per session. User destinations * provide a user with the ability to subscribe to a queue unique to their session * as well others with the ability to send messages to those queues. - *

    - * For example when a user attempts to subscribe to "/user/queue/position-updates", + * + *

    For example when a user attempts to subscribe to "/user/queue/position-updates", * the destination may be resolved to "/queue/position-updates-useri9oqdfzo" yielding a * unique queue name that does not collide with any other user attempting to do the same. * Subsequently when messages are sent to "/user/{username}/queue/position-updates", @@ -43,11 +42,9 @@ public interface UserDestinationResolver { * Resolve the destination of the message to one or more user/session-specific target * destinations. If the user has multiple sessions, the method may return more than * one target destinations. - * * @param message the message to resolve - * * @return the resolved unique user destinations or an empty Set if the message - * destination is not recognized as a user destination + * destination is not recognized as a user destination */ Set resolveDestination(Message message); diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/UserSessionRegistry.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/UserSessionRegistry.java index 42e9272b0f..950867bc40 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/UserSessionRegistry.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/UserSessionRegistry.java @@ -4,21 +4,18 @@ import java.util.Set; /** * A registry for looking up active session id's by user. - *

    - * Used in support of resolving unique session-specific user destinations. + * + *

    Used in support of resolving unique session-specific user destinations. * See {@link DefaultUserDestinationResolver} for more details. * * @author Rossen Stoyanchev * @since 4.0 - * * @see DefaultUserDestinationResolver */ public interface UserSessionRegistry { - /** * Return the active session id's for the given user. - * * @param user the user * @return a set with 0 or more session id's */ @@ -26,7 +23,6 @@ public interface UserSessionRegistry { /** * Register an active session id for the given user. - * * @param user the user * @param sessionId the session id */ @@ -34,11 +30,9 @@ public interface UserSessionRegistry { /** * Unregister the session id for a user. - * * @param user the user * @param sessionId the session id */ void unregisterSessionId(String user, String sessionId); - } diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompBrokerRelayMessageHandler.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompBrokerRelayMessageHandler.java index 9c1de3f3c1..9941cff977 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompBrokerRelayMessageHandler.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompBrokerRelayMessageHandler.java @@ -39,7 +39,6 @@ import org.springframework.util.concurrent.ListenableFuture; import org.springframework.util.concurrent.ListenableFutureCallback; import org.springframework.util.concurrent.ListenableFutureTask; - /** * A {@link MessageHandler} that handles messages by forwarding them to a STOMP broker. * For each new {@link SimpMessageType#CONNECT CONNECT} message, an independent TCP @@ -49,8 +48,8 @@ import org.springframework.util.concurrent.ListenableFutureTask; * sends messages back on the TCP connection, those messages are enriched with the session * id of the client and sent back downstream through the {@link MessageChannel} provided * to the constructor. - *

    - * This class also automatically opens a default "system" TCP connection to the message + * + *

    This class also automatically opens a default "system" TCP connection to the message * broker that is used for sending messages that originate from the server application (as * opposed to from a client). Such messages are recognized because they are not associated * with any client and therefore do not have a session id header. The "system" connection @@ -103,11 +102,11 @@ public class StompBrokerRelayMessageHandler extends AbstractBrokerMessageHandler /** * @param messageChannel the channel to send messages from the STOMP broker to * @param destinationPrefixes the broker supported destination prefixes; destinations - * that do not match the given prefix are ignored. + * that do not match the given prefix are ignored. */ public StompBrokerRelayMessageHandler(MessageChannel messageChannel, Collection destinationPrefixes) { super(destinationPrefixes); - Assert.notNull(messageChannel, "messageChannel is required"); + Assert.notNull(messageChannel, "MessageChannel must not be null"); this.messageChannel = messageChannel; } @@ -145,10 +144,8 @@ public class StompBrokerRelayMessageHandler extends AbstractBrokerMessageHandler * Set the interval, in milliseconds, at which the "system" connection will, in the * absence of any other data being sent, send a heartbeat to the STOMP broker. A value * of zero will prevent heartbeats from being sent to the broker. - *

    - * The default value is 10000. - *

    - * See class-level documentation for more information on the "system" connection. + *

    The default value is 10000. + *

    See class-level documentation for more information on the "system" connection. */ public void setSystemHeartbeatSendInterval(long systemHeartbeatSendInterval) { this.systemHeartbeatSendInterval = systemHeartbeatSendInterval; @@ -167,10 +164,8 @@ public class StompBrokerRelayMessageHandler extends AbstractBrokerMessageHandler * expects, in the absence of any other data, to receive a heartbeat from the STOMP * broker. A value of zero will configure the connection to expect not to receive * heartbeats from the broker. - *

    - * The default value is 10000. - *

    - * See class-level documentation for more information on the "system" connection. + *

    The default value is 10000. + *

    See class-level documentation for more information on the "system" connection. */ public void setSystemHeartbeatReceiveInterval(long heartbeatReceiveInterval) { this.systemHeartbeatReceiveInterval = heartbeatReceiveInterval; @@ -187,8 +182,7 @@ public class StompBrokerRelayMessageHandler extends AbstractBrokerMessageHandler /** * Set the login for the "system" connection used to send messages to the STOMP * broker without having a client session (e.g. REST/HTTP request handling method). - *

    - * See class-level documentation for more information on the "system" connection. + *

    See class-level documentation for more information on the "system" connection. */ public void setSystemLogin(String systemLogin) { Assert.hasText(systemLogin, "systemLogin must not be empty"); @@ -205,8 +199,7 @@ public class StompBrokerRelayMessageHandler extends AbstractBrokerMessageHandler /** * Set the passcode for the "system" connection used to send messages to the STOMP * broker without having a client session (e.g. REST/HTTP request handling method). - *

    - * See class-level documentation for more information on the "system" connection. + *

    See class-level documentation for more information on the "system" connection. */ public void setSystemPasscode(String systemPasscode) { this.systemPasscode = systemPasscode; @@ -225,8 +218,7 @@ public class StompBrokerRelayMessageHandler extends AbstractBrokerMessageHandler * the STOMP broker. This may be useful for example in a cloud environment where the * actual host to which the TCP connection is established is different from the host * providing the cloud-based STOMP service. - *

    - * By default this property is not set. + *

    By default this property is not set. */ public void setVirtualHost(String virtualHost) { this.virtualHost = virtualHost; @@ -374,8 +366,8 @@ public class StompBrokerRelayMessageHandler extends AbstractBrokerMessageHandler private StompConnectionHandler(String sessionId, StompHeaderAccessor connectHeaders, boolean isRemoteClientSession) { - Assert.notNull(sessionId, "sessionId is required"); - Assert.notNull(connectHeaders, "connectHeaders is required"); + Assert.notNull(sessionId, "SessionId must not be null"); + Assert.notNull(connectHeaders, "ConnectHeaders must not be null"); this.sessionId = sessionId; this.connectHeaders = connectHeaders; diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompCommand.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompCommand.java index e7be4e7509..cdd5cc8df3 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompCommand.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompCommand.java @@ -23,9 +23,7 @@ import java.util.Map; import org.springframework.messaging.simp.SimpMessageType; - /** - * * @author Rossen Stoyanchev * @since 4.0 */ diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompHeaderAccessor.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompHeaderAccessor.java index fa2b4fa214..ea81e06695 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompHeaderAccessor.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompHeaderAccessor.java @@ -32,13 +32,12 @@ import org.springframework.util.MimeType; import org.springframework.util.MimeTypeUtils; import org.springframework.util.StringUtils; - /** * Can be used to prepare headers for a new STOMP message, or to access and/or modify * STOMP-specific headers of an existing message. - *

    - * Use one of the static factory method in this class, then call getters and setters, and - * at the end if necessary call {@link #toMap()} to obtain the updated headers + * + *

    Use one of the static factory method in this class, then call getters and setters, + * and at the end if necessary call {@link #toMap()} to obtain the updated headers * or call {@link #toNativeHeaderMap()} to obtain only the STOMP-specific headers. * * @author Rossen Stoyanchev @@ -101,7 +100,7 @@ public class StompHeaderAccessor extends SimpMessageHeaderAccessor { super(command.getMessageType(), externalSourceHeaders); - Assert.notNull(command, "command is required"); + Assert.notNull(command, "Command must not be null"); setHeader(COMMAND_HEADER, command); if (externalSourceHeaders != null) { diff --git a/spring-messaging/src/main/java/org/springframework/messaging/support/GenericMessage.java b/spring-messaging/src/main/java/org/springframework/messaging/support/GenericMessage.java index c0b9873440..3aac418832 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/support/GenericMessage.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/support/GenericMessage.java @@ -31,7 +31,6 @@ import org.springframework.util.ObjectUtils; * * @author Mark Fisher * @since 4.0 - * * @see MessageBuilder */ public class GenericMessage implements Message, Serializable { @@ -46,7 +45,6 @@ public class GenericMessage implements Message, Serializable { /** * Create a new message with the given payload. - * * @param payload the message payload */ public GenericMessage(T payload) { @@ -56,7 +54,6 @@ public class GenericMessage implements Message, Serializable { /** * Create a new message with the given payload. The provided map will be used to * populate the message headers - * * @param payload the message payload * @param headers message headers * @see MessageHeaders diff --git a/spring-messaging/src/main/java/org/springframework/messaging/support/MessageBuilder.java b/spring-messaging/src/main/java/org/springframework/messaging/support/MessageBuilder.java index fc77467897..742c1508ec 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/support/MessageBuilder.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/support/MessageBuilder.java @@ -51,11 +51,11 @@ public final class MessageBuilder { this.headerAccessor = new MessageHeaderAccessor(originalMessage); } + /** * Create a builder for a new {@link Message} instance pre-populated with all of the * headers copied from the provided message. The payload of the provided Message will * also be used as the payload for the new message. - * * @param message the Message from which the payload and all headers will be copied */ public static MessageBuilder fromMessage(Message message) { @@ -65,7 +65,6 @@ public final class MessageBuilder { /** * Create a builder for a new {@link Message} instance with the provided payload. - * * @param payload the payload for the new message */ public static MessageBuilder withPayload(T payload) { @@ -78,7 +77,7 @@ public final class MessageBuilder { * @param headerAccessor the headers for the message */ public MessageBuilder setHeaders(MessageHeaderAccessor headerAccessor) { - Assert.notNull(headerAccessor, "headerAccessor is required"); + Assert.notNull(headerAccessor, "HeaderAccessor must not be null"); this.headerAccessor = headerAccessor; return this; } diff --git a/spring-messaging/src/main/java/org/springframework/messaging/support/channel/AbstractMessageChannel.java b/spring-messaging/src/main/java/org/springframework/messaging/support/channel/AbstractMessageChannel.java index 81416e7931..700bdeb21a 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/support/channel/AbstractMessageChannel.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/support/channel/AbstractMessageChannel.java @@ -28,7 +28,6 @@ import org.springframework.messaging.MessagingException; import org.springframework.util.Assert; import org.springframework.util.ObjectUtils; - /** * Abstract base class for {@link MessageChannel} implementations. * diff --git a/spring-messaging/src/main/java/org/springframework/messaging/support/channel/AbstractSubscribableChannel.java b/spring-messaging/src/main/java/org/springframework/messaging/support/channel/AbstractSubscribableChannel.java index 3cc8dd278a..057543133c 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/support/channel/AbstractSubscribableChannel.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/support/channel/AbstractSubscribableChannel.java @@ -19,7 +19,6 @@ package org.springframework.messaging.support.channel; import org.springframework.messaging.MessageHandler; import org.springframework.messaging.SubscribableChannel; - /** * Abstract base class for {@link SubscribableChannel} implementations. * diff --git a/spring-messaging/src/main/java/org/springframework/messaging/support/channel/ChannelInterceptorChain.java b/spring-messaging/src/main/java/org/springframework/messaging/support/channel/ChannelInterceptorChain.java index 7aba045e05..eb0f7b2917 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/support/channel/ChannelInterceptorChain.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/support/channel/ChannelInterceptorChain.java @@ -26,7 +26,6 @@ import org.apache.commons.logging.LogFactory; import org.springframework.messaging.Message; import org.springframework.messaging.MessageChannel; - /** * A convenience wrapper class for invoking a list of {@link ChannelInterceptor}s. * diff --git a/spring-messaging/src/main/java/org/springframework/messaging/support/converter/AbstractMessageConverter.java b/spring-messaging/src/main/java/org/springframework/messaging/support/converter/AbstractMessageConverter.java index 05d26e42c3..d02e3752c8 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/support/converter/AbstractMessageConverter.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/support/converter/AbstractMessageConverter.java @@ -29,7 +29,6 @@ import org.springframework.messaging.support.MessageBuilder; import org.springframework.util.Assert; import org.springframework.util.MimeType; - /** * Abstract base class for {@link MessageConverter} implementations including support for * common properties and a partial implementation of the conversion methods mainly to @@ -63,7 +62,7 @@ public abstract class AbstractMessageConverter implements MessageConverter { * @param supportedMimeTypes the supported MIME types */ protected AbstractMessageConverter(Collection supportedMimeTypes) { - Assert.notNull(supportedMimeTypes, "'supportedMimeTypes' is required"); + Assert.notNull(supportedMimeTypes, "SupportedMimeTypes must not be null"); this.supportedMimeTypes = new ArrayList(supportedMimeTypes); } @@ -77,8 +76,7 @@ public abstract class AbstractMessageConverter implements MessageConverter { /** * Configure the {@link ContentTypeResolver} to use. - *

    - * The default value is {@code null}. However when {@link CompositeMessageConverter} + *

    The default value is {@code null}. However when {@link CompositeMessageConverter} * is used it configures all of its delegates with a default resolver. */ public void setContentTypeResolver(ContentTypeResolver resolver) { @@ -95,15 +93,13 @@ public abstract class AbstractMessageConverter implements MessageConverter { /** * Configure the preferred serialization class to use (byte[] or String) when * converting an Object payload to a {@link Message}. - *

    - * The default value is byte[]. - * - * @param clazz either byte[] or String + *

    The default value is byte[]. + * @param payloadClass either byte[] or String */ - public void setSerializedPayloadClass(Class clazz) { - Assert.isTrue(byte[].class.equals(clazz) || String.class.equals(clazz), - "Payload class must be byte[] or String: " + clazz); - this.serializedPayloadClass = clazz; + public void setSerializedPayloadClass(Class payloadClass) { + Assert.isTrue(byte[].class.equals(payloadClass) || String.class.equals(payloadClass), + "Payload class must be byte[] or String: " + payloadClass); + this.serializedPayloadClass = payloadClass; } /** @@ -117,10 +113,8 @@ public abstract class AbstractMessageConverter implements MessageConverter { * Returns the default content type for the payload. Called when * {@link #toMessage(Object, MessageHeaders)} is invoked without message headers or * without a content type header. - *

    - * By default, this returns the first element of the {@link #getSupportedMimeTypes() + *

    By default, this returns the first element of the {@link #getSupportedMimeTypes() * supportedMimeTypes}, if any. Can be overridden in sub-classes. - * * @param payload the payload being converted to message * @return the content type, or {@code null} if not known */ @@ -131,7 +125,6 @@ public abstract class AbstractMessageConverter implements MessageConverter { /** * Whether the given class is supported by this converter. - * * @param clazz the class to test for support * @return {@code true} if supported; {@code false} otherwise */ diff --git a/spring-messaging/src/main/java/org/springframework/messaging/support/converter/ByteArrayMessageConverter.java b/spring-messaging/src/main/java/org/springframework/messaging/support/converter/ByteArrayMessageConverter.java index a2b9ae8ba4..c784cad6bb 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/support/converter/ByteArrayMessageConverter.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/support/converter/ByteArrayMessageConverter.java @@ -20,7 +20,6 @@ import org.springframework.messaging.Message; import org.springframework.messaging.MessageHeaders; import org.springframework.util.MimeTypeUtils; - /** * A {@link MessageConverter} that supports MIME type "application/octet-stream" with the * payload converted to and from a byte[]. diff --git a/spring-messaging/src/main/java/org/springframework/messaging/support/converter/CompositeMessageConverter.java b/spring-messaging/src/main/java/org/springframework/messaging/support/converter/CompositeMessageConverter.java index d3c41d8a98..ec0ab3d340 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/support/converter/CompositeMessageConverter.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/support/converter/CompositeMessageConverter.java @@ -24,7 +24,6 @@ import org.springframework.messaging.Message; import org.springframework.messaging.MessageHeaders; import org.springframework.util.Assert; - /** * A {@link MessageConverter} that delegates to a list of other converters to invoke until * one of them returns a non-null value. @@ -52,8 +51,8 @@ public class CompositeMessageConverter implements MessageConverter { * the given {@link ContentTypeResolver}. */ public CompositeMessageConverter(Collection converters, ContentTypeResolver resolver) { - Assert.notEmpty(converters, "converters is required"); - Assert.notNull(resolver, "contentTypeResolver is required"); + Assert.notEmpty(converters, "Converters must not be null"); + Assert.notNull(resolver, "ContentTypeResolver must not be null"); this.converters = new ArrayList(converters); this.contentTypeResolver = resolver; applyContentTypeResolver(converters, resolver); diff --git a/spring-messaging/src/main/java/org/springframework/messaging/support/converter/ContentTypeResolver.java b/spring-messaging/src/main/java/org/springframework/messaging/support/converter/ContentTypeResolver.java index 4c7613f482..e725b6db91 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/support/converter/ContentTypeResolver.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/support/converter/ContentTypeResolver.java @@ -19,7 +19,6 @@ package org.springframework.messaging.support.converter; import org.springframework.messaging.MessageHeaders; import org.springframework.util.MimeType; - /** * Resolve the content type for a message given a set of {@link MessageHeaders}. * diff --git a/spring-messaging/src/main/java/org/springframework/messaging/support/converter/DefaultContentTypeResolver.java b/spring-messaging/src/main/java/org/springframework/messaging/support/converter/DefaultContentTypeResolver.java index dd7efd5d33..355d71ceda 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/support/converter/DefaultContentTypeResolver.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/support/converter/DefaultContentTypeResolver.java @@ -19,7 +19,6 @@ package org.springframework.messaging.support.converter; import org.springframework.messaging.MessageHeaders; import org.springframework.util.MimeType; - /** * A default {@link ContentTypeResolver} that checks the * {@link MessageHeaders#CONTENT_TYPE} header or falls back to a default, if a default is diff --git a/spring-messaging/src/main/java/org/springframework/messaging/support/converter/MappingJackson2MessageConverter.java b/spring-messaging/src/main/java/org/springframework/messaging/support/converter/MappingJackson2MessageConverter.java index 2a70c0bf8a..e91bd5d41f 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/support/converter/MappingJackson2MessageConverter.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/support/converter/MappingJackson2MessageConverter.java @@ -33,7 +33,6 @@ import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; - /** * A Jackson 2 based {@link MessageConverter} implementation. * diff --git a/spring-messaging/src/main/java/org/springframework/messaging/support/converter/MessageConverter.java b/spring-messaging/src/main/java/org/springframework/messaging/support/converter/MessageConverter.java index ae9ffe881a..0bedb341d1 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/support/converter/MessageConverter.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/support/converter/MessageConverter.java @@ -19,7 +19,6 @@ package org.springframework.messaging.support.converter; import org.springframework.messaging.Message; import org.springframework.messaging.MessageHeaders; - /** * A converter to turn the payload of a {@link Message} from serialized form to a typed * Object and vice versa. The {@link MessageHeaders#CONTENT_TYPE} message header may be @@ -35,15 +34,12 @@ public interface MessageConverter { * Convert the payload of a {@link Message} from serialized form to a typed Object of * the specified target class. The {@link MessageHeaders#CONTENT_TYPE} header should * indicate the MIME type to convert from. - *

    - * If the converter does not support the specified media type or cannot perform the + *

    If the converter does not support the specified media type or cannot perform the * conversion, it should return {@code null}. - * * @param message the input message * @param targetClass the target class for the conversion - * * @return the result of the conversion or {@code null} if the converter cannot - * perform the conversion + * perform the conversion */ Object fromMessage(Message message, Class targetClass); @@ -53,15 +49,12 @@ public interface MessageConverter { * may contain a {@link MessageHeaders#CONTENT_TYPE} header to specify the target * media type for the conversion and it may contain additional headers to be added to * the message. - *

    - * If the converter does not support the specified media type or cannot perform the + *

    If the converter does not support the specified media type or cannot perform the * conversion, it should return {@code null}. - * * @param payload the Object to convert * @param header optional headers for the message, may be {@code null} - * * @return the new message or {@code null} if the converter does not support the - * Object type or the target media type + * Object type or the target media type */ Message toMessage(Object payload, MessageHeaders header); diff --git a/spring-messaging/src/main/java/org/springframework/messaging/support/converter/SimpleMessageConverter.java b/spring-messaging/src/main/java/org/springframework/messaging/support/converter/SimpleMessageConverter.java index a6764862d7..2fc6db232a 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/support/converter/SimpleMessageConverter.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/support/converter/SimpleMessageConverter.java @@ -24,8 +24,8 @@ import org.springframework.util.ClassUtils; /** * A simple converter that simply unwraps the message payload as long as it matches the * expected target class. Or reversely, simply wraps the payload in a message. - *

    - * Note that this converter ignores any content type information that may be present in + * + *

    Note that this converter ignores any content type information that may be present in * message headers and should not be used if payload conversion is actually required. * * @author Rossen Stoyanchev diff --git a/spring-messaging/src/main/java/org/springframework/messaging/support/converter/StringMessageConverter.java b/spring-messaging/src/main/java/org/springframework/messaging/support/converter/StringMessageConverter.java index 965b9fd8e6..4e16f33ced 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/support/converter/StringMessageConverter.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/support/converter/StringMessageConverter.java @@ -22,7 +22,6 @@ import org.springframework.messaging.Message; import org.springframework.messaging.MessageHeaders; import org.springframework.util.MimeType; - /** * A {@link MessageConverter} that supports MIME type "text/plain" with the * payload converted to and from a String. diff --git a/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/AbstractPromiseToListenableFutureAdapter.java b/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/AbstractPromiseToListenableFutureAdapter.java index 63e54893c1..7ccbd188ed 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/AbstractPromiseToListenableFutureAdapter.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/AbstractPromiseToListenableFutureAdapter.java @@ -46,8 +46,7 @@ abstract class AbstractPromiseToListenableFutureAdapter implements Listena protected AbstractPromiseToListenableFutureAdapter(Promise promise) { - - Assert.notNull(promise, "promise is required"); + Assert.notNull(promise, "Promise must not be null"); this.promise = promise; this.promise.onSuccess(new Consumer() { diff --git a/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/FixedIntervalReconnectStrategy.java b/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/FixedIntervalReconnectStrategy.java index 63e1193639..f36db3a86c 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/FixedIntervalReconnectStrategy.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/FixedIntervalReconnectStrategy.java @@ -16,7 +16,6 @@ package org.springframework.messaging.support.tcp; - /** * A simple strategy for making reconnect attempts at a fixed interval. * @@ -35,6 +34,7 @@ public class FixedIntervalReconnectStrategy implements ReconnectStrategy { this.interval = interval; } + @Override public Long getTimeToNextAttempt(int attemptCount) { return this.interval; diff --git a/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/PassThroughPromiseToListenableFutureAdapter.java b/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/PassThroughPromiseToListenableFutureAdapter.java index 03d6f528fd..8f62b91ce8 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/PassThroughPromiseToListenableFutureAdapter.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/PassThroughPromiseToListenableFutureAdapter.java @@ -18,7 +18,6 @@ package org.springframework.messaging.support.tcp; import reactor.core.composable.Promise; - /** * A Promise-to-ListenableFutureAdapter where the source and the target from the Promise and * the ListenableFuture respectively are of the same type. @@ -29,13 +28,14 @@ import reactor.core.composable.Promise; class PassThroughPromiseToListenableFutureAdapter extends AbstractPromiseToListenableFutureAdapter { - public PassThroughPromiseToListenableFutureAdapter(Promise promise) { - super(promise); - } + public PassThroughPromiseToListenableFutureAdapter(Promise promise) { + super(promise); + } - @Override - protected T adapt(T result) { - return result; - } -} \ No newline at end of file + @Override + protected T adapt(T result) { + return result; + } + +} diff --git a/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/ReactorNettyTcpClient.java b/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/ReactorNettyTcpClient.java index a38b7923c2..196eb7a209 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/ReactorNettyTcpClient.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/ReactorNettyTcpClient.java @@ -85,7 +85,7 @@ public class ReactorNettyTcpClient

    implements TcpOperations

    { public ListenableFuture connect(final TcpConnectionHandler

    connectionHandler, final ReconnectStrategy reconnectStrategy) { - Assert.notNull(reconnectStrategy, "'reconnectStrategy' is required"); + Assert.notNull(reconnectStrategy, "ReconnectStrategy must not be null"); Stream, Message

    >> stream = this.tcpClient.open(new Reconnect() { diff --git a/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/ReconnectStrategy.java b/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/ReconnectStrategy.java index b81be7c79b..7a2178f53d 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/ReconnectStrategy.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/ReconnectStrategy.java @@ -27,7 +27,6 @@ public interface ReconnectStrategy { /** * Return the time to the next attempt to reconnect. - * * @param attemptCount how many reconnect attempts have been made already * @return the amount of time in milliseconds or {@code null} to stop */ diff --git a/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/TcpConnection.java b/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/TcpConnection.java index 603fd1df63..8e88abdd8e 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/TcpConnection.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/TcpConnection.java @@ -32,9 +32,8 @@ public interface TcpConnection

    { /** * Send the given message. * @param message the message - * * @return a ListenableFuture that can be used to determine when and if the - * message was successfully sent + * message was successfully sent */ ListenableFuture send(Message

    message); diff --git a/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/TcpOperations.java b/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/TcpOperations.java index 86cbd9f425..4d9d7a6b4a 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/TcpOperations.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/support/tcp/TcpOperations.java @@ -30,30 +30,25 @@ public interface TcpOperations

    { /** * Open a new connection. - * * @param connectionHandler a handler to manage the connection - * * @return a ListenableFuture that can be used to determine when and if the - * connection is successfully established + * connection is successfully established */ ListenableFuture connect(TcpConnectionHandler

    connectionHandler); /** * Open a new connection and a strategy for reconnecting if the connection fails. - * * @param connectionHandler a handler to manage the connection * @param reconnectStrategy a strategy for reconnecting - * * @return a ListenableFuture that can be used to determine when and if the - * initial connection is successfully established + * initial connection is successfully established */ ListenableFuture connect(TcpConnectionHandler

    connectionHandler, ReconnectStrategy reconnectStrategy); /** * Shut down and close any open connections. - * * @return a ListenableFuture that can be used to determine when and if the - * connection is successfully closed + * connection is successfully closed */ ListenableFuture shutdown(); diff --git a/spring-test/src/main/java/org/springframework/test/context/ActiveProfilesResolver.java b/spring-test/src/main/java/org/springframework/test/context/ActiveProfilesResolver.java index 0985ebb02c..2f0a976e91 100644 --- a/spring-test/src/main/java/org/springframework/test/context/ActiveProfilesResolver.java +++ b/spring-test/src/main/java/org/springframework/test/context/ActiveProfilesResolver.java @@ -37,7 +37,6 @@ public interface ActiveProfilesResolver { /** * Resolve the bean definition profiles to use when loading an * {@code ApplicationContext} for the given {@linkplain Class test class}. - * * @param testClass the test class for which the profiles should be resolved; * never {@code null} * @return the list of bean definition profiles to use when loading the diff --git a/spring-test/src/main/java/org/springframework/test/context/ContextLoaderUtils.java b/spring-test/src/main/java/org/springframework/test/context/ContextLoaderUtils.java index 0785630604..bb22a5a39f 100644 --- a/spring-test/src/main/java/org/springframework/test/context/ContextLoaderUtils.java +++ b/spring-test/src/main/java/org/springframework/test/context/ContextLoaderUtils.java @@ -216,7 +216,6 @@ abstract class ContextLoaderUtils { * Convenience method for creating a {@link ContextConfigurationAttributes} * instance from the supplied {@link AnnotationAttributes} and declaring * class and then adding the attributes to the supplied list. - * * @since 4.0 */ private static void convertAnnotationAttributesToConfigAttributesAndAddToList(AnnotationAttributes annAttrs, diff --git a/spring-test/src/main/java/org/springframework/test/web/servlet/result/MockMvcResultMatchers.java b/spring-test/src/main/java/org/springframework/test/web/servlet/result/MockMvcResultMatchers.java index 90ca60a9c4..8c163b3e4e 100644 --- a/spring-test/src/main/java/org/springframework/test/web/servlet/result/MockMvcResultMatchers.java +++ b/spring-test/src/main/java/org/springframework/test/web/servlet/result/MockMvcResultMatchers.java @@ -98,7 +98,6 @@ public abstract class MockMvcResultMatchers { /** * Asserts the request was forwarded to the given URL. * This methods accepts {@link org.springframework.util.AntPathMatcher} expressions. - * * @param urlPattern an AntPath expression to match against * @see org.springframework.util.AntPathMatcher * @since 4.0 @@ -133,7 +132,6 @@ public abstract class MockMvcResultMatchers { /** * Asserts the request was redirected to the given URL. * This methods accepts {@link org.springframework.util.AntPathMatcher} expressions. - * * @param expectedUrl an AntPath expression to match against * @see org.springframework.util.AntPathMatcher * @since 4.0 diff --git a/spring-web/src/main/java/org/springframework/http/client/AbstractAsyncClientHttpRequest.java b/spring-web/src/main/java/org/springframework/http/client/AbstractAsyncClientHttpRequest.java index cc9112034a..594c2fb9dd 100644 --- a/spring-web/src/main/java/org/springframework/http/client/AbstractAsyncClientHttpRequest.java +++ b/spring-web/src/main/java/org/springframework/http/client/AbstractAsyncClientHttpRequest.java @@ -58,7 +58,6 @@ abstract class AbstractAsyncClientHttpRequest implements AsyncClientHttpRequest /** * Asserts that this request has not been {@linkplain #executeAsync() executed} yet. - * * @throws IllegalStateException if this request has been executed */ protected void assertNotExecuted() { diff --git a/spring-web/src/main/java/org/springframework/http/client/AsyncClientHttpRequest.java b/spring-web/src/main/java/org/springframework/http/client/AsyncClientHttpRequest.java index 06cf17e70c..c7b136c7c9 100644 --- a/spring-web/src/main/java/org/springframework/http/client/AsyncClientHttpRequest.java +++ b/spring-web/src/main/java/org/springframework/http/client/AsyncClientHttpRequest.java @@ -37,7 +37,6 @@ public interface AsyncClientHttpRequest extends HttpRequest, HttpOutputMessage { /** * Execute this request asynchronously, resulting in a future * {@link ClientHttpResponse} that can be read. - * * @return the future response result of the execution * @throws java.io.IOException in case of I/O errors */ diff --git a/spring-web/src/main/java/org/springframework/http/client/AsyncClientHttpRequestFactory.java b/spring-web/src/main/java/org/springframework/http/client/AsyncClientHttpRequestFactory.java index 89cdd9fd0d..4e3eb662d1 100644 --- a/spring-web/src/main/java/org/springframework/http/client/AsyncClientHttpRequestFactory.java +++ b/spring-web/src/main/java/org/springframework/http/client/AsyncClientHttpRequestFactory.java @@ -35,7 +35,6 @@ public interface AsyncClientHttpRequestFactory { * HTTP method. *

    The returned request can be written to, and then executed by calling * {@link AsyncClientHttpRequest#executeAsync()}. - * * @param uri the URI to create a request for * @param httpMethod the HTTP method to execute * @return the created request diff --git a/spring-web/src/main/java/org/springframework/http/client/HttpComponentsAsyncClientHttpRequestFactory.java b/spring-web/src/main/java/org/springframework/http/client/HttpComponentsAsyncClientHttpRequestFactory.java index 198c60bf16..9fef0a61e7 100644 --- a/spring-web/src/main/java/org/springframework/http/client/HttpComponentsAsyncClientHttpRequestFactory.java +++ b/spring-web/src/main/java/org/springframework/http/client/HttpComponentsAsyncClientHttpRequestFactory.java @@ -36,7 +36,7 @@ import org.springframework.util.Assert; /** * Asynchronous extension of the {@link HttpComponentsClientHttpRequestFactory}. Uses - * Apache HttpComponents + * Apache HttpComponents * HttpAsyncClient 4.0 to create requests. * * @author Arjen Poutsma diff --git a/spring-web/src/main/java/org/springframework/http/client/HttpComponentsStreamingClientHttpRequest.java b/spring-web/src/main/java/org/springframework/http/client/HttpComponentsStreamingClientHttpRequest.java index 64d4b0b5e0..6be05620ba 100644 --- a/spring-web/src/main/java/org/springframework/http/client/HttpComponentsStreamingClientHttpRequest.java +++ b/spring-web/src/main/java/org/springframework/http/client/HttpComponentsStreamingClientHttpRequest.java @@ -39,11 +39,11 @@ import org.springframework.http.StreamingHttpOutputMessage; * {@link ClientHttpRequest} implementation that uses Apache HttpComponents HttpClient to * execute requests. * - *

    Created via the {@link org.springframework.http.client.HttpComponentsClientHttpRequestFactory}. + *

    Created via the + * {@link org.springframework.http.client.HttpComponentsClientHttpRequestFactory}. * * @author Arjen Poutsma - * @see org.springframework.http.client.HttpComponentsClientHttpRequestFactory#createRequest(java.net.URI, - * org.springframework.http.HttpMethod) + * @see org.springframework.http.client.HttpComponentsClientHttpRequestFactory#createRequest(java.net.URI, org.springframework.http.HttpMethod) * @since 4.0 */ final class HttpComponentsStreamingClientHttpRequest extends AbstractClientHttpRequest diff --git a/spring-web/src/main/java/org/springframework/http/client/support/AsyncHttpAccessor.java b/spring-web/src/main/java/org/springframework/http/client/support/AsyncHttpAccessor.java index e2a95d9780..cf75376462 100644 --- a/spring-web/src/main/java/org/springframework/http/client/support/AsyncHttpAccessor.java +++ b/spring-web/src/main/java/org/springframework/http/client/support/AsyncHttpAccessor.java @@ -65,7 +65,6 @@ public class AsyncHttpAccessor { /** * Create a new {@link AsyncClientHttpRequest} via this template's {@link * AsyncClientHttpRequestFactory}. - * * @param url the URL to connect to * @param method the HTTP method to execute (GET, POST, etc.) * @return the created request diff --git a/spring-web/src/main/java/org/springframework/http/server/ServerHttpAsyncRequestControl.java b/spring-web/src/main/java/org/springframework/http/server/ServerHttpAsyncRequestControl.java index 79dfd55c3b..5fc6a9f8d2 100644 --- a/spring-web/src/main/java/org/springframework/http/server/ServerHttpAsyncRequestControl.java +++ b/spring-web/src/main/java/org/springframework/http/server/ServerHttpAsyncRequestControl.java @@ -15,7 +15,6 @@ */ package org.springframework.http.server; - /** * A control that can put the processing of an HTTP request in asynchronous mode during * which the response remains open until explicitly closed. diff --git a/spring-web/src/main/java/org/springframework/http/server/ServletServerHttpAsyncRequestControl.java b/spring-web/src/main/java/org/springframework/http/server/ServletServerHttpAsyncRequestControl.java index f7f0b91d95..b9087a9050 100644 --- a/spring-web/src/main/java/org/springframework/http/server/ServletServerHttpAsyncRequestControl.java +++ b/spring-web/src/main/java/org/springframework/http/server/ServletServerHttpAsyncRequestControl.java @@ -27,7 +27,6 @@ import javax.servlet.http.HttpServletResponse; import org.springframework.util.Assert; - /** * A {@link ServerHttpAsyncRequestControl} to use on Servlet containers (Servlet 3.0+). * diff --git a/spring-web/src/main/java/org/springframework/web/bind/annotation/ControllerAdvice.java b/spring-web/src/main/java/org/springframework/web/bind/annotation/ControllerAdvice.java index e5bac276c2..0180582436 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/annotation/ControllerAdvice.java +++ b/spring-web/src/main/java/org/springframework/web/bind/annotation/ControllerAdvice.java @@ -63,7 +63,6 @@ public @interface ControllerAdvice { * Allows for more concise annotation declarations e.g.: * {@code @ControllerAdvice("org.my.pkg")} is equivalent to * {@code @ControllerAdvice(basePackages="org.my.pkg")}. - * * @since 4.0 */ String[] value() default {}; @@ -73,11 +72,9 @@ public @interface ControllerAdvice { * Controllers that belong to those base packages will be included, e.g.: * {@code @ControllerAdvice(basePackages="org.my.pkg")} or * {@code @ControllerAdvice(basePackages={"org.my.pkg","org.my.other.pkg"})} - * *

    {@link #value()} is an alias for this attribute. *

    Also consider using {@link #basePackageClasses()} as a type-safe * alternative to String-based package names. - * * @since 4.0 */ String[] basePackages() default {}; @@ -86,10 +83,8 @@ public @interface ControllerAdvice { * Type-safe alternative to {@link #value()} for specifying the packages * to select Controllers to be assisted by the {@code @ControllerAdvice} * annotated class. - * *

    Consider creating a special no-op marker class or interface in each package * that serves no purpose other than being referenced by this attribute. - * * @since 4.0 */ Class[] basePackageClasses() default {}; @@ -98,7 +93,6 @@ public @interface ControllerAdvice { * Array of classes. * Controllers that are assignable to at least one of the given types * will be assisted by the {@code @ControllerAdvice} annotated class. - * * @since 4.0 */ Class[] assignableTypes() default {}; diff --git a/spring-web/src/main/java/org/springframework/web/method/ControllerAdviceBean.java b/spring-web/src/main/java/org/springframework/web/method/ControllerAdviceBean.java index b82f31bd36..1ccee63b8c 100644 --- a/spring-web/src/main/java/org/springframework/web/method/ControllerAdviceBean.java +++ b/spring-web/src/main/java/org/springframework/web/method/ControllerAdviceBean.java @@ -188,7 +188,6 @@ public class ControllerAdviceBean implements Ordered { /** * Checks whether the given bean type should be assisted by this * {@code @ControllerAdvice} instance. - * * @param beanType the type of the bean to check * @see org.springframework.web.bind.annotation.ControllerAdvice * @since 4.0 diff --git a/spring-web/src/main/java/org/springframework/web/method/support/CompositeUriComponentsContributor.java b/spring-web/src/main/java/org/springframework/web/method/support/CompositeUriComponentsContributor.java index dfccebd7d2..11e890bd9a 100644 --- a/spring-web/src/main/java/org/springframework/web/method/support/CompositeUriComponentsContributor.java +++ b/spring-web/src/main/java/org/springframework/web/method/support/CompositeUriComponentsContributor.java @@ -48,7 +48,6 @@ public class CompositeUriComponentsContributor implements UriComponentsContribut * by the same class, the most convenient option is to obtain the configured * {@code HandlerMethodArgumentResolvers} in {@code RequestMappingHandlerAdapter} and * provide that to this constructor. - * * @param contributors a collection of {@link UriComponentsContributor} * or {@link HandlerMethodArgumentResolver}s. */ @@ -62,15 +61,13 @@ public class CompositeUriComponentsContributor implements UriComponentsContribut * by the same class, the most convenient option is to obtain the configured * {@code HandlerMethodArgumentResolvers} in the {@code RequestMappingHandlerAdapter} * and provide that to this constructor. - *

    - * If the {@link ConversionService} argument is {@code null}, + *

    If the {@link ConversionService} argument is {@code null}, * {@link org.springframework.format.support.DefaultFormattingConversionService} * will be used by default. - * * @param contributors a collection of {@link UriComponentsContributor} - * or {@link HandlerMethodArgumentResolver}s. + * or {@link HandlerMethodArgumentResolver}s. * @param conversionService a ConversionService to use when method argument values - * need to be formatted as Strings before being added to the URI + * need to be formatted as Strings before being added to the URI */ public CompositeUriComponentsContributor(Collection contributors, ConversionService conversionService) { diff --git a/spring-web/src/main/java/org/springframework/web/method/support/UriComponentsContributor.java b/spring-web/src/main/java/org/springframework/web/method/support/UriComponentsContributor.java index 1fdb3d5810..61149b1b01 100644 --- a/spring-web/src/main/java/org/springframework/web/method/support/UriComponentsContributor.java +++ b/spring-web/src/main/java/org/springframework/web/method/support/UriComponentsContributor.java @@ -43,7 +43,6 @@ public interface UriComponentsContributor { * Process the given method argument and either update the * {@link UriComponentsBuilder} or add to the map with URI variables to use to * expand the URI after all arguments are processed. - * * @param parameter the controller method parameter, never {@literal null}. * @param value the argument value, possibly {@literal null}. * @param builder the builder to update, never {@literal null}. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/DispatcherServlet.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/DispatcherServlet.java index 665b2a2a2e..e2ffc308a4 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/DispatcherServlet.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/DispatcherServlet.java @@ -416,12 +416,10 @@ public class DispatcherServlet extends FrameworkServlet { * Set whether to throw a NoHandlerFoundException when no Handler was found for this request. * This exception can then be caught with a HandlerExceptionResolver or an * {@code @ExceptionHandler} controller method. - * *

    Note that if * {@link org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler} * is used, then requests will always be forwarded to the default servlet and * a NoHandlerFoundException would never be thrown in that case. - * *

    Default is "false", meaning the DispatcherServlet sends a NOT_FOUND error * through the Servlet response. * @since 4.0 diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/FrameworkServlet.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/FrameworkServlet.java index b38e52a033..6dde6d8dc1 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/FrameworkServlet.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/FrameworkServlet.java @@ -1056,10 +1056,8 @@ public abstract class FrameworkServlet extends HttpServletBean implements Applic * Spring Beans inside an existing {@link WebApplicationContext} rather than * {@link #findWebApplicationContext() finding} a * {@link org.springframework.web.context.ContextLoaderListener bootstrapped} context. - * *

    Primarily added to support use in embedded servlet containers, this method is not * intended to be called directly. - * * @since 4.0 */ @Override diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/NoHandlerFoundException.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/NoHandlerFoundException.java index 5c8989b633..b6df9f9016 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/NoHandlerFoundException.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/NoHandlerFoundException.java @@ -20,10 +20,9 @@ import javax.servlet.ServletException; import org.springframework.http.HttpHeaders; /** - * Exception to be thrown if DispatcherServlet is unable to determine - * a corresponding handler for an incoming HTTP request. - * The DispatcherServlet throws this exception only if its - * throwExceptionIfNoHandlerFound property is set to "true". + * Exception to be thrown if DispatcherServlet is unable to determine a corresponding + * handler for an incoming HTTP request. The DispatcherServlet throws this exception only + * if its throwExceptionIfNoHandlerFound property is set to "true". * * @author Brian Clozel * @since 4.0 diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/MvcUriComponentsBuilder.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/MvcUriComponentsBuilder.java index 9afa51046f..26a940a87c 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/MvcUriComponentsBuilder.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/MvcUriComponentsBuilder.java @@ -57,7 +57,6 @@ import java.util.*; * * @since 4.0 */ - public class MvcUriComponentsBuilder extends UriComponentsBuilder { /** @@ -90,9 +89,7 @@ public class MvcUriComponentsBuilder extends UriComponentsBuilder { * resulting builder contains the current request information up to and including * the Servlet mapping plus any type-level request mapping. If the controller * contains multiple mappings, the first one is used. - * * @param controllerType the controller to create a URI for - * * @return a UriComponentsBuilder instance */ public static UriComponentsBuilder fromController(Class controllerType) { @@ -106,18 +103,14 @@ public class MvcUriComponentsBuilder extends UriComponentsBuilder { * method name and the number of argument values. If that results in a clash * (i.e. overloaded methods with the same number of parameters), use * {@link #fromMethod(java.lang.reflect.Method, Object...)} instead. - *

    - * The argument values are used to prepare the URI for example expanding + *

    The argument values are used to prepare the URI for example expanding * path variables, or adding query parameters. Any other arguments not * relevant to the URI can be provided as {@literal null} and will be ignored. - *

    - * Additional (custom) argument types can be supported through an implementation + *

    Additional (custom) argument types can be supported through an implementation * of {@link org.springframework.web.method.support.UriComponentsContributor}. - * * @param controllerType the target controller type * @param methodName the target method name * @param argumentValues argument values matching to method parameters - * * @return a UriComponentsBuilder instance */ public static UriComponentsBuilder fromMethodName(Class controllerType, @@ -147,13 +140,10 @@ public class MvcUriComponentsBuilder extends UriComponentsBuilder { * prepare the URI for example expanding path variables, or adding request * parameters. Any other arguments not relevant to the URL can be provided as * {@literal null} and will be ignored. - *

    - * Additional (custom) argument types can be supported through an implementation + *

    Additional (custom) argument types can be supported through an implementation * of {@link org.springframework.web.method.support.UriComponentsContributor}. - * * @param method the target controller method * @param argumentValues argument values matching to method parameters - * * @return a UriComponentsBuilder instance */ public static UriComponentsBuilder fromMethod(Method method, Object... argumentValues) { @@ -172,8 +162,7 @@ public class MvcUriComponentsBuilder extends UriComponentsBuilder { /** * Create a {@link UriComponents} by invoking a method on a "mock" controller, similar * to how test frameworks provide mock objects and record method invocations. - *

    - * For example given this controller: + *

    For example given this controller: * *

     	 * @RequestMapping("/people/{id}/addresses")
    @@ -207,13 +196,10 @@ public class MvcUriComponentsBuilder extends UriComponentsBuilder {
     	 *
     	 * The above  supports {@code @PathVariable} and {@code @RequestParam} method parameters.
     	 * Any other arguments can be provided as {@literal null} and will be ignored.
    -	 * 

    - * Additional (custom) argument types can be supported through an implementation + *

    Additional (custom) argument types can be supported through an implementation * of {@link org.springframework.web.method.support.UriComponentsContributor}. - * * @param methodInvocationInfo either the value returned from a "mock" controller - * invocation or the "mock" controller itself after an invocation - * + * invocation or the "mock" controller itself after an invocation * @return a UriComponents instance */ public static UriComponentsBuilder fromMethodCall(Object methodInvocationInfo) { @@ -320,15 +306,12 @@ public class MvcUriComponentsBuilder extends UriComponentsBuilder { * on the controller is invoked, the supplied argument values are remembered * and the result can then be used to prepare a URL to the method via * {@link #fromMethodCall(Object)}. - *

    - * This is a shorthand version of {@link #controller(Class)} intended for + *

    This is a shorthand version of {@link #controller(Class)} intended for * inline use as follows: - * *

     	 * UriComponentsBuilder builder = MvcUriComponentsBuilder.fromMethodCall(
     	 * 		on(FooController.class).getFoo(1)).build();
     	 * 
    - * * @param controllerType the target controller */ public static T on(Class controllerType) { @@ -340,10 +323,8 @@ public class MvcUriComponentsBuilder extends UriComponentsBuilder { * on the controller is invoked, the supplied argument values are remembered * and the result can then be used to prepare a URL to the method via * {@link #fromMethodCall(Object)}. - *

    - * This is a longer version of {@link #on(Class)} for use with void controller + *

    This is a longer version of {@link #on(Class)} for use with void controller * methods as well as for creating multiple links in succession. - * *

     	 * FooController fooController = controller(FooController.class);
     	 *
    @@ -353,7 +334,6 @@ public class MvcUriComponentsBuilder extends UriComponentsBuilder {
     	 * fooController.saveFoo(2, null);
     	 * builder = MvcUriComponentsBuilder.fromMethodCall(fooController);
     	 * 
    - * * @param controllerType the target controller */ public static T controller(Class controllerType) { diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/AbstractWebSocketMessage.java b/spring-websocket/src/main/java/org/springframework/web/socket/AbstractWebSocketMessage.java index ded34be25a..b8e4eaefde 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/AbstractWebSocketMessage.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/AbstractWebSocketMessage.java @@ -34,7 +34,6 @@ public abstract class AbstractWebSocketMessage implements WebSocketMessage /** * Create a new WebSocket message with the given payload. - * * @param payload the non-null payload */ AbstractWebSocketMessage(T payload) { @@ -46,12 +45,11 @@ public abstract class AbstractWebSocketMessage implements WebSocketMessage * message content. When the {@code isLast} boolean flag is set to {@code false} * the message is sent as partial content and more partial messages will be * expected until the boolean flag is set to {@code true}. - * * @param payload the non-null payload * @param isLast if the message is the last of a series of partial messages */ AbstractWebSocketMessage(T payload, boolean isLast) { - Assert.notNull(payload, "payload is required"); + Assert.notNull(payload, "payload must not be null"); this.payload = payload; this.last = isLast; } diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/BinaryMessage.java b/spring-websocket/src/main/java/org/springframework/web/socket/BinaryMessage.java index a95f05332c..8212bb0ef5 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/BinaryMessage.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/BinaryMessage.java @@ -29,7 +29,6 @@ public final class BinaryMessage extends AbstractWebSocketMessage { /** * Create a new binary WebSocket message with the given ByteBuffer payload. - * * @param payload the non-null payload */ public BinaryMessage(ByteBuffer payload) { @@ -41,7 +40,6 @@ public final class BinaryMessage extends AbstractWebSocketMessage { * full or partial message content. When the {@code isLast} boolean flag is set * to {@code false} the message is sent as partial content and more partial * messages will be expected until the boolean flag is set to {@code true}. - * * @param payload the non-null payload * @param isLast if the message is the last of a series of partial messages */ @@ -51,9 +49,8 @@ public final class BinaryMessage extends AbstractWebSocketMessage { /** * Create a new binary WebSocket message with the given byte[] payload. - * * @param payload a non-null payload; note that this value is not copied so care - * must be taken not to modify the array. + * must be taken not to modify the array. */ public BinaryMessage(byte[] payload) { this(payload, true); @@ -64,9 +61,8 @@ public final class BinaryMessage extends AbstractWebSocketMessage { * the full or partial message content. When the {@code isLast} boolean flag is set * to {@code false} the message is sent as partial content and more partial * messages will be expected until the boolean flag is set to {@code true}. - * * @param payload a non-null payload; note that this value is not copied so care - * must be taken not to modify the array. + * must be taken not to modify the array. * @param isLast if the message is the last of a series of partial messages */ public BinaryMessage(byte[] payload, boolean isLast) { @@ -75,9 +71,8 @@ public final class BinaryMessage extends AbstractWebSocketMessage { /** * Create a new binary WebSocket message by wrapping an existing byte array. - * * @param payload a non-null payload; note that this value is not copied so care - * must be taken not to modify the array. + * must be taken not to modify the array. * @param offset the offset into the array where the payload starts * @param length the length of the array considered for the payload * @param isLast if the message is the last of a series of partial messages diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/PingMessage.java b/spring-websocket/src/main/java/org/springframework/web/socket/PingMessage.java index cf07739e66..ea036d0efe 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/PingMessage.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/PingMessage.java @@ -36,7 +36,6 @@ public final class PingMessage extends AbstractWebSocketMessage { /** * Create a new ping message with the given ByteBuffer payload. - * * @param payload the non-null payload */ public PingMessage(ByteBuffer payload) { diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/PongMessage.java b/spring-websocket/src/main/java/org/springframework/web/socket/PongMessage.java index 1d94edd815..e76fe3e0d1 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/PongMessage.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/PongMessage.java @@ -36,7 +36,6 @@ public final class PongMessage extends AbstractWebSocketMessage { /** * Create a new pong message with the given ByteBuffer payload. - * * @param payload the non-null payload */ public PongMessage(ByteBuffer payload) { diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/TextMessage.java b/spring-websocket/src/main/java/org/springframework/web/socket/TextMessage.java index f4c354b9b0..1be1ac1c97 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/TextMessage.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/TextMessage.java @@ -27,7 +27,6 @@ public final class TextMessage extends AbstractWebSocketMessage { /** * Create a new text WebSocket message from the given CharSequence payload. - * * @param payload the non-null payload */ public TextMessage(CharSequence payload) { @@ -39,7 +38,6 @@ public final class TextMessage extends AbstractWebSocketMessage { * full or partial message content. When the {@code isLast} boolean flag is set * to {@code false} the message is sent as partial content and more partial * messages will be expected until the boolean flag is set to {@code true}. - * * @param payload the non-null payload * @param isLast whether this the last part of a series of partial messages */ diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/WebSocketHandler.java b/spring-websocket/src/main/java/org/springframework/web/socket/WebSocketHandler.java index f5c2960eb2..16642408bc 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/WebSocketHandler.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/WebSocketHandler.java @@ -18,8 +18,8 @@ package org.springframework.web.socket; /** * A handler for WebSocket messages and lifecycle events. - *

    - * Implementations of this interface are encouraged to handle exceptions locally where + * + *

    Implementations of this interface are encouraged to handle exceptions locally where * it makes sense or alternatively let the exception bubble up in which case by default * the exception is logged and the session closed with * {@link CloseStatus#SERVER_ERROR SERVER_ERROR(1011)}. The exception handling @@ -38,21 +38,21 @@ public interface WebSocketHandler { * Invoked after WebSocket negotiation has succeeded and the WebSocket connection is * opened and ready for use. * @throws Exception this method can handle or propagate exceptions; see class-level - * Javadoc for details. + * Javadoc for details. */ void afterConnectionEstablished(WebSocketSession session) throws Exception; /** * Invoked when a new WebSocket message arrives. * @throws Exception this method can handle or propagate exceptions; see class-level - * Javadoc for details. + * Javadoc for details. */ void handleMessage(WebSocketSession session, WebSocketMessage message) throws Exception; /** * Handle an error from the underlying WebSocket message transport. * @throws Exception this method can handle or propagate exceptions; see class-level - * Javadoc for details. + * Javadoc for details. */ void handleTransportError(WebSocketSession session, Throwable exception) throws Exception; @@ -61,9 +61,8 @@ public interface WebSocketHandler { * transport error has occurred. Although the session may technically still be open, * depending on the underlying implementation, sending messages at this point is * discouraged and most likely will not succeed. - * * @throws Exception this method can handle or propagate exceptions; see class-level - * Javadoc for details. + * Javadoc for details. */ void afterConnectionClosed(WebSocketSession session, CloseStatus closeStatus) throws Exception; diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/adapter/AbstractWebSocketSesssion.java b/spring-websocket/src/main/java/org/springframework/web/socket/adapter/AbstractWebSocketSesssion.java index 99128a65f3..b3ee658673 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/adapter/AbstractWebSocketSesssion.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/adapter/AbstractWebSocketSesssion.java @@ -46,9 +46,8 @@ public abstract class AbstractWebSocketSesssion implements WebSocketSession, /** * Class constructor - * * @param handshakeAttributes attributes from the HTTP handshake to make available - * through the WebSocket session + * through the WebSocket session */ public AbstractWebSocketSesssion(Map handshakeAttributes) { this.handshakeAttributes = handshakeAttributes; diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/adapter/JettyWebSocketSession.java b/spring-websocket/src/main/java/org/springframework/web/socket/adapter/JettyWebSocketSession.java index 5e507f6d06..62b5b9cd54 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/adapter/JettyWebSocketSession.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/adapter/JettyWebSocketSession.java @@ -52,8 +52,7 @@ public class JettyWebSocketSession extends AbstractWebSocketSesssion handshakeAttributes, InetSocketAddress localAddress, InetSocketAddress remoteAddress) { - super(handshakeAttributes); headers = (headers != null) ? headers : new HttpHeaders(); this.handshakeHeaders = HttpHeaders.readOnlyHttpHeaders(headers); diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/adapter/TextWebSocketHandlerAdapter.java b/spring-websocket/src/main/java/org/springframework/web/socket/adapter/TextWebSocketHandlerAdapter.java index d2e05109bc..96f4420f18 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/adapter/TextWebSocketHandlerAdapter.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/adapter/TextWebSocketHandlerAdapter.java @@ -39,7 +39,7 @@ public class TextWebSocketHandlerAdapter extends WebSocketHandlerAdapter { try { session.close(CloseStatus.NOT_ACCEPTABLE.withReason("Binary messages not supported")); } - catch (IOException e) { + catch (IOException ex) { // ignore } } diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/client/AbstractWebSocketClient.java b/spring-websocket/src/main/java/org/springframework/web/socket/client/AbstractWebSocketClient.java index cba6217748..6a0236e162 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/client/AbstractWebSocketClient.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/client/AbstractWebSocketClient.java @@ -34,7 +34,6 @@ import org.springframework.web.socket.support.WebSocketExtension; import org.springframework.web.socket.support.WebSocketHttpHeaders; import org.springframework.web.util.UriComponentsBuilder; - /** * Abstract base class for {@link WebSocketClient} implementations. * @@ -105,16 +104,14 @@ public abstract class AbstractWebSocketClient implements WebSocketClient { /** * Perform the actual handshake to establish a connection to the server. - * * @param webSocketHandler the client-side handler for WebSocket messages * @param headers HTTP headers to use for the handshake, with unwanted (forbidden) - * headers filtered out, never {@code null} + * headers filtered out, never {@code null} * @param uri the target URI for the handshake, never {@code null} * @param subProtocols requested sub-protocols, or an empty list * @param extensions requested WebSocket extensions, or an empty list * @param handshakeAttributes attributes to make available via - * {@link WebSocketSession#getHandshakeAttributes()}; currently always an empty map. - * + * {@link WebSocketSession#getHandshakeAttributes()}; currently always an empty map. * @return the established WebSocket session wrapped in a ListenableFuture. */ protected abstract ListenableFuture doHandshakeInternal(WebSocketHandler webSocketHandler, diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/client/ConnectionManagerSupport.java b/spring-websocket/src/main/java/org/springframework/web/socket/client/ConnectionManagerSupport.java index 00e3a17f3e..1fbbc203ea 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/client/ConnectionManagerSupport.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/client/ConnectionManagerSupport.java @@ -58,7 +58,6 @@ public abstract class ConnectionManagerSupport implements SmartLifecycle { /** * Set whether to auto-connect to the remote endpoint after this connection manager * has been initialized and the Spring context has been refreshed. - * *

    Default is "false". */ public void setAutoStartup(boolean autoStartup) { diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/client/WebSocketClient.java b/spring-websocket/src/main/java/org/springframework/web/socket/client/WebSocketClient.java index e7ee361b5f..4b83bd259f 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/client/WebSocketClient.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/client/WebSocketClient.java @@ -30,7 +30,6 @@ import org.springframework.web.socket.support.WebSocketHttpHeaders; * * @author Rossen Stoyanchev * @since 4.0 - * * @see WebSocketConnectionManager */ public interface WebSocketClient { diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/client/WebSocketConnectionManager.java b/spring-websocket/src/main/java/org/springframework/web/socket/client/WebSocketConnectionManager.java index 7a115312e2..c0ae96f8a6 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/client/WebSocketConnectionManager.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/client/WebSocketConnectionManager.java @@ -61,7 +61,6 @@ public class WebSocketConnectionManager extends ConnectionManagerSupport { /** * Decorate the WebSocketHandler provided to the class constructor. - * *

    By default {@link LoggingWebSocketHandlerDecorator} is added. */ protected WebSocketHandler decorateWebSocketHandler(WebSocketHandler handler) { diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/client/endpoint/AnnotatedEndpointConnectionManager.java b/spring-websocket/src/main/java/org/springframework/web/socket/client/endpoint/AnnotatedEndpointConnectionManager.java index 5ba8cf6280..b2fe7cad86 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/client/endpoint/AnnotatedEndpointConnectionManager.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/client/endpoint/AnnotatedEndpointConnectionManager.java @@ -85,7 +85,7 @@ public class AnnotatedEndpointConnectionManager extends ConnectionManagerSupport * By default {@link SimpleAsyncTaskExecutor} is used. */ public void setTaskExecutor(TaskExecutor taskExecutor) { - Assert.notNull(taskExecutor, "taskExecutor is required"); + Assert.notNull(taskExecutor, "TaskExecutor must not be null"); this.taskExecutor = taskExecutor; } diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/client/endpoint/EndpointConnectionManager.java b/spring-websocket/src/main/java/org/springframework/web/socket/client/endpoint/EndpointConnectionManager.java index 1b32306396..ecdb198d3f 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/client/endpoint/EndpointConnectionManager.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/client/endpoint/EndpointConnectionManager.java @@ -118,7 +118,7 @@ public class EndpointConnectionManager extends ConnectionManagerSupport implemen * By default {@link SimpleAsyncTaskExecutor} is used. */ public void setTaskExecutor(TaskExecutor taskExecutor) { - Assert.notNull(taskExecutor, "taskExecutor is required"); + Assert.notNull(taskExecutor, "TaskExecutor must not be null"); this.taskExecutor = taskExecutor; } diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/client/endpoint/StandardWebSocketClient.java b/spring-websocket/src/main/java/org/springframework/web/socket/client/endpoint/StandardWebSocketClient.java index 55421c5866..2d668b8d59 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/client/endpoint/StandardWebSocketClient.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/client/endpoint/StandardWebSocketClient.java @@ -76,12 +76,13 @@ public class StandardWebSocketClient extends AbstractWebSocketClient { this.webSocketContainer = webSocketContainer; } + /** * Set a {@link TaskExecutor} to use to open the connection. * By default {@link SimpleAsyncTaskExecutor} is used. */ public void setTaskExecutor(AsyncListenableTaskExecutor taskExecutor) { - Assert.notNull(taskExecutor, "taskExecutor is required"); + Assert.notNull(taskExecutor, "TaskExecutor must not be null"); this.taskExecutor = taskExecutor; } diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/client/jetty/JettyWebSocketClient.java b/spring-websocket/src/main/java/org/springframework/web/socket/client/jetty/JettyWebSocketClient.java index d76ec05d0a..c3663ab9f9 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/client/jetty/JettyWebSocketClient.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/client/jetty/JettyWebSocketClient.java @@ -84,7 +84,7 @@ public class JettyWebSocketClient extends AbstractWebSocketClient implements Sma * By default {@link SimpleAsyncTaskExecutor} is used. */ public void setTaskExecutor(AsyncListenableTaskExecutor taskExecutor) { - Assert.notNull(taskExecutor, "taskExecutor is required"); + Assert.notNull(taskExecutor, "TaskExecutor must not be null"); this.taskExecutor = taskExecutor; } @@ -200,7 +200,7 @@ public class JettyWebSocketClient extends AbstractWebSocketClient implements Sma /** * @return the user to make available through {@link WebSocketSession#getPrincipal()}; - * by default this method returns {@code null} + * by default this method returns {@code null} */ protected Principal getUser() { return null; diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/messaging/SubProtocolHandler.java b/spring-websocket/src/main/java/org/springframework/web/socket/messaging/SubProtocolHandler.java index d8eb8f30ae..76fe925545 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/messaging/SubProtocolHandler.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/messaging/SubProtocolHandler.java @@ -24,7 +24,6 @@ import org.springframework.web.socket.CloseStatus; import org.springframework.web.socket.WebSocketMessage; import org.springframework.web.socket.WebSocketSession; - /** * A contract for handling WebSocket messages as part of a higher level protocol, referred * to as "sub-protocol" in the WebSocket RFC specification. Handles both @@ -49,7 +48,6 @@ public interface SubProtocolHandler { /** * Handle the given {@link WebSocketMessage} received from a client. - * * @param session the client session * @param message the client message * @param outputChannel an output channel to send messages to @@ -60,7 +58,6 @@ public interface SubProtocolHandler { /** * Handle the given {@link Message} to the client associated with the given WebSocket * session. - * * @param session the client session * @param message the client message */ @@ -68,14 +65,12 @@ public interface SubProtocolHandler { /** * Resolve the session id from the given message or return {@code null}. - * * @param message the message to resolve the session id from */ String resolveSessionId(Message message); /** * Invoked after a {@link WebSocketSession} has started. - * * @param session the client session * @param outputChannel a channel */ @@ -83,7 +78,6 @@ public interface SubProtocolHandler { /** * Invoked after a {@link WebSocketSession} has ended. - * * @param session the client session * @param closeStatus the reason why the session was closed * @param outputChannel a channel diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/messaging/SubProtocolWebSocketHandler.java b/spring-websocket/src/main/java/org/springframework/web/socket/messaging/SubProtocolWebSocketHandler.java index bd521bbbe5..eb11a03625 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/messaging/SubProtocolWebSocketHandler.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/messaging/SubProtocolWebSocketHandler.java @@ -34,7 +34,6 @@ import org.springframework.web.socket.WebSocketMessage; import org.springframework.web.socket.WebSocketSession; import org.springframework.web.socket.support.SubProtocolCapable; - /** * An implementation of {@link WebSocketHandler} that delegates incoming WebSocket * messages to a {@link SubProtocolHandler} along with a {@link MessageChannel} to @@ -66,7 +65,7 @@ public class SubProtocolWebSocketHandler implements SubProtocolCapable, WebSocke public SubProtocolWebSocketHandler(MessageChannel clientOutboundChannel) { - Assert.notNull(clientOutboundChannel, "clientOutboundChannel is required"); + Assert.notNull(clientOutboundChannel, "ClientOutboundChannel must not be null"); this.clientOutboundChannel = clientOutboundChannel; } @@ -74,7 +73,6 @@ public class SubProtocolWebSocketHandler implements SubProtocolCapable, WebSocke /** * Configure one or more handlers to use depending on the sub-protocol requested by * the client in the WebSocket handshake request. - * * @param protocolHandlers the sub-protocol handlers to use */ public void setProtocolHandlers(List protocolHandlers) { @@ -112,7 +110,6 @@ public class SubProtocolWebSocketHandler implements SubProtocolCapable, WebSocke /** * Set the {@link SubProtocolHandler} to use when the client did not request a * sub-protocol. - * * @param defaultProtocolHandler the default handler */ public void setDefaultProtocolHandler(SubProtocolHandler defaultProtocolHandler) { diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/messaging/config/DelegatingWebSocketMessageBrokerConfiguration.java b/spring-websocket/src/main/java/org/springframework/web/socket/messaging/config/DelegatingWebSocketMessageBrokerConfiguration.java index 9c84f2c204..433b19ba1b 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/messaging/config/DelegatingWebSocketMessageBrokerConfiguration.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/messaging/config/DelegatingWebSocketMessageBrokerConfiguration.java @@ -25,7 +25,6 @@ import org.springframework.messaging.simp.config.ChannelRegistration; import org.springframework.messaging.simp.config.MessageBrokerRegistry; import org.springframework.util.CollectionUtils; - /** * A {@link WebSocketMessageBrokerConfigurationSupport} extension that detects beans of type * {@link WebSocketMessageBrokerConfigurer} diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/messaging/config/EnableWebSocketMessageBroker.java b/spring-websocket/src/main/java/org/springframework/web/socket/messaging/config/EnableWebSocketMessageBroker.java index 6795c7b217..3b9c8192e0 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/messaging/config/EnableWebSocketMessageBroker.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/messaging/config/EnableWebSocketMessageBroker.java @@ -20,7 +20,6 @@ import java.lang.annotation.Target; import org.springframework.context.annotation.Import; - /** * Add this annotation to an {@code @Configuration} class to enable broker-backed * messaging over WebSocket using a higher-level messaging sub-protocol. diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/messaging/config/WebMvcStompEndpointRegistry.java b/spring-websocket/src/main/java/org/springframework/web/socket/messaging/config/WebMvcStompEndpointRegistry.java index 9144a67978..aec9ac94d6 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/messaging/config/WebMvcStompEndpointRegistry.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/messaging/config/WebMvcStompEndpointRegistry.java @@ -30,7 +30,6 @@ import org.springframework.web.socket.WebSocketHandler; import org.springframework.web.socket.messaging.SubProtocolWebSocketHandler; import org.springframework.web.socket.support.WebSocketHandlerDecorator; - /** * A registry for STOMP over WebSocket endpoints that maps the endpoints with a * {@link SimpleUrlHandlerMapping} for use in Spring MVC. @@ -56,10 +55,8 @@ public class WebMvcStompEndpointRegistry implements StompEndpointRegistry { public WebMvcStompEndpointRegistry(WebSocketHandler webSocketHandler, UserSessionRegistry userSessionRegistry, TaskScheduler defaultSockJsTaskScheduler) { - Assert.notNull(webSocketHandler); Assert.notNull(userSessionRegistry); - this.webSocketHandler = webSocketHandler; this.subProtocolWebSocketHandler = unwrapSubProtocolWebSocketHandler(webSocketHandler); this.stompHandler = new StompSubProtocolHandler(); @@ -68,34 +65,27 @@ public class WebMvcStompEndpointRegistry implements StompEndpointRegistry { } private static SubProtocolWebSocketHandler unwrapSubProtocolWebSocketHandler(WebSocketHandler webSocketHandler) { - WebSocketHandler actual = (webSocketHandler instanceof WebSocketHandlerDecorator) ? ((WebSocketHandlerDecorator) webSocketHandler).getLastHandler() : webSocketHandler; - Assert.isInstanceOf(SubProtocolWebSocketHandler.class, actual, "No SubProtocolWebSocketHandler found: " + webSocketHandler); - return (SubProtocolWebSocketHandler) actual; } @Override public StompWebSocketEndpointRegistration addEndpoint(String... paths) { - this.subProtocolWebSocketHandler.addProtocolHandler(this.stompHandler); - WebMvcStompWebSocketEndpointRegistration registration = new WebMvcStompWebSocketEndpointRegistration( paths, this.webSocketHandler, this.sockJsScheduler); this.registrations.add(registration); - return registration; } /** * Set the order for the resulting {@link SimpleUrlHandlerMapping} relative to * other handler mappings configured in Spring MVC. - *

    - * The default value is 1. + *

    The default value is 1. */ public void setOrder(int order) { this.order = order; diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/messaging/config/WebMvcStompWebSocketEndpointRegistration.java b/spring-websocket/src/main/java/org/springframework/web/socket/messaging/config/WebMvcStompWebSocketEndpointRegistration.java index 6f0c04114c..904227efc3 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/messaging/config/WebMvcStompWebSocketEndpointRegistration.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/messaging/config/WebMvcStompWebSocketEndpointRegistration.java @@ -16,16 +16,12 @@ package org.springframework.web.socket.messaging.config; -import java.util.Set; - import org.springframework.scheduling.TaskScheduler; import org.springframework.util.Assert; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; -import org.springframework.util.ObjectUtils; import org.springframework.web.HttpRequestHandler; import org.springframework.web.socket.WebSocketHandler; -import org.springframework.web.socket.server.DefaultHandshakeHandler; import org.springframework.web.socket.server.HandshakeHandler; import org.springframework.web.socket.server.config.SockJsServiceRegistration; import org.springframework.web.socket.server.support.WebSocketHttpRequestHandler; @@ -33,7 +29,6 @@ import org.springframework.web.socket.sockjs.SockJsHttpRequestHandler; import org.springframework.web.socket.sockjs.SockJsService; import org.springframework.web.socket.sockjs.transport.handler.WebSocketTransportHandler; - /** * An abstract base class class for configuring STOMP over WebSocket/SockJS endpoints. * @@ -57,7 +52,7 @@ public class WebMvcStompWebSocketEndpointRegistration implements StompWebSocketE TaskScheduler sockJsTaskScheduler) { Assert.notEmpty(paths, "No paths specified"); - Assert.notNull(webSocketHandler, "'webSocketHandler' is required"); + Assert.notNull(webSocketHandler, "WebSocketHandler must not be null"); this.paths = paths; this.webSocketHandler = webSocketHandler; diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/messaging/config/WebSocketMessageBrokerConfigurationSupport.java b/spring-websocket/src/main/java/org/springframework/web/socket/messaging/config/WebSocketMessageBrokerConfigurationSupport.java index 0461099bcd..22e55d63ad 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/messaging/config/WebSocketMessageBrokerConfigurationSupport.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/messaging/config/WebSocketMessageBrokerConfigurationSupport.java @@ -24,7 +24,6 @@ import org.springframework.web.socket.WebSocketHandler; import org.springframework.web.socket.server.config.SockJsServiceRegistration; import org.springframework.web.socket.messaging.SubProtocolWebSocketHandler; - /** * Extends {@link AbstractMessageBrokerConfiguration} and adds configuration for * receiving and responding to STOMP messages from WebSocket clients. diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/DefaultHandshakeHandler.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/DefaultHandshakeHandler.java index c886c50574..99ca0e4d29 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/DefaultHandshakeHandler.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/DefaultHandshakeHandler.java @@ -45,8 +45,7 @@ import org.springframework.web.socket.support.WebSocketHttpHeaders; * negotiation process (e.g. origin validation, sub-protocol negotiation, * extensions negotiation, etc). * - *

    - * If the negotiation succeeds, the actual upgrade is delegated to a server-specific + *

    If the negotiation succeeds, the actual upgrade is delegated to a server-specific * {@link RequestUpgradeStrategy}, which will update the response as necessary and * initialize the WebSocket. Currently supported servers are Tomcat 7 and 8, Jetty 9, and * Glassfish 4. @@ -76,11 +75,9 @@ public class DefaultHandshakeHandler implements HandshakeHandler { private final List supportedProtocols = new ArrayList(); - /** * Default constructor that auto-detects and instantiates a * {@link RequestUpgradeStrategy} suitable for the runtime container. - * * @throws IllegalStateException if no {@link RequestUpgradeStrategy} can be found. */ public DefaultHandshakeHandler() { @@ -123,13 +120,13 @@ public class DefaultHandshakeHandler implements HandshakeHandler { this.requestUpgradeStrategy = upgradeStrategy; } + /** * Use this property to configure the list of supported sub-protocols. * The first configured sub-protocol that matches a client-requested sub-protocol * is accepted. If there are no matches the response will not contain a * {@literal Sec-WebSocket-Protocol} header. - *

    - * Note that if the WebSocketHandler passed in at runtime is an instance of + *

    Note that if the WebSocketHandler passed in at runtime is an instance of * {@link SubProtocolCapable} then there is not need to explicitly configure * this property. That is certainly the case with the built-in STOMP over * WebSocket support. Therefore this property should be configured explicitly @@ -263,11 +260,9 @@ public class DefaultHandshakeHandler implements HandshakeHandler { * WebSocketHandler is a {@link SubProtocolCapable} and then also checks if any * sub-protocols have been explicitly configured with * {@link #setSupportedProtocols(String...)}. - * * @param requestedProtocols the requested sub-protocols * @param webSocketHandler the WebSocketHandler that will be used * @return the selected protocols or {@code null} - * * @see #determineHandlerSupportedProtocols(org.springframework.web.socket.WebSocketHandler) */ protected String selectProtocol(List requestedProtocols, WebSocketHandler webSocketHandler) { @@ -293,7 +288,6 @@ public class DefaultHandshakeHandler implements HandshakeHandler { /** * Determine the sub-protocols supported by the given WebSocketHandler by checking * whether it is an instance of {@link SubProtocolCapable}. - * * @param handler the handler to check * @return a list of supported protocols or an empty list */ @@ -313,15 +307,12 @@ public class DefaultHandshakeHandler implements HandshakeHandler { /** * Filter the list of requested WebSocket extensions. - *

    - * By default all request extensions are returned. The WebSocket server will further + *

    By default all request extensions are returned. The WebSocket server will further * compare the requested extensions against the list of supported extensions and * return only the ones that are both requested and supported. - * * @param request the current request * @param requested the list of extensions requested by the client * @param supported the list of extensions supported by the server - * * @return the selected extensions or an empty list */ protected List filterRequestedExtensions(ServerHttpRequest request, diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/HandshakeFailureException.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/HandshakeFailureException.java index defd8776c4..f470229893 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/HandshakeFailureException.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/HandshakeFailureException.java @@ -34,7 +34,6 @@ import org.springframework.core.NestedRuntimeException; @SuppressWarnings("serial") public class HandshakeFailureException extends NestedRuntimeException { - /** * Constructor with message and root cause. */ diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/HandshakeHandler.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/HandshakeHandler.java index be0ad444e9..87aad9dd81 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/HandshakeHandler.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/HandshakeHandler.java @@ -35,26 +35,22 @@ import org.springframework.web.socket.support.PerConnectionWebSocketHandler; */ public interface HandshakeHandler { - /** * Initiate the handshake. - * * @param request the current request * @param response the current response * @param wsHandler the handler to process WebSocket messages; see - * {@link PerConnectionWebSocketHandler} for providing a handler with - * per-connection lifecycle. + * {@link PerConnectionWebSocketHandler} for providing a handler with + * per-connection lifecycle. * @param attributes handshake request specific attributes to be set on the WebSocket - * session via {@link HandshakeInterceptor} and thus made available to the - * {@link WebSocketHandler}; - * + * session via {@link HandshakeInterceptor} and thus made available to the + * {@link WebSocketHandler}; * @return whether the handshake negotiation was successful or not. In either case the - * response status, headers, and body will have been updated to reflect the - * result of the negotiation - * + * response status, headers, and body will have been updated to reflect the + * result of the negotiation * @throws HandshakeFailureException thrown when handshake processing failed to - * complete due to an internal, unrecoverable error, i.e. a server error as - * opposed to a failure to successfully negotiate the handshake. + * complete due to an internal, unrecoverable error, i.e. a server error as + * opposed to a failure to successfully negotiate the handshake. */ boolean doHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Map attributes) throws HandshakeFailureException; diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/HandshakeInterceptor.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/HandshakeInterceptor.java index 86f7e0f3fb..02858e652c 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/HandshakeInterceptor.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/HandshakeInterceptor.java @@ -23,7 +23,6 @@ import org.springframework.http.server.ServerHttpResponse; import org.springframework.web.socket.WebSocketHandler; import org.springframework.web.socket.WebSocketSession; - /** * Interceptor for WebSocket handshake requests. Can be used to inspect the handshake * request and response as well as to pass attributes to the target @@ -39,13 +38,11 @@ public interface HandshakeInterceptor { /** * Invoked before the handshake is processed. - * * @param request the current request * @param response the current response * @param wsHandler the target WebSocket handler * @param attributes attributes to make available via - * {@link WebSocketSession#getHandshakeAttributes()} - * + * {@link WebSocketSession#getHandshakeAttributes()} * @return whether to proceed with the handshake {@code true} or abort {@code false} */ boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, @@ -54,7 +51,6 @@ public interface HandshakeInterceptor { /** * Invoked after the handshake is done. The response status and headers indicate the * results of the handshake, i.e. whether it was successful or not. - * * @param request the current request * @param response the current response * @param wsHandler the target WebSocket handler diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/RequestUpgradeStrategy.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/RequestUpgradeStrategy.java index f3e950f221..7c58b921db 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/RequestUpgradeStrategy.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/RequestUpgradeStrategy.java @@ -32,7 +32,6 @@ import org.springframework.web.socket.WebSocketHandler; */ public interface RequestUpgradeStrategy { - /** * Return the supported WebSocket protocol versions. */ @@ -46,22 +45,19 @@ public interface RequestUpgradeStrategy { /** * Perform runtime specific steps to complete the upgrade. Invoked after successful * negotiation of the handshake request. - * - * * @param request the current request * @param response the current response * @param selectedProtocol the selected sub-protocol, if any * @param selectedExtensions the selected WebSocket protocol extensions * @param wsHandler the handler for WebSocket messages * @param attributes handshake request specific attributes to be set on the WebSocket - * session via {@link org.springframework.web.socket.server.HandshakeInterceptor} - * and thus made available to the - * {@link org.springframework.web.socket.WebSocketHandler}; - * + * session via {@link org.springframework.web.socket.server.HandshakeInterceptor} + * and thus made available to the + * {@link org.springframework.web.socket.WebSocketHandler}; * @throws HandshakeFailureException thrown when handshake processing failed to - * complete due to an internal, unrecoverable error, i.e. a server error as - * opposed to a failure to successfully negotiate the requirements of the - * handshake request. + * complete due to an internal, unrecoverable error, i.e. a server error as + * opposed to a failure to successfully negotiate the requirements of the + * handshake request. */ void upgrade(ServerHttpRequest request, ServerHttpResponse response, String selectedProtocol, List selectedExtensions, diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/config/AbstractWebSocketHandlerRegistration.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/config/AbstractWebSocketHandlerRegistration.java index 6dd2c587ab..c5f3c60688 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/config/AbstractWebSocketHandlerRegistration.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/config/AbstractWebSocketHandlerRegistration.java @@ -29,7 +29,6 @@ import org.springframework.web.socket.server.HandshakeInterceptor; import org.springframework.web.socket.sockjs.SockJsService; import org.springframework.web.socket.sockjs.transport.handler.WebSocketTransportHandler; - /** * Base class for {@link WebSocketHandlerRegistration}s that gathers all the configuration * options but allows sub-classes to put together the actual HTTP request mappings. @@ -54,6 +53,7 @@ public abstract class AbstractWebSocketHandlerRegistration implements WebSock this.sockJsTaskScheduler = defaultTaskScheduler; } + @Override public WebSocketHandlerRegistration addHandler(WebSocketHandler handler, String... paths) { Assert.notNull(handler); diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/config/EnableWebSocket.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/config/EnableWebSocket.java index 46a7a38ec8..94913ebcb3 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/config/EnableWebSocket.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/config/EnableWebSocket.java @@ -20,7 +20,6 @@ import java.lang.annotation.Target; import org.springframework.context.annotation.Import; - /** * Add this annotation to an {@code @Configuration} class to configure * processing WebSocket requests: diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/config/ServletWebSocketHandlerRegistration.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/config/ServletWebSocketHandlerRegistration.java index 8f504f33b8..683a182b00 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/config/ServletWebSocketHandlerRegistration.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/config/ServletWebSocketHandlerRegistration.java @@ -30,7 +30,6 @@ import org.springframework.web.socket.server.support.WebSocketHttpRequestHandler import org.springframework.web.socket.sockjs.SockJsHttpRequestHandler; import org.springframework.web.socket.sockjs.SockJsService; - /** * A helper class for configuring {@link WebSocketHandler} request handling * including SockJS fallback options. diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/config/ServletWebSocketHandlerRegistry.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/config/ServletWebSocketHandlerRegistry.java index b0292c0f58..f0463ff0f8 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/config/ServletWebSocketHandlerRegistry.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/config/ServletWebSocketHandlerRegistry.java @@ -30,7 +30,6 @@ import org.springframework.web.servlet.handler.AbstractHandlerMapping; import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping; import org.springframework.web.socket.WebSocketHandler; - /** * A {@link WebSocketHandlerRegistry} that maps {@link WebSocketHandler}s to URLs for use * in a Servlet container. diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/config/SockJsServiceRegistration.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/config/SockJsServiceRegistration.java index 7610ab4970..c7cef7471e 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/config/SockJsServiceRegistration.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/config/SockJsServiceRegistration.java @@ -27,7 +27,6 @@ import org.springframework.web.socket.sockjs.SockJsService; import org.springframework.web.socket.sockjs.transport.TransportHandler; import org.springframework.web.socket.sockjs.transport.handler.DefaultSockJsService; - /** * A helper class for configuring SockJS fallback options, typically used indirectly, in * conjunction with {@link EnableWebSocket @EnableWebSocket} and @@ -79,7 +78,6 @@ public class SockJsServiceRegistration { * a domain local to the SockJS server. The iframe does need to load the * SockJS javascript client library and this option allows configuring its * url. - * *

    By default this is set to point to * "https://d1fxtkz8shb9d2.cloudfront.net/sockjs-0.3.4.min.js". */ @@ -96,7 +94,6 @@ public class SockJsServiceRegistration { * closed. After that client will open a new request. Setting this value to * one effectively disables streaming and will make streaming transports to * behave like polling transports. - * *

    The default value is 128K (i.e. 128 * 1024). */ public SockJsServiceRegistration setStreamBytesLimit(int streamBytesLimit) { @@ -109,13 +106,11 @@ public class SockJsServiceRegistration { * from clients with a "cookie_needed" boolean property that indicates whether the use * of a JSESSIONID cookie is required for the application to function correctly, e.g. * for load balancing or in Java Servlet containers for the use of an HTTP session. - *

    - * This is especially important for IE 8,9 that support XDomainRequest -- a modified + *

    This is especially important for IE 8,9 that support XDomainRequest -- a modified * AJAX/XHR -- that can do requests across domains but does not send any cookies. In * those cases, the SockJS client prefers the "iframe-htmlfile" transport over * "xdr-streaming" in order to be able to send cookies. - *

    - * The default value is "true" to maximize the chance for applications to work + *

    The default value is "true" to maximize the chance for applications to work * correctly in IE 8,9 with support for cookies (and the JSESSIONID cookie in * particular). However, an application can choose to set this to "false" if the use * of cookies (and HTTP session) is not required. @@ -129,7 +124,6 @@ public class SockJsServiceRegistration { * The amount of time in milliseconds when the server has not sent any * messages and after which the server should send a heartbeat frame to the * client in order to keep the connection from breaking. - * *

    The default value is 25,000 (25 seconds). */ public SockJsServiceRegistration setHeartbeatTime(long heartbeatTime) { @@ -141,7 +135,6 @@ public class SockJsServiceRegistration { * The amount of time in milliseconds before a client is considered * disconnected after not having a receiving connection, i.e. an active * connection over which the server can send data to the client. - * *

    The default value is 5000. */ public SockJsServiceRegistration setDisconnectDelay(long disconnectDelay) { @@ -153,12 +146,10 @@ public class SockJsServiceRegistration { * The number of server-to-client messages that a session can cache while waiting for * the next HTTP polling request from the client. All HTTP transports use this * property since even streaming transports recycle HTTP requests periodically. - *

    - * The amount of time between HTTP requests should be relatively brief and will not + *

    The amount of time between HTTP requests should be relatively brief and will not * exceed the allows disconnect delay (see * {@link #setDisconnectDelay(long)}), 5 seconds by default. - *

    - * The default size is 100. + *

    The default size is 100. */ public SockJsServiceRegistration setHttpMessageCacheSize(int httpMessageCacheSize) { this.httpMessageCacheSize = httpMessageCacheSize; @@ -168,7 +159,6 @@ public class SockJsServiceRegistration { /** * Some load balancers don't support WebSocket. This option can be used to * disable the WebSocket transport on the server side. - * *

    The default value is "true". */ public SockJsServiceRegistration setWebSocketEnabled(boolean webSocketEnabled) { diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/config/WebSocketConfigurationSupport.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/config/WebSocketConfigurationSupport.java index 8dc2188847..55b8cc50b3 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/config/WebSocketConfigurationSupport.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/config/WebSocketConfigurationSupport.java @@ -21,7 +21,6 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; import org.springframework.web.servlet.HandlerMapping; import org.springframework.web.servlet.handler.AbstractHandlerMapping; - /** * Configuration support for WebSocket request handling. * @@ -30,7 +29,6 @@ import org.springframework.web.servlet.handler.AbstractHandlerMapping; */ public class WebSocketConfigurationSupport { - @Bean public HandlerMapping webSocketHandlerMapping() { ServletWebSocketHandlerRegistry registry = new ServletWebSocketHandlerRegistry(defaultSockJsTaskScheduler()); diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/config/WebSocketConfigurer.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/config/WebSocketConfigurer.java index 221ac25634..698b241a7d 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/config/WebSocketConfigurer.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/config/WebSocketConfigurer.java @@ -18,7 +18,6 @@ package org.springframework.web.socket.server.config; import org.springframework.web.socket.WebSocketHandler; - /** * Defines callback methods to configure the WebSocket request handling * via {@link EnableWebSocket @EnableWebSocket}. @@ -28,7 +27,6 @@ import org.springframework.web.socket.WebSocketHandler; */ public interface WebSocketConfigurer { - /** * Register {@link WebSocketHandler}s including SockJS fallback options if desired. */ diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/endpoint/ServerEndpointExporter.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/endpoint/ServerEndpointExporter.java index 1b03a81f61..eb050dc65b 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/endpoint/ServerEndpointExporter.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/endpoint/ServerEndpointExporter.java @@ -73,7 +73,6 @@ public class ServerEndpointExporter implements InitializingBean, BeanPostProcess * Explicitly list annotated endpoint types that should be registered on startup. This * can be done if you wish to turn off a Servlet container's scan for endpoints, which * goes through all 3rd party jars in the, and rely on Spring configuration instead. - * * @param annotatedEndpointClasses {@link ServerEndpoint}-annotated types */ public void setAnnotatedEndpointClasses(Class... annotatedEndpointClasses) { @@ -83,11 +82,8 @@ public class ServerEndpointExporter implements InitializingBean, BeanPostProcess @Override public void setApplicationContext(ApplicationContext applicationContext) { - this.applicationContext = applicationContext; - this.serverContainer = getServerContainer(); - Map beans = applicationContext.getBeansWithAnnotation(ServerEndpoint.class); for (String beanName : beans.keySet()) { Class beanType = applicationContext.getType(beanName); @@ -99,7 +95,6 @@ public class ServerEndpointExporter implements InitializingBean, BeanPostProcess } protected ServerContainer getServerContainer() { - Class servletContextClass; try { servletContextClass = Class.forName("javax.servlet.ServletContext"); @@ -122,7 +117,6 @@ public class ServerEndpointExporter implements InitializingBean, BeanPostProcess @Override public void afterPropertiesSet() throws Exception { - Assert.state(this.serverContainer != null, "javax.websocket.server.ServerContainer not available"); List> allClasses = new ArrayList>(this.annotatedEndpointClasses); diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/support/AbstractGlassFishRequestUpgradeStrategy.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/support/AbstractGlassFishRequestUpgradeStrategy.java index 392eb2a2dd..4c4f5cc3dd 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/support/AbstractGlassFishRequestUpgradeStrategy.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/support/AbstractGlassFishRequestUpgradeStrategy.java @@ -53,7 +53,6 @@ import org.springframework.web.socket.server.HandshakeFailureException; import org.springframework.web.socket.server.endpoint.ServerEndpointRegistration; import org.springframework.web.socket.server.endpoint.ServletServerContainerFactoryBean; - /** * GlassFish support for upgrading a request during a WebSocket handshake. To modify * properties of the underlying {@link javax.websocket.server.ServerContainer} you can use diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/support/GlassFish40RequestUpgradeStrategy.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/support/GlassFish40RequestUpgradeStrategy.java index 5afe02f47c..98a331fbd9 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/support/GlassFish40RequestUpgradeStrategy.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/support/GlassFish40RequestUpgradeStrategy.java @@ -28,7 +28,6 @@ import org.glassfish.tyrus.websockets.WebSocketApplication; import org.springframework.util.ClassUtils; import org.springframework.web.socket.support.WebSocketExtension; - /** * Extension of the {@link AbstractGlassFishRequestUpgradeStrategy} that provides support * for only GlassFish 4.0. diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/support/GlassFishRequestUpgradeStrategy.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/support/GlassFishRequestUpgradeStrategy.java index 9756d50212..d5c68d9c29 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/support/GlassFishRequestUpgradeStrategy.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/support/GlassFishRequestUpgradeStrategy.java @@ -20,7 +20,6 @@ import org.glassfish.tyrus.core.EndpointWrapper; import org.glassfish.tyrus.core.TyrusEndpoint; import org.glassfish.tyrus.websockets.WebSocketApplication; - /** * Extension of the {@link AbstractGlassFishRequestUpgradeStrategy} that provides support * for GlassFish 4.0.1 and beyond. diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/support/HandshakeInterceptorChain.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/support/HandshakeInterceptorChain.java index 76dc2a82f5..af514cee08 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/support/HandshakeInterceptorChain.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/support/HandshakeInterceptorChain.java @@ -27,7 +27,6 @@ import org.springframework.http.server.ServerHttpResponse; import org.springframework.web.socket.WebSocketHandler; import org.springframework.web.socket.server.HandshakeInterceptor; - /** * A helper class that assists with invoking a list of handshake interceptors. * diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/support/HttpSessionHandshakeInterceptor.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/support/HttpSessionHandshakeInterceptor.java index a23a7afbe0..afcb7888f0 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/support/HttpSessionHandshakeInterceptor.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/support/HttpSessionHandshakeInterceptor.java @@ -32,7 +32,6 @@ import org.springframework.web.socket.WebSocketHandler; import org.springframework.web.socket.WebSocketSession; import org.springframework.web.socket.server.HandshakeInterceptor; - /** * An interceptor to copy HTTP session attributes into the map of "handshake attributes" * made available through {@link WebSocketSession#getHandshakeAttributes()}. diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/support/JettyRequestUpgradeStrategy.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/support/JettyRequestUpgradeStrategy.java index 6467af8482..fdf44850dc 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/support/JettyRequestUpgradeStrategy.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/support/JettyRequestUpgradeStrategy.java @@ -80,7 +80,7 @@ public class JettyRequestUpgradeStrategy implements RequestUpgradeStrategy { * {@link WebSocketServerFactory#getPolicy()}. */ public JettyRequestUpgradeStrategy(WebSocketServerFactory factory) { - Assert.notNull(factory, "WebSocketServerFactory is required"); + Assert.notNull(factory, "WebSocketServerFactory must not be null"); this.factory = factory; this.factory.setCreator(new WebSocketCreator() { diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/SockJsMessageDeliveryException.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/SockJsMessageDeliveryException.java index 275a26c7c0..0de584e78d 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/SockJsMessageDeliveryException.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/SockJsMessageDeliveryException.java @@ -18,14 +18,13 @@ package org.springframework.web.socket.sockjs; import java.util.List; - /** * An exception thrown when a message frame was successfully received over an HTTP POST * and parsed but one or more of the messages it contained could not be delivered to the * WebSocketHandler either because the handler failed or because the connection got * closed. - *

    - * The SockJS session is not automatically closed after this exception. + * + *

    The SockJS session is not automatically closed after this exception. * * @author Rossen Stoyanchev * @since 4.0 diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/SockJsService.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/SockJsService.java index d13ee388ab..b6acc14d36 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/SockJsService.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/SockJsService.java @@ -23,8 +23,8 @@ import org.springframework.web.socket.support.ExceptionWebSocketHandlerDecorator /** * The main entry point for processing HTTP requests from SockJS clients. - *

    - * In a Servlet 3+ container, {@link SockJsHttpRequestHandler} can be used to invoke this + * + *

    In a Servlet 3+ container, {@link SockJsHttpRequestHandler} can be used to invoke this * service. The processing servlet, as well as all filters involved, must have * asynchronous support enabled through the ServletContext API or by adding an * {@code true} element to servlet and filter declarations @@ -32,33 +32,28 @@ import org.springframework.web.socket.support.ExceptionWebSocketHandlerDecorator * * @author Rossen Stoyanchev * @since 4.0 - * * @see SockJsHttpRequestHandler */ public interface SockJsService { - /** * Process a SockJS HTTP request. - *

    - * See the "Base URL", "Static URLs", and "Session URLs" sections of the See the "Base URL", "Static URLs", and "Session URLs" sections of the SockJS * protocol for details on the types of URLs expected. - * * @param request the current request * @param response the current response * @param sockJsPath the remainder of the path within the SockJS service prefix * @param handler the handler that will exchange messages with the SockJS client - * * @throws SockJsException raised when request processing fails; generally, failed - * attempts to send messages to clients automatically close the SockJS session - * and raise {@link SockJsTransportFailureException}; failed attempts to read - * messages from clients do not automatically close the session and may result - * in {@link SockJsMessageDeliveryException} or {@link SockJsException}; - * exceptions from the WebSocketHandler can be handled internally or through - * {@link ExceptionWebSocketHandlerDecorator} or some alternative decorator. - * The former is automatically added when using - * {@link SockJsHttpRequestHandler}. + * attempts to send messages to clients automatically close the SockJS session + * and raise {@link SockJsTransportFailureException}; failed attempts to read + * messages from clients do not automatically close the session and may result + * in {@link SockJsMessageDeliveryException} or {@link SockJsException}; + * exceptions from the WebSocketHandler can be handled internally or through + * {@link ExceptionWebSocketHandlerDecorator} or some alternative decorator. + * The former is automatically added when using + * {@link SockJsHttpRequestHandler}. */ void handleRequest(ServerHttpRequest request, ServerHttpResponse response, String sockJsPath, WebSocketHandler handler) throws SockJsException; diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/SockJsTransportFailureException.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/SockJsTransportFailureException.java index 55342e976b..0e003a6aa1 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/SockJsTransportFailureException.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/SockJsTransportFailureException.java @@ -16,7 +16,6 @@ package org.springframework.web.socket.sockjs; - /** * Indicates a serious failure that occurred in the SockJS implementation as opposed to in * user code (e.g. IOException while writing to the response). When this exception is @@ -28,7 +27,6 @@ package org.springframework.web.socket.sockjs; @SuppressWarnings("serial") public class SockJsTransportFailureException extends SockJsException { - public SockJsTransportFailureException(String message, String sessionId, Throwable cause) { super(message, sessionId, cause); } diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/AbstractSockJsService.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/AbstractSockJsService.java index 101b2cd773..40a538edb0 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/AbstractSockJsService.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/AbstractSockJsService.java @@ -102,7 +102,6 @@ public abstract class AbstractSockJsService implements SockJsService { * a domain local to the SockJS server. The iframe does need to load the * SockJS javascript client library and this option allows configuring its * url. - * *

    By default this is set to point to * "https://d1fxtkz8shb9d2.cloudfront.net/sockjs-0.3.4.min.js". */ @@ -126,7 +125,6 @@ public abstract class AbstractSockJsService implements SockJsService { * closed. After that client will open a new request. Setting this value to * one effectively disables streaming and will make streaming transports to * behave like polling transports. - * *

    The default value is 128K (i.e. 128 * 1024). */ public void setStreamBytesLimit(int streamBytesLimit) { @@ -142,17 +140,14 @@ public abstract class AbstractSockJsService implements SockJsService { * clients with a "cookie_needed" boolean property that indicates whether the use of a * JSESSIONID cookie is required for the application to function correctly, e.g. for * load balancing or in Java Servlet containers for the use of an HTTP session. - *

    - * This is especially important for IE 8,9 that support XDomainRequest -- a modified + *

    This is especially important for IE 8,9 that support XDomainRequest -- a modified * AJAX/XHR -- that can do requests across domains but does not send any cookies. In * those cases, the SockJS client prefers the "iframe-htmlfile" transport over * "xdr-streaming" in order to be able to send cookies. - *

    - * The SockJS protocol also expects a SockJS service to echo back the JSESSIONID + *

    The SockJS protocol also expects a SockJS service to echo back the JSESSIONID * cookie when this property is set to true. However, when running in a Servlet * container this is not necessary since the container takes care of it. - *

    - * The default value is "true" to maximize the chance for applications to work + *

    The default value is "true" to maximize the chance for applications to work * correctly in IE 8,9 with support for cookies (and the JSESSIONID cookie in * particular). However, an application can choose to set this to "false" if * the use of cookies (and HTTP session) is not required. @@ -173,7 +168,6 @@ public abstract class AbstractSockJsService implements SockJsService { * The amount of time in milliseconds when the server has not sent any * messages and after which the server should send a heartbeat frame to the * client in order to keep the connection from breaking. - * *

    The default value is 25,000 (25 seconds). */ public void setHeartbeatTime(long heartbeatTime) { @@ -195,7 +189,6 @@ public abstract class AbstractSockJsService implements SockJsService { * The amount of time in milliseconds before a client is considered * disconnected after not having a receiving connection, i.e. an active * connection over which the server can send data to the client. - * *

    The default value is 5000. */ public void setDisconnectDelay(long disconnectDelay) { @@ -213,12 +206,10 @@ public abstract class AbstractSockJsService implements SockJsService { * The number of server-to-client messages that a session can cache while waiting for * the next HTTP polling request from the client. All HTTP transports use this * property since even streaming transports recycle HTTP requests periodically. - *

    - * The amount of time between HTTP requests should be relatively brief and will not + *

    The amount of time between HTTP requests should be relatively brief and will not * exceed the allows disconnect delay (see * {@link #setDisconnectDelay(long)}), 5 seconds by default. - *

    - * The default size is 100. + *

    The default size is 100. */ public void setHttpMessageCacheSize(int httpMessageCacheSize) { this.httpMessageCacheSize = httpMessageCacheSize; @@ -234,7 +225,6 @@ public abstract class AbstractSockJsService implements SockJsService { /** * Some load balancers don't support websockets. This option can be used to * disable the WebSocket transport on the server side. - * *

    The default value is "true". */ public void setWebSocketsEnabled(boolean webSocketsEnabled) { @@ -251,9 +241,8 @@ public abstract class AbstractSockJsService implements SockJsService { /** * {@inheritDoc} - *

    - * This method determines the SockJS path and handles SockJS static URLs. Session URLs - * and raw WebSocket requests are delegated to abstract methods. + *

    This method determines the SockJS path and handles SockJS static URLs. Session + * URLs and raw WebSocket requests are delegated to abstract methods. */ @Override public final void handleRequest(ServerHttpRequest request, ServerHttpResponse response, diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/frame/AbstractSockJsMessageCodec.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/frame/AbstractSockJsMessageCodec.java index c3b3a7087d..87b93dc706 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/frame/AbstractSockJsMessageCodec.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/frame/AbstractSockJsMessageCodec.java @@ -18,7 +18,6 @@ package org.springframework.web.socket.sockjs.support.frame; import org.springframework.util.Assert; - /** * An base class for SockJS message codec that provides an implementation of * {@link #encode(String[])}. diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/frame/Jackson2SockJsMessageCodec.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/frame/Jackson2SockJsMessageCodec.java index 04699413d1..edd1fbb720 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/frame/Jackson2SockJsMessageCodec.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/frame/Jackson2SockJsMessageCodec.java @@ -24,7 +24,6 @@ import org.springframework.util.Assert; import com.fasterxml.jackson.core.io.JsonStringEncoder; import com.fasterxml.jackson.databind.ObjectMapper; - /** * A Jackson 2 codec for encoding and decoding SockJS messages. * @@ -41,7 +40,7 @@ public class Jackson2SockJsMessageCodec extends AbstractSockJsMessageCodec { } public Jackson2SockJsMessageCodec(ObjectMapper objectMapper) { - Assert.notNull(objectMapper, "objectMapper is required"); + Assert.notNull(objectMapper, "ObjectMapper must not be null"); this.objectMapper = objectMapper; } diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/frame/JacksonSockJsMessageCodec.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/frame/JacksonSockJsMessageCodec.java index 6f5ed64490..a16a180cfc 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/frame/JacksonSockJsMessageCodec.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/frame/JacksonSockJsMessageCodec.java @@ -23,7 +23,6 @@ import org.codehaus.jackson.io.JsonStringEncoder; import org.codehaus.jackson.map.ObjectMapper; import org.springframework.util.Assert; - /** * A Jackson 1.x codec for encoding and decoding SockJS messages. * @@ -40,7 +39,7 @@ public class JacksonSockJsMessageCodec extends AbstractSockJsMessageCodec { } public JacksonSockJsMessageCodec(ObjectMapper objectMapper) { - Assert.notNull(objectMapper, "objectMapper is required"); + Assert.notNull(objectMapper, "ObjectMapper must not be null"); this.objectMapper = objectMapper; } diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/frame/SockJsFrame.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/frame/SockJsFrame.java index fe51bdc3d5..8f6d39e3e6 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/frame/SockJsFrame.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/frame/SockJsFrame.java @@ -41,7 +41,7 @@ public class SockJsFrame { private SockJsFrame(String content) { - Assert.notNull("content is required"); + Assert.notNull("Content must not be null"); this.content = content; } diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/frame/SockJsMessageCodec.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/frame/SockJsMessageCodec.java index 4c558432da..47fe0d070e 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/frame/SockJsMessageCodec.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/frame/SockJsMessageCodec.java @@ -19,7 +19,6 @@ package org.springframework.web.socket.sockjs.support.frame; import java.io.IOException; import java.io.InputStream; - /** * Encode and decode messages to and from a SockJS message frame, essentially an array of * JSON-encoded messages. For example: @@ -33,13 +32,11 @@ import java.io.InputStream; */ public interface SockJsMessageCodec { - /** * Encode the given messages as a SockJS message frame. Aside from applying standard * JSON quoting to each message, there are some additional JSON Unicode escaping * rules. See the "JSON Unicode Encoding" section of SockJS protocol (i.e. the * protocol test suite). - * * @param messages the messages to encode * @return the content for a SockJS message frame, never {@code null} */ @@ -47,7 +44,6 @@ public interface SockJsMessageCodec { /** * Decode the given SockJS message frame. - * * @param content the SockJS message frame * @return an array of messages or {@code null} * @throws IOException if the content could not be parsed @@ -56,7 +52,6 @@ public interface SockJsMessageCodec { /** * Decode the given SockJS message frame. - * * @param content the SockJS message frame * @return an array of messages or {@code null} * @throws IOException if the content could not be parsed diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/TransportHandler.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/TransportHandler.java index a7ecd15b3a..069c519955 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/TransportHandler.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/TransportHandler.java @@ -31,7 +31,6 @@ import org.springframework.web.socket.sockjs.SockJsService; */ public interface TransportHandler { - /** * @return the transport type supported by this handler */ diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/AbstractHttpReceivingTransportHandler.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/AbstractHttpReceivingTransportHandler.java index 79de7ab895..3634f59976 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/AbstractHttpReceivingTransportHandler.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/AbstractHttpReceivingTransportHandler.java @@ -42,7 +42,6 @@ import com.fasterxml.jackson.databind.JsonMappingException; public abstract class AbstractHttpReceivingTransportHandler extends TransportHandlerSupport implements TransportHandler { - @Override public final void handleRequest(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, WebSocketSession wsSession) throws SockJsException { diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/DefaultSockJsService.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/DefaultSockJsService.java index c026df03bd..a5278b9c10 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/DefaultSockJsService.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/DefaultSockJsService.java @@ -56,7 +56,6 @@ import org.springframework.web.socket.sockjs.transport.TransportType; import org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession; import org.springframework.web.socket.sockjs.transport.session.SockJsServiceConfig; - /** * A default implementation of {@link SockJsService} adding support for transport handling * and session management. See {@link AbstractSockJsService} base class for important @@ -87,11 +86,10 @@ public class DefaultSockJsService extends AbstractSockJsService { /** * Create an instance with default {@link TransportHandler transport handler} types. - * * @param taskScheduler a task scheduler for heart-beat messages and removing - * timed-out sessions; the provided TaskScheduler should be declared as a - * Spring bean to ensure it is initialized at start up and shut down when the - * application stops. + * timed-out sessions; the provided TaskScheduler should be declared as a + * Spring bean to ensure it is initialized at start up and shut down when the + * application stops. */ public DefaultSockJsService(TaskScheduler taskScheduler) { this(taskScheduler, null); @@ -100,15 +98,14 @@ public class DefaultSockJsService extends AbstractSockJsService { /** * Create an instance by overriding or replacing completely the default * {@link TransportHandler transport handler} types. - * * @param taskScheduler a task scheduler for heart-beat messages and removing - * timed-out sessions; the provided TaskScheduler should be declared as a - * Spring bean to ensure it is initialized at start up and shut down when the - * application stops. + * timed-out sessions; the provided TaskScheduler should be declared as a + * Spring bean to ensure it is initialized at start up and shut down when the + * application stops. * @param transportHandlers the transport handlers to use (replaces the default ones); - * can be {@code null} if you don't want to install the default ones. + * can be {@code null} if you don't want to install the default ones. * @param transportHandlerOverrides zero or more overrides to the default transport - * handler types. + * handler types. */ public DefaultSockJsService(TaskScheduler taskScheduler, Collection transportHandlers, TransportHandler... transportHandlerOverrides) { diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/HtmlFileTransportHandler.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/HtmlFileTransportHandler.java index bc441df097..3b6fa97130 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/HtmlFileTransportHandler.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/HtmlFileTransportHandler.java @@ -40,7 +40,7 @@ import org.springframework.web.util.JavaScriptUtils; /** * An HTTP {@link TransportHandler} that uses a famous browsder document.domain technique: * - * http://stackoverflow.com/questions/1481251/what-does-document-domain-document-domain-do + * http://stackoverflow.com/questions/1481251/what-does-document-domain-document-domain-do * * @author Rossen Stoyanchev * @since 4.0 diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/SockJsSessionFactory.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/SockJsSessionFactory.java index ae15c84788..b4d2c9748b 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/SockJsSessionFactory.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/SockJsSessionFactory.java @@ -33,11 +33,9 @@ public interface SockJsSessionFactory { /** * Create a new SockJS session. - * * @param sessionId the ID of the session * @param wsHandler the underlying {@link WebSocketHandler} * @param attributes handshake request specific attributes - * * @return a new session, never {@code null} */ AbstractSockJsSession createSession(String sessionId, WebSocketHandler wsHandler, Map attributes); diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/TransportHandlerSupport.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/TransportHandlerSupport.java index fd8fba2762..1ccb2f9059 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/TransportHandlerSupport.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/TransportHandlerSupport.java @@ -20,7 +20,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.web.socket.sockjs.transport.session.SockJsServiceConfig; - /** * @author Rossen Stoyanchev * @since 4.0 diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/session/AbstractHttpSockJsSession.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/session/AbstractHttpSockJsSession.java index cd24ec4e16..04b1336859 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/session/AbstractHttpSockJsSession.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/session/AbstractHttpSockJsSession.java @@ -128,7 +128,6 @@ public abstract class AbstractHttpSockJsSession extends AbstractSockJsSession { * Unlike WebSocket where sub-protocol negotiation is part of the * initial handshake, in HTTP transports the same negotiation must * be emulated and the selected protocol set through this setter. - * * @param protocol the sub-protocol to set */ public void setAcceptedProtocol(String protocol) { diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/session/AbstractSockJsSession.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/session/AbstractSockJsSession.java index 29f98c3a22..4bda310c71 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/session/AbstractSockJsSession.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/session/AbstractSockJsSession.java @@ -73,9 +73,9 @@ public abstract class AbstractSockJsSession implements WebSocketSession { public AbstractSockJsSession(String id, SockJsServiceConfig config, WebSocketHandler wsHandler, Map handshakeAttributes) { - Assert.notNull(id, "sessionId is required"); - Assert.notNull(config, "sockJsConfig is required"); - Assert.notNull(wsHandler, "webSocketHandler is required"); + Assert.notNull(id, "SessionId must not be null"); + Assert.notNull(config, "SockJsConfig must not be null"); + Assert.notNull(wsHandler, "WebSocketHandler must not be null"); this.id = id; this.config = config; @@ -208,7 +208,6 @@ public abstract class AbstractSockJsSession implements WebSocketSession { /** * {@inheritDoc} - * *

    Performs cleanup and notifies the {@link WebSocketHandler}. */ @Override diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/session/SockJsServiceConfig.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/session/SockJsServiceConfig.java index d99342753f..a0d44e9a2a 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/session/SockJsServiceConfig.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/session/SockJsServiceConfig.java @@ -38,7 +38,6 @@ public interface SockJsServiceConfig { * closed. After that client will open a new request. Setting this value to * one effectively disables streaming and will make streaming transports to * behave like polling transports. - * *

    The default value is 128K (i.e. 128 * 1024). */ int getStreamBytesLimit(); @@ -47,7 +46,6 @@ public interface SockJsServiceConfig { * The amount of time in milliseconds when the server has not sent any * messages and after which the server should send a heartbeat frame to the * client in order to keep the connection from breaking. - * *

    The default value is 25,000 (25 seconds). */ long getHeartbeatTime(); @@ -67,12 +65,10 @@ public interface SockJsServiceConfig { * The number of server-to-client messages that a session can cache while waiting for * the next HTTP polling request from the client. All HTTP transports use this * property since even streaming transports recycle HTTP requests periodically. - *

    - * The amount of time between HTTP requests should be relatively brief and will not + *

    The amount of time between HTTP requests should be relatively brief and will not * exceed the allows disconnect delay (see * {@link AbstractSockJsService#setDisconnectDelay(long)}, 5 seconds by default. - *

    - * The default size is 100. + *

    The default size is 100. */ int getHttpMessageCacheSize(); diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/support/PerConnectionWebSocketHandler.java b/spring-websocket/src/main/java/org/springframework/web/socket/support/PerConnectionWebSocketHandler.java index 97bd27ed24..74e34e6bad 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/support/PerConnectionWebSocketHandler.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/support/PerConnectionWebSocketHandler.java @@ -34,16 +34,14 @@ import org.springframework.web.socket.WebSocketSession; * A {@link WebSocketHandler} that initializes and destroys a {@link WebSocketHandler} * instance for each WebSocket connection and delegates all other methods to it. * - *

    - * Essentially create an instance of this class once, providing the type of + *

    Essentially create an instance of this class once, providing the type of * {@link WebSocketHandler} class to create for each connection, and then pass it to any * API method that expects a {@link WebSocketHandler}. * - *

    - * If initializing the target {@link WebSocketHandler} type requires a Spring BeanFctory, - * then the {@link #setBeanFactory(BeanFactory)} property accordingly. Simply declaring - * this class as a Spring bean will do that. Otherwise, {@link WebSocketHandler} instances - * of the target type will be created using the default constructor. + *

    If initializing the target {@link WebSocketHandler} type requires a Spring + * BeanFctory, then the {@link #setBeanFactory(BeanFactory)} property accordingly. Simply + * declaring this class as a Spring bean will do that. Otherwise, {@link WebSocketHandler} + * instances of the target type will be created using the default constructor. * * @author Rossen Stoyanchev * @since 4.0 diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/support/SubProtocolCapable.java b/spring-websocket/src/main/java/org/springframework/web/socket/support/SubProtocolCapable.java index 8fc69230f0..75449a8a25 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/support/SubProtocolCapable.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/support/SubProtocolCapable.java @@ -7,7 +7,6 @@ import java.util.List; * * @author Rossen Stoyanchev * @since 4.0 - * * @see RFC-6455 section 1.9 */ public interface SubProtocolCapable { diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/support/WebSocketExtension.java b/spring-websocket/src/main/java/org/springframework/web/socket/support/WebSocketExtension.java index 805038661a..4802e2ee0b 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/support/WebSocketExtension.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/support/WebSocketExtension.java @@ -48,8 +48,7 @@ import org.springframework.util.StringUtils; * * @author Brian Clozel * @since 4.0 - * @see - * WebSocket Protocol Extensions, RFC 6455 - Section 9 + * @see WebSocket Protocol Extensions, RFC 6455 - Section 9 */ public class WebSocketExtension { @@ -60,7 +59,6 @@ public class WebSocketExtension { /** * Create a WebSocketExtension with the given name. - * * @param name the name of the extension */ public WebSocketExtension(String name) { @@ -69,7 +67,6 @@ public class WebSocketExtension { /** * Create a WebSocketExtension with the given name and parameters. - * * @param name the name of the extension * @param parameters the parameters */ diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/support/WebSocketHttpHeaders.java b/spring-websocket/src/main/java/org/springframework/web/socket/support/WebSocketHttpHeaders.java index ff7bbba910..18fe7c679d 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/support/WebSocketHttpHeaders.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/support/WebSocketHttpHeaders.java @@ -60,7 +60,6 @@ public class WebSocketHttpHeaders extends HttpHeaders { /** * Create an instance that wraps the given pre-existing HttpHeaders and also * propagate all changes to it. - * * @param headers the HTTP headers to wrap */ public WebSocketHttpHeaders(HttpHeaders headers) {