Merge branch '5.3.x'
# Conflicts: # spring-jms/src/main/java/org/springframework/jms/listener/endpoint/StandardJmsActivationSpecFactory.java
This commit is contained in:
commit
89f66ccf6a
|
@ -22,7 +22,7 @@ import org.springframework.core.convert.TypeDescriptor;
|
|||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* A constructor resolver attempts locate a constructor and returns a ConstructorExecutor
|
||||
* A constructor resolver attempts to locate a constructor and returns a ConstructorExecutor
|
||||
* that can be used to invoke that constructor. The ConstructorExecutor will be cached but
|
||||
* if it 'goes stale' the resolvers will be called again.
|
||||
*
|
||||
|
|
|
@ -27,7 +27,7 @@ package org.springframework.expression;
|
|||
public interface ParserContext {
|
||||
|
||||
/**
|
||||
* Whether or not the expression being parsed is a template. A template expression
|
||||
* Whether the expression being parsed is a template. A template expression
|
||||
* consists of literal text that can be mixed with evaluatable blocks. Some examples:
|
||||
* <pre class="code">
|
||||
* Some literal text
|
||||
|
|
|
@ -171,7 +171,7 @@ public class CodeFlow implements Opcodes {
|
|||
|
||||
/**
|
||||
* Called after the main expression evaluation method has been generated, this
|
||||
* method will callback any registered FieldAdders or ClinitAdders to add any
|
||||
* method will call back any registered FieldAdders or ClinitAdders to add any
|
||||
* extra information to the class representing the compiled expression.
|
||||
*/
|
||||
public void finish() {
|
||||
|
@ -1008,7 +1008,7 @@ public class CodeFlow implements Opcodes {
|
|||
/**
|
||||
* For use in mathematical operators, handles converting from a (possibly boxed)
|
||||
* number on the stack to a primitive numeric type.
|
||||
* <p>For example, from a Integer to a double, just need to call 'Number.doubleValue()'
|
||||
* <p>For example, from an Integer to a double, just need to call 'Number.doubleValue()'
|
||||
* but from an int to a double, need to use the bytecode 'i2d'.
|
||||
* @param mv the method visitor when instructions should be appended
|
||||
* @param stackDescriptor a descriptor of the operand on the stack
|
||||
|
|
|
@ -66,7 +66,7 @@ public interface SpelNode {
|
|||
void setValue(ExpressionState expressionState, @Nullable Object newValue) throws EvaluationException;
|
||||
|
||||
/**
|
||||
* Return the string form the this AST node.
|
||||
* Return the string form of this AST node.
|
||||
* @return the string form
|
||||
*/
|
||||
String toStringAST();
|
||||
|
|
|
@ -140,7 +140,7 @@ public class ConstructorReference extends SpelNodeImpl {
|
|||
|
||||
// To determine which situation it is, the AccessException will contain a cause.
|
||||
// If the cause is an InvocationTargetException, a user exception was thrown inside the constructor.
|
||||
// Otherwise the constructor could not be invoked.
|
||||
// Otherwise, the constructor could not be invoked.
|
||||
if (ex.getCause() instanceof InvocationTargetException) {
|
||||
// User exception was the root cause - exit now
|
||||
Throwable rootCause = ex.getCause().getCause();
|
||||
|
@ -270,7 +270,7 @@ public class ConstructorReference extends SpelNodeImpl {
|
|||
newArray = Array.newInstance(componentType, arraySize);
|
||||
}
|
||||
else {
|
||||
// Multi-dimensional - hold onto your hat!
|
||||
// Multidimensional - hold onto your hat!
|
||||
int[] dims = new int[this.dimensions.length];
|
||||
long numElements = 1;
|
||||
for (int d = 0; d < this.dimensions.length; d++) {
|
||||
|
@ -287,7 +287,7 @@ public class ConstructorReference extends SpelNodeImpl {
|
|||
else {
|
||||
// There is an initializer
|
||||
if (this.dimensions == null || this.dimensions.length > 1) {
|
||||
// There is an initializer but this is a multi-dimensional array (e.g. new int[][]{{1,2},{3,4}})
|
||||
// There is an initializer but this is a multidimensional array (e.g. new int[][]{{1,2},{3,4}})
|
||||
// - this is not currently supported
|
||||
throw new SpelEvaluationException(getStartPosition(),
|
||||
SpelMessage.MULTIDIM_ARRAY_INITIALIZER_NOT_SUPPORTED);
|
||||
|
|
|
@ -26,8 +26,9 @@ import org.springframework.util.Assert;
|
|||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
/**
|
||||
* Represents the elvis operator ?:. For an expression "a?:b" if a is not null, the value
|
||||
* of the expression is "a", if a is null then the value of the expression is "b".
|
||||
* Represents the elvis operator <code>?:</code>. For an expression <code>a?:b</code> if <code>a</code> is not null,
|
||||
* the value of the expression is <code>a</code>, if <code>a</code> is null then the value of the expression is
|
||||
* <code>b</code>.
|
||||
*
|
||||
* @author Andy Clement
|
||||
* @author Juergen Hoeller
|
||||
|
@ -117,7 +118,7 @@ public class Elvis extends SpelNodeImpl {
|
|||
this.exitTypeDescriptor = conditionDescriptor;
|
||||
}
|
||||
else {
|
||||
// Use the easiest to compute common super type
|
||||
// Use the easiest to compute common supertype
|
||||
this.exitTypeDescriptor = "Ljava/lang/Object";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,8 +29,8 @@ import org.springframework.lang.Nullable;
|
|||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* The operator 'instanceof' checks if an object is of the class specified in the right
|
||||
* hand operand, in the same way that {@code instanceof} does in Java.
|
||||
* The operator 'instanceof' checks if an object is of the class specified in the
|
||||
* right-hand operand, in the same way that {@code instanceof} does in Java.
|
||||
*
|
||||
* @author Andy Clement
|
||||
* @since 3.0
|
||||
|
|
|
@ -164,7 +164,7 @@ public class PropertyOrFieldReference extends SpelNodeImpl {
|
|||
/**
|
||||
* Attempt to read the named property from the current context object.
|
||||
* @return the value of the property
|
||||
* @throws EvaluationException if any problem accessing the property or it cannot be found
|
||||
* @throws EvaluationException if any problem accessing the property, or if it cannot be found
|
||||
*/
|
||||
private TypedValue readProperty(TypedValue contextObject, EvaluationContext evalContext, String name)
|
||||
throws EvaluationException {
|
||||
|
|
|
@ -74,7 +74,7 @@ public class Ternary extends SpelNodeImpl {
|
|||
this.exitTypeDescriptor = leftDescriptor;
|
||||
}
|
||||
else {
|
||||
// Use the easiest to compute common super type
|
||||
// Use the easiest to compute common supertype
|
||||
this.exitTypeDescriptor = "Ljava/lang/Object";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ import org.springframework.util.Assert;
|
|||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Hand-written SpEL parser. Instances are reusable but are not thread-safe.
|
||||
* Handwritten SpEL parser. Instances are reusable but are not thread-safe.
|
||||
*
|
||||
* @author Andy Clement
|
||||
* @author Juergen Hoeller
|
||||
|
|
|
@ -35,7 +35,7 @@ public class OperatorOverloaderTests extends AbstractExpressionTests {
|
|||
|
||||
@Test
|
||||
public void testSimpleOperations() throws Exception {
|
||||
// no built in support for this:
|
||||
// no built-in support for this:
|
||||
evaluateAndCheckError("'abc'-true",SpelMessage.OPERATOR_NOT_SUPPORTED_BETWEEN_TYPES);
|
||||
|
||||
StandardEvaluationContext eContext = TestScenarioCreator.getTestEvaluationContext();
|
||||
|
|
|
@ -123,7 +123,7 @@ public class ScenariosForSpringSecurityExpressionTests extends AbstractExpressio
|
|||
SpelExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext ctx = new StandardEvaluationContext();
|
||||
|
||||
ctx.setRootObject(new Supervisor("Ben")); // so non-qualified references 'hasRole()' 'hasIpAddress()' are invoked against it);
|
||||
ctx.setRootObject(new Supervisor("Ben")); // so non-qualified references 'hasRole()' 'hasIpAddress()' are invoked against it;
|
||||
|
||||
ctx.addMethodResolver(new MyMethodResolver()); // NEEDS TO OVERRIDE THE REFLECTION ONE - SHOW REORDERING MECHANISM
|
||||
// Might be better with a as a variable although it would work as a property too...
|
||||
|
|
|
@ -84,7 +84,7 @@ public class SetValueTests extends AbstractExpressionTests {
|
|||
StandardEvaluationContext lContext = TestScenarioCreator.getTestEvaluationContext();
|
||||
|
||||
// PROPERTYORFIELDREFERENCE
|
||||
// Non existent field (or property):
|
||||
// Non-existent field (or property):
|
||||
Expression e1 = parser.parseExpression("arrayContainer.wibble");
|
||||
assertThat(e1.isWritable(lContext)).as("Should not be writable!").isFalse();
|
||||
|
||||
|
@ -103,12 +103,12 @@ public class SetValueTests extends AbstractExpressionTests {
|
|||
assertThat(e4.isWritable(lContext)).as("Should not be writable!").isFalse();
|
||||
|
||||
// INDEXER
|
||||
// non existent indexer (wibble made up)
|
||||
// non-existent indexer (wibble made up)
|
||||
Expression e5 = parser.parseExpression("arrayContainer.wibble[99]");
|
||||
assertThatExceptionOfType(SpelEvaluationException.class).isThrownBy(() ->
|
||||
e5.isWritable(lContext));
|
||||
|
||||
// non existent indexer (index via a string)
|
||||
// non-existent indexer (index via a string)
|
||||
Expression e6 = parser.parseExpression("arrayContainer.ints['abc']");
|
||||
assertThatExceptionOfType(SpelEvaluationException.class).isThrownBy(() ->
|
||||
e6.isWritable(lContext));
|
||||
|
|
|
@ -272,7 +272,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
|||
assertCanCompile(expression);
|
||||
assertThat(expression.getValue()).asInstanceOf(BOOLEAN).isTrue();
|
||||
|
||||
// Only when the right hand operand is a direct type reference
|
||||
// Only when the right-hand operand is a direct type reference
|
||||
// will it be compilable.
|
||||
StandardEvaluationContext ctx = new StandardEvaluationContext();
|
||||
ctx.setVariable("foo", String.class);
|
||||
|
@ -4155,7 +4155,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
|||
void propertyReference() {
|
||||
TestClass6 tc = new TestClass6();
|
||||
|
||||
// non static field
|
||||
// non-static field
|
||||
expression = parser.parseExpression("orange");
|
||||
assertCantCompile(expression);
|
||||
assertThat(expression.getValue(tc)).isEqualTo("value1");
|
||||
|
|
|
@ -602,7 +602,7 @@ class SpelReproTests extends AbstractExpressionTests {
|
|||
/**
|
||||
* Test whether {@link ReflectiveMethodResolver} follows Java Method Invocation
|
||||
* Conversion order. And more precisely that widening reference conversion is 'higher'
|
||||
* than a unboxing conversion.
|
||||
* than an unboxing conversion.
|
||||
*/
|
||||
@Test
|
||||
void conversionPriority_SPR8224() throws Exception {
|
||||
|
|
|
@ -34,7 +34,7 @@ public interface JmsListenerEndpoint {
|
|||
String getId();
|
||||
|
||||
/**
|
||||
* Setup the specified message listener container with the model
|
||||
* Set up the specified message listener container with the model
|
||||
* defined by this endpoint.
|
||||
* <p>This endpoint must provide the requested missing option(s) of
|
||||
* the specified container to make it usable. Usually, this is about
|
||||
|
|
|
@ -121,7 +121,7 @@ public class JmsListenerEndpointRegistry implements DisposableBean, SmartLifecyc
|
|||
/**
|
||||
* Create a message listener container for the given {@link JmsListenerEndpoint}.
|
||||
* <p>This create the necessary infrastructure to honor that endpoint
|
||||
* with regards to its configuration.
|
||||
* with regard to its configuration.
|
||||
* <p>The {@code startImmediately} flag determines if the container should be
|
||||
* started immediately.
|
||||
* @param endpoint the endpoint to add
|
||||
|
@ -153,7 +153,7 @@ public class JmsListenerEndpointRegistry implements DisposableBean, SmartLifecyc
|
|||
/**
|
||||
* Create a message listener container for the given {@link JmsListenerEndpoint}.
|
||||
* <p>This create the necessary infrastructure to honor that endpoint
|
||||
* with regards to its configuration.
|
||||
* with regard to its configuration.
|
||||
* @param endpoint the endpoint to add
|
||||
* @param factory the listener factory to use
|
||||
* @see #registerListenerContainer(JmsListenerEndpoint, JmsListenerContainerFactory, boolean)
|
||||
|
|
|
@ -123,7 +123,7 @@ public class UserCredentialsConnectionFactoryAdapter
|
|||
|
||||
|
||||
/**
|
||||
* Set user credententials for this proxy and the current thread.
|
||||
* Set user credentials for this proxy and the current thread.
|
||||
* The given username and password will be applied to all subsequent
|
||||
* {@code createConnection()} calls on this ConnectionFactory proxy.
|
||||
* <p>This will override any statically specified user credentials,
|
||||
|
|
|
@ -465,7 +465,7 @@ public abstract class AbstractMessageListenerContainer extends AbstractJmsListen
|
|||
|
||||
/**
|
||||
* Configure the reply destination type. By default, the configured {@code pubSubDomain}
|
||||
* value is used (see {@link #isPubSubDomain()}.
|
||||
* value is used (see {@link #isPubSubDomain()}).
|
||||
* <p>This setting primarily indicates what type of destination to resolve if dynamic
|
||||
* destinations are enabled.
|
||||
* @param replyPubSubDomain "true" for the Publish/Subscribe domain ({@link Topic Topics}),
|
||||
|
|
|
@ -870,7 +870,7 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
|
|||
}
|
||||
|
||||
/**
|
||||
* This implementations proceeds even after an exception thrown from
|
||||
* This implementation proceeds even after an exception thrown from
|
||||
* {@code Connection.start()}, relying on listeners to perform
|
||||
* appropriate recovery.
|
||||
*/
|
||||
|
@ -885,7 +885,7 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
|
|||
}
|
||||
|
||||
/**
|
||||
* This implementations proceeds even after an exception thrown from
|
||||
* This implementation proceeds even after an exception thrown from
|
||||
* {@code Connection.stop()}, relying on listeners to perform
|
||||
* appropriate recovery after a restart.
|
||||
*/
|
||||
|
|
|
@ -33,7 +33,7 @@ import org.springframework.lang.Nullable;
|
|||
public interface MessageListenerContainer extends SmartLifecycle {
|
||||
|
||||
/**
|
||||
* Setup the message listener to use. Throws an {@link IllegalArgumentException}
|
||||
* Set up the message listener to use. Throws an {@link IllegalArgumentException}
|
||||
* if that message listener type is not supported.
|
||||
*/
|
||||
void setupMessageListener(Object messageListener);
|
||||
|
|
|
@ -18,12 +18,12 @@ package org.springframework.jms.listener;
|
|||
|
||||
/**
|
||||
* Interface to be implemented by message listener objects that suggest a specific
|
||||
* name for a durable subscription that they might be registered with. Otherwise
|
||||
* name for a durable subscription that they might be registered with. Otherwise,
|
||||
* the listener class name will be used as a default subscription name.
|
||||
*
|
||||
* <p>Applies to {@link jakarta.jms.MessageListener} objects as well as to
|
||||
* {@link SessionAwareMessageListener} objects and plain listener methods
|
||||
* (as supported by {@link org.springframework.jms.listener.adapter.MessageListenerAdapter}.
|
||||
* (as supported by {@link org.springframework.jms.listener.adapter.MessageListenerAdapter}).
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 2.5.6
|
||||
|
|
|
@ -36,7 +36,7 @@ import org.springframework.util.ObjectUtils;
|
|||
* Message listener adapter that delegates the handling of messages to target
|
||||
* listener methods via reflection, with flexible message type conversion.
|
||||
* Allows listener methods to operate on message content types, completely
|
||||
* independent from the JMS API.
|
||||
* independent of the JMS API.
|
||||
*
|
||||
* <p>By default, the content of incoming JMS messages gets extracted before
|
||||
* being passed into the target listener method, to let the target method
|
||||
|
|
|
@ -182,7 +182,7 @@ public class JmsActivationSpecConfig {
|
|||
* <p>Note that JCA resource adapters generally only support auto and dups-ok
|
||||
* (see Spring's {@link StandardJmsActivationSpecFactory}). ActiveMQ also
|
||||
* supports "SESSION_TRANSACTED" in the form of RA-managed transactions
|
||||
* (automatically translated by Spring's {@link DefaultJmsActivationSpecFactory}.
|
||||
* (automatically translated by Spring's {@link DefaultJmsActivationSpecFactory}).
|
||||
* @param constantName the name of the {@link Session} acknowledge mode constant
|
||||
* @see jakarta.jms.Session#AUTO_ACKNOWLEDGE
|
||||
* @see jakarta.jms.Session#CLIENT_ACKNOWLEDGE
|
||||
|
|
|
@ -192,8 +192,8 @@ public class StandardJmsActivationSpecFactory implements JmsActivationSpecFactor
|
|||
* case of {@code CLIENT_ACKNOWLEDGE} or {@code SESSION_TRANSACTED}
|
||||
* having been requested.
|
||||
* @param bw the BeanWrapper wrapping the ActivationSpec object
|
||||
* @param ackMode the configured acknowledge mode
|
||||
* (according to the constants in {@link jakarta.jms.Session}
|
||||
* @param ackMode the configured acknowledgment mode
|
||||
* (according to the constants in {@link jakarta.jms.Session})
|
||||
* @see jakarta.jms.Session#AUTO_ACKNOWLEDGE
|
||||
* @see jakarta.jms.Session#DUPS_OK_ACKNOWLEDGE
|
||||
* @see jakarta.jms.Session#CLIENT_ACKNOWLEDGE
|
||||
|
|
|
@ -99,7 +99,7 @@ public abstract class JmsAccessor implements InitializingBean {
|
|||
* parameters are not taken into account within a locally managed transaction
|
||||
* either, since the accessor operates on an existing JMS Session in this case.
|
||||
* <p>Setting this flag to "true" will use a short local JMS transaction
|
||||
* when running outside of a managed transaction, and a synchronized local
|
||||
* when running outside a managed transaction, and a synchronized local
|
||||
* JMS transaction in case of a managed transaction (other than an XA
|
||||
* transaction) being present. This has the effect of a local JMS
|
||||
* transaction being managed alongside the main transaction (which might
|
||||
|
@ -123,7 +123,7 @@ public abstract class JmsAccessor implements InitializingBean {
|
|||
/**
|
||||
* Set the JMS acknowledgement mode by the name of the corresponding constant
|
||||
* in the JMS {@link Session} interface, e.g. "CLIENT_ACKNOWLEDGE".
|
||||
* <p>If you want to use vendor-specific extensions to the acknowledgment mode,
|
||||
* <p>If you want to use vendor-specific extensions to the acknowledgement mode,
|
||||
* use {@link #setSessionAcknowledgeMode(int)} instead.
|
||||
* @param constantName the name of the {@link Session} acknowledge mode constant
|
||||
* @see jakarta.jms.Session#AUTO_ACKNOWLEDGE
|
||||
|
@ -139,7 +139,7 @@ public abstract class JmsAccessor implements InitializingBean {
|
|||
* Set the JMS acknowledgement mode that is used when creating a JMS
|
||||
* {@link Session} to send a message.
|
||||
* <p>Default is {@link Session#AUTO_ACKNOWLEDGE}.
|
||||
* <p>Vendor-specific extensions to the acknowledgment mode can be set here as well.
|
||||
* <p>Vendor-specific extensions to the acknowledgement mode can be set here as well.
|
||||
* <p>Note that inside an EJB, the parameters to the
|
||||
* {@code create(Queue/Topic)Session(boolean transacted, int acknowledgeMode)} method
|
||||
* are not taken into account. Depending on the transaction context in the EJB,
|
||||
|
|
|
@ -112,9 +112,9 @@ abstract class AbstractJmsAnnotationDrivenTests {
|
|||
}
|
||||
|
||||
/**
|
||||
* Test for {@link CustomBean} and an manually endpoint registered
|
||||
* Test for {@link CustomBean} and an endpoint manually registered
|
||||
* with "myCustomEndpointId". The custom endpoint does not provide
|
||||
* any factory so it's registered with the default one
|
||||
* any factory, so it's registered with the default one
|
||||
*/
|
||||
protected void testCustomConfiguration(ApplicationContext context) {
|
||||
JmsListenerContainerTestFactory defaultFactory =
|
||||
|
|
|
@ -270,7 +270,7 @@ class JmsTemplateTests {
|
|||
|
||||
/**
|
||||
* Test sending to a destination using the method
|
||||
* send(String d, MessageCreator messageCreator)
|
||||
* {@code send(String d, MessageCreator messageCreator)}
|
||||
*/
|
||||
@Test
|
||||
void testSendDestinationName() throws Exception {
|
||||
|
@ -279,7 +279,7 @@ class JmsTemplateTests {
|
|||
|
||||
/**
|
||||
* Test sending to a destination using the method
|
||||
* send(Destination d, MessageCreator messageCreator) using QOS parameters.
|
||||
* {@code send(Destination d, MessageCreator messageCreator)} using QOS parameters.
|
||||
*/
|
||||
@Test
|
||||
void testSendDestinationWithQOS() throws Exception {
|
||||
|
@ -288,7 +288,7 @@ class JmsTemplateTests {
|
|||
|
||||
/**
|
||||
* Test sending to a destination using the method
|
||||
* send(String d, MessageCreator messageCreator) using QOS parameters.
|
||||
* {@code send(String d, MessageCreator messageCreator)} using QOS parameters.
|
||||
*/
|
||||
@Test
|
||||
void testSendDestinationNameWithQOS() throws Exception {
|
||||
|
|
|
@ -39,7 +39,7 @@ public interface MessageChannel {
|
|||
* <p>This method may block indefinitely, depending on the implementation.
|
||||
* To provide a maximum wait time, use {@link #send(Message, long)}.
|
||||
* @param message the message to send
|
||||
* @return whether or not the message was sent
|
||||
* @return whether the message was sent
|
||||
*/
|
||||
default boolean send(Message<?> message) {
|
||||
return send(message, INDEFINITE_TIMEOUT);
|
||||
|
|
|
@ -127,7 +127,7 @@ public abstract class AbstractMessageConverter implements SmartMessageConverter
|
|||
* Whether this converter should convert messages for which no content type
|
||||
* could be resolved through the configured
|
||||
* {@link org.springframework.messaging.converter.ContentTypeResolver}.
|
||||
* <p>A converter can configured to be strict only when a
|
||||
* <p>A converter can be configured to be strict only when a
|
||||
* {@link #setContentTypeResolver contentTypeResolver} is configured and the
|
||||
* list of {@link #getSupportedMimeTypes() supportedMimeTypes} is not be empty.
|
||||
* <p>When this flag is set to {@code true}, {@link #supportsMimeType(MessageHeaders)}
|
||||
|
|
|
@ -186,7 +186,7 @@ public abstract class AbstractNamedValueMethodArgumentResolver implements SyncHa
|
|||
|
||||
/**
|
||||
* Invoked when a value is required, but {@link #resolveArgumentInternal}
|
||||
* returned {@code null} and there is no default value. Sub-classes can
|
||||
* returned {@code null} and there is no default value. Subclasses can
|
||||
* throw an appropriate exception for this case.
|
||||
* @param name the name for the value
|
||||
* @param parameter the target method parameter
|
||||
|
|
|
@ -65,7 +65,7 @@ import org.springframework.validation.Validator;
|
|||
/**
|
||||
* Extension of {@link AbstractMethodMessageHandler} for reactive, non-blocking
|
||||
* handling of messages via {@link MessageMapping @MessageMapping} methods.
|
||||
* By default such methods are detected in {@code @Controller} Spring beans but
|
||||
* By default, such methods are detected in {@code @Controller} Spring beans but
|
||||
* that can be changed via {@link #setHandlerPredicate(Predicate)}.
|
||||
*
|
||||
* <p>Payloads for incoming messages are decoded through the configured
|
||||
|
@ -74,7 +74,7 @@ import org.springframework.validation.Validator;
|
|||
*
|
||||
* <p>There is no default handling for return values but
|
||||
* {@link #setReturnValueHandlerConfigurer} can be used to configure custom
|
||||
* return value handlers. Sub-classes may also override
|
||||
* return value handlers. Subclasses may also override
|
||||
* {@link #initReturnValueHandlers()} to set up default return value handlers.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
|
|
|
@ -198,7 +198,7 @@ public abstract class AbstractNamedValueMethodArgumentResolver implements Handle
|
|||
|
||||
/**
|
||||
* Invoked when a value is required, but {@link #resolveArgumentInternal}
|
||||
* returned {@code null} and there is no default value. Sub-classes can
|
||||
* returned {@code null} and there is no default value. Subclasses can
|
||||
* throw an appropriate exception for this case.
|
||||
* @param name the name for the value
|
||||
* @param parameter the target method parameter
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.springframework.messaging.handler.annotation.MessageExceptionHandler;
|
|||
import org.springframework.messaging.handler.invocation.AbstractExceptionHandlerMethodResolver;
|
||||
|
||||
/**
|
||||
* A sub-class of {@link AbstractExceptionHandlerMethodResolver} that looks for
|
||||
* A subclass of {@link AbstractExceptionHandlerMethodResolver} that looks for
|
||||
* {@link MessageExceptionHandler}-annotated methods in a given class. The actual
|
||||
* exception types handled are extracted either from the annotation, if present,
|
||||
* or from the method signature as a fallback option.
|
||||
|
|
|
@ -67,8 +67,8 @@ public abstract class AbstractExceptionHandlerMethodResolver {
|
|||
|
||||
/**
|
||||
* Extract the exceptions this method handles. This implementation looks for
|
||||
* sub-classes of Throwable in the method signature.
|
||||
* <p>The method is static to ensure safe use from sub-class constructors.
|
||||
* subclasses of Throwable in the method signature.
|
||||
* <p>The method is static to ensure safe use from subclass constructors.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
protected static List<Class<? extends Throwable>> getExceptionsFromMethodSignature(Method method) {
|
||||
|
|
|
@ -340,7 +340,7 @@ public abstract class AbstractMethodMessageHandler<T>
|
|||
/**
|
||||
* 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
|
||||
* @param handlerType the handler type, possibly a subtype of the method's declaring class
|
||||
* @return the mapping, or {@code null} if the method is not mapped
|
||||
*/
|
||||
@Nullable
|
||||
|
|
|
@ -78,7 +78,7 @@ public class InvocableHandlerMethod extends HandlerMethod {
|
|||
|
||||
|
||||
/**
|
||||
* Set {@link HandlerMethodArgumentResolver HandlerMethodArgumentResolvers} to use to use for resolving method argument values.
|
||||
* Set {@link HandlerMethodArgumentResolver HandlerMethodArgumentResolvers} to use for resolving method argument values.
|
||||
*/
|
||||
public void setMessageMethodArgumentResolvers(HandlerMethodArgumentResolverComposite argumentResolvers) {
|
||||
this.resolvers = argumentResolvers;
|
||||
|
|
|
@ -113,7 +113,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 sub-classes may initialize it to
|
||||
* <p>This is not set by default. However, subclasses may initialize it to
|
||||
* some default strategy (e.g. {@code @Controller} classes).
|
||||
* @see #setHandlers(List)
|
||||
*/
|
||||
|
@ -235,7 +235,7 @@ public abstract class AbstractMethodMessageHandler<T>
|
|||
|
||||
/**
|
||||
* Return the argument resolvers initialized during {@link #afterPropertiesSet()}.
|
||||
* Primarily for internal use in sub-classes.
|
||||
* Primarily for internal use in subclasses.
|
||||
* @since 5.2.2
|
||||
*/
|
||||
protected HandlerMethodArgumentResolverComposite getArgumentResolvers() {
|
||||
|
@ -362,7 +362,7 @@ public abstract class AbstractMethodMessageHandler<T>
|
|||
/**
|
||||
* Obtain the mapping for the given method, if any.
|
||||
* @param method the method to check
|
||||
* @param handlerType the handler type, possibly a sub-type of the method's declaring class
|
||||
* @param handlerType the handler type, possibly a subtype of the method's declaring class
|
||||
* @return the mapping, or {@code null} if the method is not mapped
|
||||
*/
|
||||
@Nullable
|
||||
|
@ -418,7 +418,7 @@ public abstract class AbstractMethodMessageHandler<T>
|
|||
|
||||
/**
|
||||
* This method is invoked just before mappings are added. It allows
|
||||
* sub-classes to update the mapping with the {@link HandlerMethod} in mind.
|
||||
* 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.
|
||||
* <p>By default this method returns the mapping that is passed in.
|
||||
|
|
|
@ -77,7 +77,7 @@ public class InvocableHandlerMethod extends HandlerMethod {
|
|||
|
||||
|
||||
/**
|
||||
* Configure the argument resolvers to use to use for resolving method
|
||||
* Configure the argument resolvers to use for resolving method
|
||||
* argument values against a {@code ServerWebExchange}.
|
||||
*/
|
||||
public void setArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) {
|
||||
|
|
|
@ -91,7 +91,7 @@ public interface RSocketRequester extends Disposable {
|
|||
* If a formatted variable contains a "." it is replaced with the escape
|
||||
* sequence "%2E" to avoid treating it as separator by the responder .
|
||||
* <p>If the connection is set to use composite metadata, the route is
|
||||
* encoded as {@code "message/x.rsocket.routing.v0"}. Otherwise the route
|
||||
* encoded as {@code "message/x.rsocket.routing.v0"}. Otherwise, the route
|
||||
* is encoded according to the mime type for the connection.
|
||||
* @param route the route expressing a remote handler mapping
|
||||
* @param routeVars variables to be expanded into the route template
|
||||
|
@ -105,7 +105,7 @@ public interface RSocketRequester extends Disposable {
|
|||
* to a {@link Publisher} via {@link ReactiveAdapterRegistry}.
|
||||
* @param metadata the metadata value to encode
|
||||
* @param mimeType the mime type that describes the metadata;
|
||||
* This is required for connection using composite metadata. Otherwise the
|
||||
* This is required for connection using composite metadata. Otherwise, the
|
||||
* value is encoded according to the mime type for the connection and this
|
||||
* argument may be left as {@code null}.
|
||||
*/
|
||||
|
@ -434,7 +434,7 @@ public interface RSocketRequester extends Disposable {
|
|||
* <p>If the return type is {@code Mono<Void>}, the {@code Mono} will
|
||||
* complete after all data is consumed.
|
||||
* <p><strong>Note:</strong> This method will raise an error if
|
||||
* the request payload is a multi-valued {@link Publisher} as there is
|
||||
* the request payload is a multivalued {@link Publisher} as there is
|
||||
* no many-to-one RSocket interaction.
|
||||
* @param dataType the expected data type for the response
|
||||
* @param <T> parameter for the expected data type
|
||||
|
|
|
@ -183,7 +183,7 @@ public interface RSocketStrategies {
|
|||
Builder routeMatcher(@Nullable RouteMatcher routeMatcher);
|
||||
|
||||
/**
|
||||
* Configure the registry for reactive type support. This can be used to
|
||||
* Configure the registry for reactive type support. This can be used
|
||||
* to adapt to, and/or determine the semantics of a given
|
||||
* {@link org.reactivestreams.Publisher Publisher}.
|
||||
* <p>By default this {@link ReactiveAdapterRegistry#getSharedInstance()}.
|
||||
|
|
|
@ -104,7 +104,7 @@ class MessagingRSocket implements RSocket {
|
|||
*/
|
||||
public Mono<Void> handleConnectionSetupPayload(ConnectionSetupPayload payload) {
|
||||
// frameDecoder does not apply to connectionSetupPayload
|
||||
// so retain here since handle expects it..
|
||||
// so retain here since handle expects it.
|
||||
payload.retain();
|
||||
return handle(payload, FrameType.SETUP);
|
||||
}
|
||||
|
|
|
@ -154,7 +154,7 @@ public class RSocketFrameTypeMessageCondition extends AbstractMessageCondition<R
|
|||
|
||||
/**
|
||||
* Return a condition for matching the RSocket request interaction type with
|
||||
* that is selected based on the delcared request and response cardinality
|
||||
* that is selected based on the declared request and response cardinality
|
||||
* of some handler method.
|
||||
* <p>The table below shows the selections made:
|
||||
* <table>
|
||||
|
|
|
@ -193,7 +193,7 @@ public class RSocketMessageHandler extends MessageMappingMessageHandler {
|
|||
* likewise when this property is set the {@code RSocketStrategies} are
|
||||
* mutated to change the extractor in it.
|
||||
* <p>By default this is set to the
|
||||
* {@link org.springframework.messaging.rsocket.RSocketStrategies.Builder#metadataExtractor(MetadataExtractor)} defaults}
|
||||
* {@link org.springframework.messaging.rsocket.RSocketStrategies.Builder#metadataExtractor(MetadataExtractor) defaults}
|
||||
* from {@code RSocketStrategies}.
|
||||
* @param extractor the extractor to use
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -33,9 +33,9 @@ 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),
|
||||
* session id, and others.
|
||||
* session ID, and others.
|
||||
*
|
||||
* <p>Use one of the static factory method in this class, then call getters and setters,
|
||||
* <p>Use one of the static factory methods 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
|
||||
|
@ -91,7 +91,8 @@ public class SimpMessageHeaderAccessor extends NativeMessageHeaderAccessor {
|
|||
|
||||
/**
|
||||
* A constructor for creating new message headers.
|
||||
* This constructor is protected. See factory methods in this and sub-classes.
|
||||
* <p>This constructor is protected. See factory methods in this class
|
||||
* and subclasses.
|
||||
*/
|
||||
protected SimpMessageHeaderAccessor(SimpMessageType messageType,
|
||||
@Nullable Map<String, List<String>> externalSourceHeaders) {
|
||||
|
@ -103,8 +104,9 @@ public class SimpMessageHeaderAccessor extends NativeMessageHeaderAccessor {
|
|||
}
|
||||
|
||||
/**
|
||||
* A constructor for accessing and modifying existing message headers. This
|
||||
* constructor is protected. See factory methods in this and sub-classes.
|
||||
* A constructor for accessing and modifying existing message headers.
|
||||
* <p>This constructor is protected. See factory methods in this class
|
||||
* and subclasses.
|
||||
*/
|
||||
protected SimpMessageHeaderAccessor(Message<?> message) {
|
||||
super(message);
|
||||
|
|
|
@ -247,7 +247,7 @@ public abstract class AbstractBrokerMessageHandler
|
|||
* Check whether this message handler is currently running.
|
||||
* <p>Note that even when this message handler is running the
|
||||
* {@link #isBrokerAvailable()} flag may still independently alternate between
|
||||
* being on and off depending on the concrete sub-class implementation.
|
||||
* being on and off depending on the concrete subclass implementation.
|
||||
*/
|
||||
@Override
|
||||
public final boolean isRunning() {
|
||||
|
@ -260,7 +260,7 @@ public abstract class AbstractBrokerMessageHandler
|
|||
* indicates whether this message handler is running. In other words the message
|
||||
* handler must first be running and then the {@code #isBrokerAvailable()} flag
|
||||
* may still independently alternate between being on and off depending on the
|
||||
* concrete sub-class implementation.
|
||||
* concrete subclass implementation.
|
||||
* <p>Application components may implement
|
||||
* {@code org.springframework.context.ApplicationListener<BrokerAvailabilityEvent>}
|
||||
* to receive notifications when broker becomes available and unavailable.
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.springframework.util.Assert;
|
|||
/**
|
||||
* Decorator for an {@link ExecutorSubscribableChannel} that ensures messages
|
||||
* are processed in the order they were published to the channel. Messages are
|
||||
* sent one at a time with the next one released when the prevoius has been
|
||||
* sent one at a time with the next one released when the previous has been
|
||||
* processed. This decorator is intended to be applied per session.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
|
|
|
@ -925,7 +925,7 @@ public class StompBrokerRelayMessageHandler extends AbstractBrokerMessageHandler
|
|||
|
||||
/**
|
||||
* After a DISCONNECT there should be no more client frames so we can
|
||||
* close the connection pro-actively. However, if the DISCONNECT has a
|
||||
* close the connection proactively. However, if the DISCONNECT has a
|
||||
* receipt header we leave the connection open and expect the server will
|
||||
* respond with a RECEIPT and then close the connection.
|
||||
* @see <a href="https://stomp.github.io/stomp-specification-1.2.html#DISCONNECT">
|
||||
|
|
|
@ -91,9 +91,9 @@ public class StompDecoder {
|
|||
* Decodes one or more STOMP frames from the given {@code buffer} and returns
|
||||
* a list of {@link Message Messages}.
|
||||
* <p>If the given ByteBuffer contains only partial STOMP frame content and no
|
||||
* complete STOMP frames, an empty list is returned, and the buffer is reset to
|
||||
* complete STOMP frames, an empty list is returned, and the buffer is reset
|
||||
* to where it was.
|
||||
* <p>If the buffer contains one ore more STOMP frames, those are returned and
|
||||
* <p>If the buffer contains one or more STOMP frames, those are returned and
|
||||
* the buffer reset to point to the beginning of the unused partial content.
|
||||
* <p>The output partialMessageHeaders map is used to store successfully parsed
|
||||
* headers in case of partial content. The caller can then check if a
|
||||
|
|
|
@ -82,7 +82,7 @@ public interface StompSession {
|
|||
/**
|
||||
* An overloaded version of {@link #subscribe(String, StompFrameHandler)}
|
||||
* with full {@link StompHeaders} instead of just a destination.
|
||||
* @param headers the headers for the subscribe message frame
|
||||
* @param headers the headers for the subscribed message frame
|
||||
* @param handler the handler for received messages
|
||||
* @return a handle to use to unsubscribe and/or track receipts
|
||||
*/
|
||||
|
|
|
@ -60,7 +60,7 @@ public interface ExecutorChannelInterceptor extends ChannelInterceptor {
|
|||
* @param message the message handled
|
||||
* @param channel the channel on which the message was sent to
|
||||
* @param handler the target handler that handled the message
|
||||
* @param ex any exception that may been raised by the handler
|
||||
* @param ex any exception that may have been raised by the handler
|
||||
*/
|
||||
default void afterMessageHandled(Message<?> message, MessageChannel channel, MessageHandler handler,
|
||||
@Nullable Exception ex) {
|
||||
|
|
|
@ -110,7 +110,7 @@ public final class MessageBuilder<T> {
|
|||
|
||||
/**
|
||||
* Copy the name-value pairs from the provided Map. This operation will overwrite any
|
||||
* existing values. Use { {@link #copyHeadersIfAbsent(Map)} to avoid overwriting
|
||||
* existing values. Use {@link #copyHeadersIfAbsent(Map)} to avoid overwriting
|
||||
* values. Note that the 'id' and 'timestamp' header values will never be overwritten.
|
||||
*/
|
||||
public MessageBuilder<T> copyHeaders(@Nullable Map<String, ?> headersToCopy) {
|
||||
|
@ -169,7 +169,7 @@ public final class MessageBuilder<T> {
|
|||
|
||||
|
||||
/**
|
||||
* Create a builder for a new {@link Message} instance pre-populated with all of the
|
||||
* Create a builder for a new {@link Message} instance pre-populated with all the
|
||||
* headers copied from the provided message. The payload of the provided Message will
|
||||
* also be used as the payload for the new message.
|
||||
* <p>If the provided message is an {@link ErrorMessage}, the
|
||||
|
|
|
@ -43,12 +43,12 @@ import org.springframework.util.StringUtils;
|
|||
* strongly typed accessors for specific headers, the ability to leave headers
|
||||
* in a {@link Message} mutable, and the option to suppress automatic generation
|
||||
* of {@link MessageHeaders#ID id} and {@link MessageHeaders#TIMESTAMP
|
||||
* timesteamp} headers. Sub-classes such as {@link NativeMessageHeaderAccessor}
|
||||
* timesteamp} headers. Subclasses such as {@link NativeMessageHeaderAccessor}
|
||||
* and others provide support for managing processing vs external source headers
|
||||
* as well as protocol specific headers.
|
||||
*
|
||||
* <p>Below is a workflow to initialize headers via {@code MessageHeaderAccessor},
|
||||
* or one of its sub-classes, then create a {@link Message}, and then re-obtain
|
||||
* or one of its subclasses, then create a {@link Message}, and then re-obtain
|
||||
* the accessor possibly from a different component:
|
||||
* <pre class="code">
|
||||
* // Create a message with headers
|
||||
|
@ -153,7 +153,7 @@ public class MessageHeaderAccessor {
|
|||
// Configuration properties
|
||||
|
||||
/**
|
||||
* By default when {@link #getMessageHeaders()} is called, {@code "this"}
|
||||
* By default, when {@link #getMessageHeaders()} is called, {@code "this"}
|
||||
* {@code MessageHeaderAccessor} instance can no longer be used to modify the
|
||||
* underlying message headers and the returned {@code MessageHeaders} is immutable.
|
||||
* <p>However when this is set to {@code true}, the returned (underlying)
|
||||
|
@ -173,7 +173,7 @@ public class MessageHeaderAccessor {
|
|||
}
|
||||
|
||||
/**
|
||||
* By default when {@link #getMessageHeaders()} is called, {@code "this"}
|
||||
* By default, when {@link #getMessageHeaders()} is called, {@code "this"}
|
||||
* {@code MessageHeaderAccessor} instance can no longer be used to modify the
|
||||
* underlying message headers. However if {@link #setLeaveMutable(boolean)}
|
||||
* is used, this method is necessary to indicate explicitly when the
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -30,15 +30,15 @@ import org.springframework.util.MultiValueMap;
|
|||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
/**
|
||||
* {@link MessageHeaderAccessor} sub-class that supports storage and access of
|
||||
* {@link MessageHeaderAccessor} subclass that supports storage and access of
|
||||
* headers from an external source such as a message broker. Headers from the
|
||||
* external source are kept separate from other headers, in a sub-map under the
|
||||
* key {@link #NATIVE_HEADERS}. This allows separating processing headers from
|
||||
* headers that need to be sent to or received from the external source.
|
||||
*
|
||||
* <p>This class is likely to be used through indirectly through a protocol
|
||||
* specific sub-class that also provide factory methods to translate
|
||||
* message headers to an from an external messaging source.
|
||||
* <p>This class is likely to be used indirectly through a protocol-specific
|
||||
* subclass that also provides factory methods to translate message headers
|
||||
* to and from an external messaging source.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 4.0
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.springframework.core.MethodIntrospector;
|
|||
import org.springframework.util.ReflectionUtils;
|
||||
|
||||
/**
|
||||
* Sub-class for {@link AbstractExceptionHandlerMethodResolver} for testing.
|
||||
* Subclass for {@link AbstractExceptionHandlerMethodResolver} for testing.
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class TestExceptionResolver extends AbstractExceptionHandlerMethodResolver {
|
||||
|
|
Loading…
Reference in New Issue