Replace 'e.g.' with 'for example' in documentation and comments
Closes gh-33515
This commit is contained in:
committed by
Sam Brannen
parent
e55fe9077f
commit
8941e2876e
@@ -34,7 +34,7 @@ import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.MimeType;
|
||||
|
||||
/**
|
||||
* Common base class for plain JSON converters, e.g. Gson and JSON-B.
|
||||
* Common base class for plain JSON converters, for example, Gson and JSON-B.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 5.3
|
||||
|
||||
@@ -283,7 +283,7 @@ public abstract class AbstractMessageConverter implements SmartMessageConverter
|
||||
* @param message the input message
|
||||
* @param targetClass the target class for the conversion
|
||||
* @param conversionHint an extra object passed to the {@link MessageConverter},
|
||||
* e.g. the associated {@code MethodParameter} (may be {@code null}}
|
||||
* for example, the associated {@code MethodParameter} (may be {@code null}}
|
||||
* @return the result of the conversion, or {@code null} if the converter cannot
|
||||
* perform the conversion
|
||||
* @since 4.2
|
||||
@@ -300,7 +300,7 @@ public abstract class AbstractMessageConverter implements SmartMessageConverter
|
||||
* @param payload the Object to convert
|
||||
* @param headers optional headers for the message (may be {@code null})
|
||||
* @param conversionHint an extra object passed to the {@link MessageConverter},
|
||||
* e.g. the associated {@code MethodParameter} (may be {@code null}}
|
||||
* for example, the associated {@code MethodParameter} (may be {@code null}}
|
||||
* @return the resulting payload for the message, or {@code null} if the converter
|
||||
* cannot perform the conversion
|
||||
* @since 4.2
|
||||
|
||||
@@ -34,12 +34,12 @@ public interface SmartMessageConverter extends MessageConverter {
|
||||
|
||||
/**
|
||||
* A variant of {@link #fromMessage(Message, Class)} which takes an extra
|
||||
* conversion context as an argument, allowing to take e.g. annotations
|
||||
* conversion context as an argument, allowing to take, for example, annotations
|
||||
* on a payload parameter into account.
|
||||
* @param message the input message
|
||||
* @param targetClass the target class for the conversion
|
||||
* @param conversionHint an extra object passed to the {@link MessageConverter},
|
||||
* e.g. the associated {@code MethodParameter} (may be {@code null}}
|
||||
* for example, the associated {@code MethodParameter} (may be {@code null}}
|
||||
* @return the result of the conversion, or {@code null} if the converter cannot
|
||||
* perform the conversion
|
||||
* @see #fromMessage(Message, Class)
|
||||
@@ -49,12 +49,12 @@ public interface SmartMessageConverter extends MessageConverter {
|
||||
|
||||
/**
|
||||
* A variant of {@link #toMessage(Object, MessageHeaders)} which takes an extra
|
||||
* conversion context as an argument, allowing to take e.g. annotations
|
||||
* conversion context as an argument, allowing to take, for example, annotations
|
||||
* on a return type into account.
|
||||
* @param payload the Object to convert
|
||||
* @param headers optional headers for the message (may be {@code null})
|
||||
* @param conversionHint an extra object passed to the {@link MessageConverter},
|
||||
* e.g. the associated {@code MethodParameter} (may be {@code null}}
|
||||
* for example, the associated {@code MethodParameter} (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
|
||||
* @see #toMessage(Object, MessageHeaders)
|
||||
|
||||
@@ -44,7 +44,7 @@ public abstract class AbstractMessageSendingTemplate<D> implements MessageSendin
|
||||
|
||||
/**
|
||||
* Name of the header that can be set to provide further information
|
||||
* (e.g. a {@code MethodParameter} instance) about the origin of the
|
||||
* (for example, a {@code MethodParameter} instance) about the origin of the
|
||||
* payload, to be taken into account as a conversion hint.
|
||||
* @since 4.2
|
||||
*/
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.springframework.util.Assert;
|
||||
/**
|
||||
* {@link DestinationResolver} implementation that proxies a target DestinationResolver,
|
||||
* caching its {@link #resolveDestination} results. Such caching is particularly useful
|
||||
* if the destination resolving process is expensive (e.g. the destination has to be
|
||||
* if the destination resolving process is expensive (for example, the destination has to be
|
||||
* resolved through an external system) and the resolution results are stable anyway.
|
||||
*
|
||||
* @author Agim Emruli
|
||||
|
||||
@@ -61,7 +61,7 @@ public abstract class AbstractMessageCondition<T extends AbstractMessageConditio
|
||||
|
||||
/**
|
||||
* Return the collection of objects the message condition is composed of
|
||||
* (e.g. destination patterns), never {@code null}.
|
||||
* (for example, destination patterns), never {@code null}.
|
||||
*/
|
||||
protected abstract Collection<?> getContent();
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ import org.springframework.util.ClassUtils;
|
||||
* method annotations, etc.
|
||||
*
|
||||
* <p>The class may be created with a bean instance or with a bean name
|
||||
* (e.g. lazy-init bean, prototype bean). Use {@link #createWithResolvedBean()}
|
||||
* (for example, lazy-init bean, prototype bean). Use {@link #createWithResolvedBean()}
|
||||
* to obtain a {@code HandlerMethod} instance with a bean instance resolved
|
||||
* through the associated {@link BeanFactory}.
|
||||
*
|
||||
@@ -222,7 +222,7 @@ public class HandlerMethod extends AnnotatedMethod {
|
||||
String text = "The mapped handler method class '" + methodDeclaringClass.getName() +
|
||||
"' is not an instance of the actual endpoint bean class '" +
|
||||
targetBeanClass.getName() + "'. If the endpoint requires proxying " +
|
||||
"(e.g. due to @Transactional), please use class-based proxying.";
|
||||
"(for example, due to @Transactional), please use class-based proxying.";
|
||||
throw new IllegalStateException(formatInvokeError(text, args));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.springframework.messaging.Message;
|
||||
/**
|
||||
* Contract for mapping conditions to messages.
|
||||
*
|
||||
* <p>Message conditions can be combined (e.g. type + method-level conditions),
|
||||
* <p>Message conditions can be combined (for example, type + method-level conditions),
|
||||
* 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.
|
||||
*
|
||||
|
||||
@@ -42,7 +42,7 @@ import org.springframework.messaging.Message;
|
||||
* handled otherwise. </li>
|
||||
* <li>{@link DestinationVariable @DestinationVariable} method argument for
|
||||
* access to template variable values extracted from the message destination,
|
||||
* e.g. {@code /hotels/{hotel}}. Variable values may also be converted from
|
||||
* for example, {@code /hotels/{hotel}}. Variable values may also be converted from
|
||||
* String to the declared method argument type, if needed.</li>
|
||||
* <li>{@link Header @Header} method argument to extract a specific message
|
||||
* header value and have a
|
||||
@@ -77,9 +77,9 @@ import org.springframework.messaging.Message;
|
||||
*
|
||||
* <p>Specializations of this annotation include
|
||||
* {@link org.springframework.messaging.simp.annotation.SubscribeMapping @SubscribeMapping}
|
||||
* (e.g. STOMP subscriptions) and
|
||||
* (for example, STOMP subscriptions) and
|
||||
* {@link org.springframework.messaging.rsocket.annotation.ConnectMapping @ConnectMapping}
|
||||
* (e.g. RSocket connections). Both narrow the primary mapping further and also match
|
||||
* (for example, RSocket connections). Both narrow the primary mapping further and also match
|
||||
* against the message type. Both can be combined with a type-level
|
||||
* {@code @MessageMapping} that declares a common pattern prefix (or prefixes).
|
||||
*
|
||||
@@ -94,7 +94,7 @@ import org.springframework.messaging.Message;
|
||||
* "Annotated Responders"</a>.
|
||||
* </ul>
|
||||
*
|
||||
* <p><b>NOTE:</b> When using controller interfaces (e.g. for AOP proxying),
|
||||
* <p><b>NOTE:</b> When using controller interfaces (for example, for AOP proxying),
|
||||
* make sure to consistently put <i>all</i> your mapping annotations - such as
|
||||
* {@code @MessageMapping} and {@code @SubscribeMapping} - on
|
||||
* the controller <i>interface</i> rather than on the implementation class.
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.springframework.messaging.handler.invocation.reactive.SyncHandlerMeth
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
/**
|
||||
* Abstract base class to resolve method arguments from a named value, e.g.
|
||||
* Abstract base class to resolve method arguments from a named value, for example,
|
||||
* message headers or destination variables. Named values could have one or more
|
||||
* of a name, a required flag, and a default value.
|
||||
*
|
||||
|
||||
@@ -170,7 +170,7 @@ public class MessageMappingMessageHandler extends AbstractMethodMessageHandler<C
|
||||
|
||||
/**
|
||||
* Configure a {@link ConversionService} to use for type conversion of
|
||||
* String based values, e.g. in destination variables or headers.
|
||||
* String based values, for example, in destination variables or headers.
|
||||
* <p>By default {@link DefaultFormattingConversionService} is used.
|
||||
* @param conversionService the conversion service to use
|
||||
*/
|
||||
|
||||
@@ -34,7 +34,7 @@ import org.springframework.messaging.handler.invocation.HandlerMethodArgumentRes
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
/**
|
||||
* Abstract base class to resolve method arguments from a named value, e.g.
|
||||
* Abstract base class to resolve method arguments from a named value, for example,
|
||||
* message headers or destination variables. Named values could have one or more
|
||||
* of a name, a required flag, and a default value.
|
||||
*
|
||||
|
||||
@@ -99,7 +99,7 @@ public class MessageMethodArgumentResolver implements HandlerMethodArgumentResol
|
||||
* Resolve the target class to convert the payload to.
|
||||
* <p>By default this is the generic type declared in the {@code Message}
|
||||
* method parameter but that can be overridden to select a more specific
|
||||
* target type after also taking into account the "Content-Type", e.g.
|
||||
* target type after also taking into account the "Content-Type", for example,
|
||||
* return {@code String} if target type is {@code Object} and
|
||||
* {@code "Content-Type:text/**"}.
|
||||
* @param parameter the target method parameter
|
||||
|
||||
@@ -186,7 +186,7 @@ public class PayloadMethodArgumentResolver implements HandlerMethodArgumentResol
|
||||
* Resolve the target class to convert the payload to.
|
||||
* <p>By default this is simply {@link MethodParameter#getParameterType()}
|
||||
* but that can be overridden to select a more specific target type after
|
||||
* also taking into account the "Content-Type", e.g. return {@code String}
|
||||
* also taking into account the "Content-Type", for example, return {@code String}
|
||||
* if target type is {@code Object} and {@code "Content-Type:text/**"}.
|
||||
* @param parameter the target method parameter
|
||||
* @param message the message being processed
|
||||
|
||||
@@ -112,7 +112,7 @@ public abstract class AbstractExceptionHandlerMethodResolver {
|
||||
|
||||
/**
|
||||
* Find a {@link Method} to handle the given exception type. This can be
|
||||
* useful if an {@link Exception} instance is not available (e.g. for tools).
|
||||
* useful if an {@link Exception} instance is not available (for example, for tools).
|
||||
* <p>Uses {@link ExceptionDepthComparator} if more than one match is found.
|
||||
* @param exceptionType the exception type
|
||||
* @return a Method to handle the exception, or {@code null} if none found
|
||||
|
||||
@@ -415,7 +415,7 @@ public abstract class AbstractMethodMessageHandler<T>
|
||||
|
||||
/**
|
||||
* Subclasses can invoke this method to populate the MessagingAdviceBean cache
|
||||
* (e.g. to support "global" {@code @MessageExceptionHandler}).
|
||||
* (for example, to support "global" {@code @MessageExceptionHandler}).
|
||||
* @since 4.2
|
||||
*/
|
||||
protected void registerExceptionHandlerAdvice(
|
||||
|
||||
@@ -86,7 +86,7 @@ public class InvocableHandlerMethod extends HandlerMethod {
|
||||
|
||||
/**
|
||||
* Set the ParameterNameDiscoverer for resolving parameter names when needed
|
||||
* (e.g. default request attribute name).
|
||||
* (for example, default request attribute name).
|
||||
* <p>Default is a {@link org.springframework.core.DefaultParameterNameDiscoverer}.
|
||||
*/
|
||||
public void setParameterNameDiscoverer(ParameterNameDiscoverer parameterNameDiscoverer) {
|
||||
|
||||
@@ -114,7 +114,7 @@ public abstract class AbstractMethodMessageHandler<T>
|
||||
* Configure a predicate for selecting which Spring beans to check for the
|
||||
* presence of message handler methods.
|
||||
* <p>This is not set by default. However, subclasses may initialize it to
|
||||
* some default strategy (e.g. {@code @Controller} classes).
|
||||
* some default strategy (for example, {@code @Controller} classes).
|
||||
* @see #setHandlers(List)
|
||||
*/
|
||||
public void setHandlerPredicate(@Nullable Predicate<Class<?>> handlerPredicate) {
|
||||
@@ -210,7 +210,7 @@ public abstract class AbstractMethodMessageHandler<T>
|
||||
|
||||
/**
|
||||
* Subclasses can invoke this method to populate the MessagingAdviceBean cache
|
||||
* (e.g. to support "global" {@code @MessageExceptionHandler}).
|
||||
* (for example, to support "global" {@code @MessageExceptionHandler}).
|
||||
*/
|
||||
protected void registerExceptionHandlerAdvice(
|
||||
MessagingAdviceBean bean, AbstractExceptionHandlerMethodResolver resolver) {
|
||||
@@ -227,7 +227,7 @@ public abstract class AbstractMethodMessageHandler<T>
|
||||
|
||||
/**
|
||||
* Return a read-only multi-value map with a direct lookup of mappings,
|
||||
* (e.g. for non-pattern destinations).
|
||||
* (for example, for non-pattern destinations).
|
||||
*/
|
||||
public MultiValueMap<String, T> getDestinationLookup() {
|
||||
return CollectionUtils.unmodifiableMultiValueMap(CollectionUtils.toMultiValueMap(this.destinationLookup));
|
||||
@@ -419,7 +419,7 @@ public abstract class AbstractMethodMessageHandler<T>
|
||||
* This method is invoked just before mappings are added. It allows
|
||||
* subclasses to update the mapping with the {@link HandlerMethod} in mind.
|
||||
* This can be useful when the method signature is used to refine the
|
||||
* mapping, e.g. based on the cardinality of input and output.
|
||||
* mapping, for example, based on the cardinality of input and output.
|
||||
* <p>By default this method returns the mapping that is passed in.
|
||||
* @param mapping the mapping to be added
|
||||
* @param handlerMethod the target handler for the mapping
|
||||
@@ -547,7 +547,7 @@ public abstract class AbstractMethodMessageHandler<T>
|
||||
|
||||
/**
|
||||
* Create a concrete instance of {@link AbstractExceptionHandlerMethodResolver}
|
||||
* that finds exception handling methods based on some criteria, e.g. based
|
||||
* that finds exception handling methods based on some criteria, for example, based
|
||||
* on the presence of {@code @MessageExceptionHandler}.
|
||||
* @param beanType the class in which an exception occurred during handling
|
||||
* @return the resolver to use
|
||||
|
||||
@@ -92,7 +92,7 @@ public class InvocableHandlerMethod extends HandlerMethod {
|
||||
|
||||
/**
|
||||
* Set the ParameterNameDiscoverer for resolving parameter names when needed
|
||||
* (e.g. default request attribute name).
|
||||
* (for example, default request attribute name).
|
||||
* <p>Default is a {@link DefaultParameterNameDiscoverer}.
|
||||
*/
|
||||
public void setParameterNameDiscoverer(ParameterNameDiscoverer nameDiscoverer) {
|
||||
|
||||
@@ -114,7 +114,7 @@ class InvocableHelper {
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to populate the MessagingAdviceBean cache (e.g. to support "global"
|
||||
* Method to populate the MessagingAdviceBean cache (for example, to support "global"
|
||||
* {@code @MessageExceptionHandler}).
|
||||
*/
|
||||
public void registerExceptionHandlerAdvice(
|
||||
|
||||
@@ -245,13 +245,13 @@ final class DefaultRSocketRequesterBuilder implements RSocketRequester.Builder {
|
||||
if (this.dataMimeType != null) {
|
||||
return this.dataMimeType;
|
||||
}
|
||||
// First non-basic Decoder (e.g. CBOR, Protobuf)
|
||||
// First non-basic Decoder (for example, CBOR, Protobuf)
|
||||
for (Decoder<?> candidate : strategies.decoders()) {
|
||||
if (!isCoreCodec(candidate) && !candidate.getDecodableMimeTypes().isEmpty()) {
|
||||
return getMimeType(candidate);
|
||||
}
|
||||
}
|
||||
// First core decoder (e.g. String)
|
||||
// First core decoder (for example, String)
|
||||
for (Decoder<?> decoder : strategies.decoders()) {
|
||||
if (!decoder.getDecodableMimeTypes().isEmpty()) {
|
||||
return getMimeType(decoder);
|
||||
|
||||
@@ -90,7 +90,7 @@ public interface RSocketRequester extends Disposable {
|
||||
|
||||
/**
|
||||
* Begin to specify a new request with the given route to a remote handler.
|
||||
* <p>The route can be a template with placeholders, e.g.
|
||||
* <p>The route can be a template with placeholders, for example,
|
||||
* {@code "flight.{code}"} in which case the supplied route variables are
|
||||
* formatted via {@code toString()} and expanded into the template.
|
||||
* If a formatted variable contains a "." it is replaced with the escape
|
||||
|
||||
@@ -32,7 +32,7 @@ import io.rsocket.ConnectionSetupPayload;
|
||||
* {@link org.springframework.messaging.handler.annotation.MessageMapping @MessageMapping}
|
||||
* for a combined route pattern. It supports the same arguments as
|
||||
* {@code @MessageMapping} but the return value must be {@code void}. On a
|
||||
* server, handling can be asynchronous (e.g. {@code Mono<Void>}), in which
|
||||
* server, handling can be asynchronous (for example, {@code Mono<Void>}), in which
|
||||
* case the connection is accepted if and when the {@code Mono<Void>} completes.
|
||||
* On the client side this method is only a callback and does not affect the
|
||||
* establishment of the connection.
|
||||
@@ -40,7 +40,7 @@ import io.rsocket.ConnectionSetupPayload;
|
||||
* <p><strong>Note:</strong> an {@code @ConnectMapping} method may start
|
||||
* requests to the remote through an
|
||||
* {@link org.springframework.messaging.rsocket.RSocketRequester RSocketRequester}
|
||||
* method argument, but it must do so independent of the handling thread (e.g.
|
||||
* method argument, but it must do so independent of the handling thread (for example,
|
||||
* via subscribing on a different thread).
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
|
||||
@@ -66,7 +66,7 @@ public class RSocketFrameTypeMessageCondition extends AbstractMessageCondition<R
|
||||
public static final RSocketFrameTypeMessageCondition REQUEST_CHANNEL_CONDITION =
|
||||
new RSocketFrameTypeMessageCondition(FrameType.REQUEST_CHANNEL);
|
||||
|
||||
/** Empty condition that does not match to any RSocket frames (e.g. for type-level mappings) */
|
||||
/** Empty condition that does not match to any RSocket frames (for example, for type-level mappings). */
|
||||
public static final RSocketFrameTypeMessageCondition EMPTY_CONDITION = new RSocketFrameTypeMessageCondition();
|
||||
|
||||
|
||||
|
||||
@@ -485,7 +485,7 @@ public class RSocketMessageHandler extends MessageMappingMessageHandler {
|
||||
* <p>Note that the given handlers do not need to have any stereotype
|
||||
* annotations such as {@code @Controller} which helps to avoid overlap with
|
||||
* server side handlers that may be used in the same application. However,
|
||||
* for more advanced scenarios, e.g. discovering handlers through a custom
|
||||
* for more advanced scenarios, for example, discovering handlers through a custom
|
||||
* stereotype annotation, consider declaring {@code RSocketMessageHandler}
|
||||
* as a bean, and then obtain the responder from it.
|
||||
* @param strategies the strategies to set on the created
|
||||
|
||||
@@ -28,7 +28,7 @@ import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* A wrapper class for access to attributes associated with a SiMP session
|
||||
* (e.g. WebSocket session).
|
||||
* (for example, WebSocket session).
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 4.1
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.springframework.lang.Nullable;
|
||||
import org.springframework.messaging.Message;
|
||||
|
||||
/**
|
||||
* Holder class to expose SiMP attributes associated with a session (e.g. WebSocket)
|
||||
* Holder class to expose SiMP attributes associated with a session (for example, WebSocket)
|
||||
* in the form of a thread-bound {@link SimpAttributes} object.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.springframework.util.CollectionUtils;
|
||||
/**
|
||||
* 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),
|
||||
* across protocols such as a destination, message type (for example, publish, subscribe, etc),
|
||||
* session ID, and others.
|
||||
*
|
||||
* <p>Use one of the static factory methods in this class, then call getters and setters,
|
||||
|
||||
@@ -55,11 +55,11 @@ public interface SimpMessageSendingOperations extends MessageSendingOperations<S
|
||||
|
||||
/**
|
||||
* Send a message to the given user.
|
||||
* <p>By default headers are interpreted as native headers (e.g. STOMP) and
|
||||
* <p>By default headers are interpreted as native headers (for example, STOMP) and
|
||||
* are saved under a special key in the resulting Spring
|
||||
* {@link org.springframework.messaging.Message Message}. In effect when the
|
||||
* message leaves the application, the provided headers are included with it
|
||||
* and delivered to the destination (e.g. the STOMP client or broker).
|
||||
* and delivered to the destination (for example, the STOMP client or broker).
|
||||
* <p>If the map already contains the key
|
||||
* {@link org.springframework.messaging.support.NativeMessageHeaderAccessor#NATIVE_HEADERS "nativeHeaders"}
|
||||
* or was prepared with
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* A {@link Scope} implementation exposing the attributes of a SiMP session
|
||||
* (e.g. WebSocket session).
|
||||
* (for example, WebSocket session).
|
||||
*
|
||||
* <p>Relies on a thread-bound {@link SimpAttributes} instance exported by
|
||||
* {@link org.springframework.messaging.simp.annotation.support.SimpAnnotationMethodMessageHandler}.
|
||||
|
||||
@@ -28,7 +28,7 @@ import org.springframework.messaging.handler.annotation.MessageMappingReflective
|
||||
/**
|
||||
* 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).
|
||||
* (for example, STOMP SUBSCRIBE frame).
|
||||
*
|
||||
* <p>This is a method-level annotation that can be combined with a type-level
|
||||
* {@link org.springframework.messaging.handler.annotation.MessageMapping @MessageMapping}.
|
||||
@@ -43,7 +43,7 @@ import org.springframework.messaging.handler.annotation.MessageMappingReflective
|
||||
* user and does not pass through the message broker. This is useful for
|
||||
* implementing a request-reply pattern.
|
||||
*
|
||||
* <p><b>NOTE:</b> When using controller interfaces (e.g. for AOP proxying),
|
||||
* <p><b>NOTE:</b> When using controller interfaces (for example, for AOP proxying),
|
||||
* make sure to consistently put <i>all</i> your mapping annotations - such as
|
||||
* {@code @MessageMapping} and {@code @SubscribeMapping} - on
|
||||
* the controller <i>interface</i> rather than on the implementation class.
|
||||
@@ -62,9 +62,9 @@ public @interface SubscribeMapping {
|
||||
|
||||
/**
|
||||
* Destination-based mapping expressed by this annotation.
|
||||
* <p>This is the destination of the STOMP message (e.g. {@code "/positions"}).
|
||||
* Ant-style path patterns (e.g. {@code "/price.stock.*"}) and path template
|
||||
* variables (e.g. <code>"/price.stock.{ticker}"</code>) are also supported.
|
||||
* <p>This is the destination of the STOMP message (for example, {@code "/positions"}).
|
||||
* Ant-style path patterns (for example, {@code "/price.stock.*"}) and path template
|
||||
* variables (for example, <code>"/price.stock.{ticker}"</code>) are also supported.
|
||||
*/
|
||||
String[] value() default {};
|
||||
|
||||
|
||||
@@ -131,8 +131,8 @@ public class SimpAnnotationMethodMessageHandler extends AbstractMethodMessageHan
|
||||
/**
|
||||
* Create an instance of SimpAnnotationMethodMessageHandler with the given
|
||||
* message channels and broker messaging template.
|
||||
* @param clientInboundChannel the channel for receiving messages from clients (e.g. WebSocket clients)
|
||||
* @param clientOutboundChannel the channel for messages to clients (e.g. WebSocket clients)
|
||||
* @param clientInboundChannel the channel for receiving messages from clients (for example, WebSocket clients)
|
||||
* @param clientOutboundChannel the channel for messages to clients (for example, WebSocket clients)
|
||||
* @param brokerTemplate a messaging template to send application messages to the broker
|
||||
*/
|
||||
public SimpAnnotationMethodMessageHandler(SubscribableChannel clientInboundChannel,
|
||||
@@ -159,7 +159,7 @@ public class SimpAnnotationMethodMessageHandler extends AbstractMethodMessageHan
|
||||
* therefore a slash is automatically appended where missing to ensure a
|
||||
* proper prefix-based match (i.e. matching complete segments).
|
||||
* <p>Note however that the remaining portion of a destination after the
|
||||
* prefix may use a different separator (e.g. commonly "." in messaging)
|
||||
* prefix may use a different separator (for example, commonly "." in messaging)
|
||||
* depending on the configured {@code PathMatcher}.
|
||||
*/
|
||||
@Override
|
||||
|
||||
@@ -87,8 +87,8 @@ public abstract class AbstractBrokerMessageHandler
|
||||
|
||||
/**
|
||||
* Constructor with no destination prefixes (matches all destinations).
|
||||
* @param inboundChannel the channel for receiving messages from clients (e.g. WebSocket clients)
|
||||
* @param outboundChannel the channel for sending messages to clients (e.g. WebSocket clients)
|
||||
* @param inboundChannel the channel for receiving messages from clients (for example, WebSocket clients)
|
||||
* @param outboundChannel the channel for sending messages to clients (for example, WebSocket clients)
|
||||
* @param brokerChannel the channel for the application to send messages to the broker
|
||||
*/
|
||||
public AbstractBrokerMessageHandler(SubscribableChannel inboundChannel, MessageChannel outboundChannel,
|
||||
@@ -99,8 +99,8 @@ public abstract class AbstractBrokerMessageHandler
|
||||
|
||||
/**
|
||||
* Constructor with destination prefixes to match to destinations of messages.
|
||||
* @param inboundChannel the channel for receiving messages from clients (e.g. WebSocket clients)
|
||||
* @param outboundChannel the channel for sending messages to clients (e.g. WebSocket clients)
|
||||
* @param inboundChannel the channel for receiving messages from clients (for example, WebSocket clients)
|
||||
* @param outboundChannel the channel for sending messages to clients (for example, WebSocket clients)
|
||||
* @param brokerChannel the channel for the application to send messages to the broker
|
||||
* @param destinationPrefixes prefixes to use to filter out messages
|
||||
*/
|
||||
|
||||
@@ -84,8 +84,8 @@ public class SimpleBrokerMessageHandler extends AbstractBrokerMessageHandler {
|
||||
/**
|
||||
* Create a SimpleBrokerMessageHandler instance with the given message channels
|
||||
* and destination prefixes.
|
||||
* @param clientInboundChannel the channel for receiving messages from clients (e.g. WebSocket clients)
|
||||
* @param clientOutboundChannel the channel for sending messages to clients (e.g. WebSocket clients)
|
||||
* @param clientInboundChannel the channel for receiving messages from clients (for example, WebSocket clients)
|
||||
* @param clientOutboundChannel the channel for sending messages to clients (for example, WebSocket clients)
|
||||
* @param brokerChannel the channel for the application to send messages to the broker
|
||||
* @param destinationPrefixes prefixes to use to filter out messages
|
||||
*/
|
||||
|
||||
@@ -91,7 +91,7 @@ import org.springframework.validation.beanvalidation.OptionalValidatorFactoryBea
|
||||
* into any application component to send messages.
|
||||
*
|
||||
* <p>Subclasses are responsible for the parts of the configuration that feed messages
|
||||
* to and from the client inbound/outbound channels (e.g. STOMP over WebSocket).
|
||||
* to and from the client inbound/outbound channels (for example, STOMP over WebSocket).
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @author Brian Clozel
|
||||
|
||||
@@ -77,7 +77,7 @@ public class MessageBrokerRegistry {
|
||||
|
||||
/**
|
||||
* Enable a simple message broker and configure one or more prefixes to filter
|
||||
* destinations targeting the broker (e.g. destinations prefixed with "/topic").
|
||||
* destinations targeting the broker (for example, destinations prefixed with "/topic").
|
||||
*/
|
||||
public SimpleBrokerRegistration enableSimpleBroker(String... destinationPrefixes) {
|
||||
this.simpleBrokerRegistration = new SimpleBrokerRegistration(
|
||||
@@ -127,7 +127,7 @@ public class MessageBrokerRegistry {
|
||||
* Configure one or more prefixes to filter destinations targeting application
|
||||
* 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").
|
||||
* message broker (for example, "/topic", "/queue").
|
||||
* <p>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.
|
||||
|
||||
@@ -123,7 +123,7 @@ public class StompBrokerRelayRegistration extends AbstractBrokerRegistration {
|
||||
/**
|
||||
* Set the login for the shared "system" connection used to send messages to
|
||||
* the STOMP broker from within the application, i.e. messages not associated
|
||||
* with a specific client session (e.g. REST/HTTP request handling method).
|
||||
* with a specific client session (for example, REST/HTTP request handling method).
|
||||
* <p>By default this is set to "guest".
|
||||
*/
|
||||
public StompBrokerRelayRegistration setSystemLogin(String login) {
|
||||
@@ -135,7 +135,7 @@ public class StompBrokerRelayRegistration extends AbstractBrokerRegistration {
|
||||
/**
|
||||
* Set the passcode for the shared "system" connection used to send messages to
|
||||
* the STOMP broker from within the application, i.e. messages not associated
|
||||
* with a specific client session (e.g. REST/HTTP request handling method).
|
||||
* with a specific client session (for example, REST/HTTP request handling method).
|
||||
* <p>By default this is set to "guest".
|
||||
*/
|
||||
public StompBrokerRelayRegistration setSystemPasscode(String passcode) {
|
||||
@@ -194,7 +194,7 @@ public class StompBrokerRelayRegistration extends AbstractBrokerRegistration {
|
||||
}
|
||||
|
||||
/**
|
||||
* Some STOMP clients (e.g. stomp-js) always send heartbeats at a fixed rate
|
||||
* Some STOMP clients (for example, stomp-js) always send heartbeats at a fixed rate
|
||||
* but others (Spring STOMP client) do so only when no other messages are
|
||||
* sent. However messages with a non-broker {@link #getDestinationPrefixes()
|
||||
* destination prefix} aren't forwarded and as a result the broker may deem
|
||||
@@ -228,7 +228,7 @@ public class StompBrokerRelayRegistration extends AbstractBrokerRegistration {
|
||||
* a chance to try.
|
||||
* <p>By default this is not set.
|
||||
* @param destination the destination to broadcast unresolved messages to,
|
||||
* e.g. "/topic/unresolved-user-destination"
|
||||
* for example, "/topic/unresolved-user-destination"
|
||||
*/
|
||||
public StompBrokerRelayRegistration setUserDestinationBroadcast(String destination) {
|
||||
this.userDestinationBroadcast = destination;
|
||||
@@ -247,7 +247,7 @@ public class StompBrokerRelayRegistration extends AbstractBrokerRegistration {
|
||||
* users connected to other servers.
|
||||
* <p>By default this is not set.
|
||||
* @param destination the destination for broadcasting user registry details,
|
||||
* e.g. "/topic/simp-user-registry".
|
||||
* for example, "/topic/simp-user-registry".
|
||||
*/
|
||||
public StompBrokerRelayRegistration setUserRegistryBroadcast(String destination) {
|
||||
this.userRegistryBroadcast = destination;
|
||||
|
||||
@@ -35,7 +35,7 @@ import org.springframework.util.MultiValueMap;
|
||||
* is not enough data still, continues to buffer.
|
||||
*
|
||||
* <p>A single instance of this decoder can be invoked repeatedly to read all
|
||||
* messages from a single stream (e.g. WebSocket session) as long as decoding
|
||||
* messages from a single stream (for example, WebSocket session) as long as decoding
|
||||
* does not fail. If there is an exception, StompDecoder instance should not
|
||||
* be used any more as its internal state is not guaranteed to be consistent.
|
||||
* It is expected that the underlying session is closed at that point.
|
||||
|
||||
@@ -157,8 +157,8 @@ public class StompBrokerRelayMessageHandler extends AbstractBrokerMessageHandler
|
||||
/**
|
||||
* Create a StompBrokerRelayMessageHandler instance with the given message channels
|
||||
* and destination prefixes.
|
||||
* @param inboundChannel the channel for receiving messages from clients (e.g. WebSocket clients)
|
||||
* @param outboundChannel the channel for sending messages to clients (e.g. WebSocket clients)
|
||||
* @param inboundChannel the channel for receiving messages from clients (for example, WebSocket clients)
|
||||
* @param outboundChannel the channel for sending messages to clients (for example, WebSocket clients)
|
||||
* @param brokerChannel the channel for the application to send messages to the broker
|
||||
* @param destinationPrefixes the broker supported destination prefixes; destinations
|
||||
* that do not match the given prefix are ignored.
|
||||
@@ -241,7 +241,7 @@ public class StompBrokerRelayMessageHandler extends AbstractBrokerMessageHandler
|
||||
/**
|
||||
* Set the login for the shared "system" connection used to send messages to
|
||||
* the STOMP broker from within the application, i.e. messages not associated
|
||||
* with a specific client session (e.g. REST/HTTP request handling method).
|
||||
* with a specific client session (for example, REST/HTTP request handling method).
|
||||
* <p>By default this is set to "guest".
|
||||
*/
|
||||
public void setSystemLogin(String systemLogin) {
|
||||
@@ -259,7 +259,7 @@ public class StompBrokerRelayMessageHandler extends AbstractBrokerMessageHandler
|
||||
/**
|
||||
* Set the passcode for the shared "system" connection used to send messages to
|
||||
* the STOMP broker from within the application, i.e. messages not associated
|
||||
* with a specific client session (e.g. REST/HTTP request handling method).
|
||||
* with a specific client session (for example, REST/HTTP request handling method).
|
||||
* <p>By default this is set to "guest".
|
||||
*/
|
||||
public void setSystemPasscode(String systemPasscode) {
|
||||
@@ -317,7 +317,7 @@ public class StompBrokerRelayMessageHandler extends AbstractBrokerMessageHandler
|
||||
* Configure one more destinations to subscribe to on the shared "system"
|
||||
* connection along with MessageHandler's to handle received messages.
|
||||
* <p>This is for internal use in a multi-application server scenario where
|
||||
* servers forward messages to each other (e.g. unresolved user destinations).
|
||||
* servers forward messages to each other (for example, unresolved user destinations).
|
||||
* @param subscriptions the destinations to subscribe to.
|
||||
*/
|
||||
public void setSystemSubscriptions(@Nullable Map<String, MessageHandler> subscriptions) {
|
||||
|
||||
@@ -46,7 +46,7 @@ import org.springframework.util.StringUtils;
|
||||
* {@link org.springframework.messaging.support.NativeMessageHeaderAccessor}
|
||||
* while the parent class {@link SimpMessageHeaderAccessor} manages common
|
||||
* processing headers some of which are based on STOMP headers
|
||||
* (e.g. destination, content-type, etc).
|
||||
* (for example, destination, content-type, etc).
|
||||
*
|
||||
* <p>An instance of this class can also be created by wrapping an existing
|
||||
* {@code Message}. That message may have been created with the more generic
|
||||
|
||||
@@ -37,14 +37,14 @@ import org.springframework.util.StringUtils;
|
||||
* A default implementation of {@code UserDestinationResolver} that relies
|
||||
* on a {@link SimpUserRegistry} to find active sessions for a user.
|
||||
*
|
||||
* <p>When a user attempts to subscribe, e.g. to "/user/queue/position-updates",
|
||||
* <p>When a user attempts to subscribe, for example, to "/user/queue/position-updates",
|
||||
* the "/user" prefix is removed and a unique suffix added based on the session
|
||||
* id, e.g. "/queue/position-updates-useri9oqdfzo" to ensure different users can
|
||||
* id, for example, "/queue/position-updates-useri9oqdfzo" to ensure different users can
|
||||
* subscribe to the same logical destination without colliding.
|
||||
*
|
||||
* <p>When sending to a user, e.g. "/user/{username}/queue/position-updates", the
|
||||
* <p>When sending to a user, for example, "/user/{username}/queue/position-updates", the
|
||||
* "/user/{username}" prefix is removed and a suffix based on active session id's
|
||||
* is added, e.g. "/queue/position-updates-useri9oqdfzo".
|
||||
* is added, for example, "/queue/position-updates-useri9oqdfzo".
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @author Brian Clozel
|
||||
@@ -239,7 +239,7 @@ public class DefaultUserDestinationResolver implements UserDestinationResolver {
|
||||
* @param sourceDestination the source destination from the input message.
|
||||
* @param actualDestination a subset of the destination without any user prefix.
|
||||
* @param sessionId the id of an active user session, never {@code null}.
|
||||
* @param user the target user, possibly {@code null}, e.g if not authenticated.
|
||||
* @param user the target user, possibly {@code null},, for example, if not authenticated.
|
||||
* @return a target destination, or {@code null} if none
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@@ -283,14 +283,14 @@ public class DefaultUserDestinationResolver implements UserDestinationResolver {
|
||||
}
|
||||
|
||||
/**
|
||||
* The destination from the source message, e.g. "/user/{user}/queue/position-updates".
|
||||
* The destination from the source message, for example, "/user/{user}/queue/position-updates".
|
||||
*/
|
||||
public String getSourceDestination() {
|
||||
return this.sourceDestination;
|
||||
}
|
||||
|
||||
/**
|
||||
* The actual destination, without any user prefix, e.g. "/queue/position-updates".
|
||||
* The actual destination, without any user prefix, for example, "/queue/position-updates".
|
||||
*/
|
||||
public String getActualDestination() {
|
||||
return this.actualDestination;
|
||||
|
||||
@@ -59,7 +59,7 @@ public class MultiServerUserRegistry implements SimpUserRegistry, SmartApplicati
|
||||
|
||||
private final boolean delegateApplicationEvents;
|
||||
|
||||
/* Cross-server session lookup (e.g. same user connected to multiple servers) */
|
||||
/* Cross-server session lookup (for example, same user connected to multiple servers) */
|
||||
private final SessionLookup sessionLookup = new SessionLookup();
|
||||
|
||||
|
||||
@@ -278,7 +278,7 @@ public class MultiServerUserRegistry implements SimpUserRegistry, SmartApplicati
|
||||
// User sessions from "this" registry only (i.e. one server)
|
||||
private final Set<TransferSimpSession> sessions;
|
||||
|
||||
// Cross-server session lookup (e.g. user connected to multiple servers)
|
||||
// Cross-server session lookup (for example, user connected to multiple servers)
|
||||
@Nullable
|
||||
private SessionLookup sessionLookup;
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ public class UserDestinationResult {
|
||||
|
||||
/**
|
||||
* The target destinations that the source destination was translated to,
|
||||
* one per active user session, e.g. "/queue/position-updates-useri9oqdfzo".
|
||||
* one per active user session, for example, "/queue/position-updates-useri9oqdfzo".
|
||||
* @return the target destinations, never {@code null} but possibly an empty
|
||||
* set if there are no active sessions for the user.
|
||||
*/
|
||||
@@ -91,7 +91,7 @@ public class UserDestinationResult {
|
||||
}
|
||||
|
||||
/**
|
||||
* The user destination in the form expected when a client subscribes, e.g.
|
||||
* The user destination in the form expected when a client subscribes, for example,
|
||||
* "/user/queue/position-updates".
|
||||
* @return the subscribe form of the "user" destination, never {@code null}.
|
||||
*/
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.springframework.messaging.Message;
|
||||
|
||||
/**
|
||||
* Contract to encode and decode a {@link Message} to and from a {@link ByteBuffer}
|
||||
* allowing a higher-level protocol (e.g. STOMP over TCP) to plug in.
|
||||
* allowing a higher-level protocol (for example, STOMP over TCP) to plug in.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 6.0
|
||||
|
||||
Reference in New Issue
Block a user