Replace 'e.g.' with 'for example' in documentation and comments

Closes gh-33515
This commit is contained in:
Yanming Zhou
2024-09-26 14:03:46 +02:00
committed by Sam Brannen
parent e55fe9077f
commit 8941e2876e
722 changed files with 1290 additions and 1290 deletions

View File

@@ -114,8 +114,8 @@ public abstract class AbstractJmsListenerEndpoint implements JmsListenerEndpoint
/**
* Set a concurrency for the listener, if any.
* <p>The concurrency limits can be a "lower-upper" String, e.g. "5-10", or a simple
* upper limit String, e.g. "10" (the lower limit will be 1 in this case).
* <p>The concurrency limits can be a "lower-upper" String, for example, "5-10", or a simple
* upper limit String, for example, "10" (the lower limit will be 1 in this case).
* <p>The underlying container may or may not support all features. For instance, it
* may not be able to scale: in that case only the upper value is used.
*/

View File

@@ -413,7 +413,7 @@ public abstract class ConnectionFactoryUtils {
/**
* Callback for resource cleanup at the end of a non-native JMS transaction
* (e.g. when participating in a JtaTransactionManager transaction).
* (for example, when participating in a JtaTransactionManager transaction).
* @see org.springframework.transaction.jta.JtaTransactionManager
*/
private static class JmsResourceSynchronization extends ResourceHolderSynchronization<JmsResourceHolder, Object> {

View File

@@ -33,7 +33,7 @@ import org.springframework.util.Assert;
* {@link jakarta.jms.ConnectionFactory} implementation that delegates all calls
* to a given target {@link jakarta.jms.ConnectionFactory}, adapting specific
* {@code create(Queue/Topic)Connection} calls to the target ConnectionFactory
* if necessary (e.g. when running JMS 1.0.2 API based code against a generic
* if necessary (for example, when running JMS 1.0.2 API based code against a generic
* JMS 1.1 ConnectionFactory, such as ActiveMQ's PooledConnectionFactory).
*
* <p>As of Spring Framework 5, this class supports JMS 2.0 {@code JMSContext}

View File

@@ -251,7 +251,7 @@ public class JmsResourceHolder extends ResourceHolderSupport {
while (ds != null) {
if (TransactionSynchronizationManager.hasResource(ds)) {
// IllegalStateException from sharing the underlying JDBC Connection
// which typically gets committed first, e.g. with Oracle AQ --> ignore
// which typically gets committed first, for example, with Oracle AQ --> ignore
return;
}
try {

View File

@@ -52,7 +52,7 @@ import org.springframework.util.ObjectUtils;
* A JMS ConnectionFactory adapter that returns the same Connection
* from all {@link #createConnection()} calls, and ignores calls to
* {@link jakarta.jms.Connection#close()}. According to the JMS Connection
* model, this is perfectly thread-safe (in contrast to e.g. JDBC). The
* model, this is perfectly thread-safe (in contrast to, for example, JDBC). The
* shared Connection can be automatically recovered in case of an Exception.
*
* <p>You can either pass in a specific JMS Connection directly or let this

View File

@@ -70,7 +70,7 @@ import org.springframework.util.ClassUtils;
* <p>Returned transactional Session proxies will implement the {@link SessionProxy}
* interface to allow for access to the underlying target Session. This is only
* intended for accessing vendor-specific Session API or for testing purposes
* (e.g. to perform manual transaction control). For typical application purposes,
* (for example, to perform manual transaction control). For typical application purposes,
* simply use the standard JMS Session interface.
*
* <p>As of Spring Framework 5, this class delegates JMS 2.0 {@code JMSContext}

View File

@@ -205,7 +205,7 @@ public abstract class AbstractMessageListenerContainer extends AbstractJmsListen
* <p>Alternatively, specify a "destinationName", to be dynamically
* resolved via the {@link org.springframework.jms.support.destination.DestinationResolver}.
* <p>Note: The destination may be replaced at runtime, with the listener
* container picking up the new destination immediately (works e.g. with
* container picking up the new destination immediately (works, for example, with
* DefaultMessageListenerContainer, as long as the cache level is less than
* CACHE_CONSUMER). However, this is considered advanced usage; use it with care!
* @see #setDestinationName(String)
@@ -234,7 +234,7 @@ public abstract class AbstractMessageListenerContainer extends AbstractJmsListen
* {@link #setDestinationResolver destination resolver}.
* <p>Alternatively, specify a JMS {@link Destination} object as "destination".
* <p>Note: The destination may be replaced at runtime, with the listener
* container picking up the new destination immediately (works e.g. with
* container picking up the new destination immediately (works, for example, with
* DefaultMessageListenerContainer, as long as the cache level is less than
* CACHE_CONSUMER). However, this is considered advanced usage; use it with care!
* @see #setDestination(jakarta.jms.Destination)
@@ -268,7 +268,7 @@ public abstract class AbstractMessageListenerContainer extends AbstractJmsListen
* Default is none.
* <p>See the JMS specification for a detailed definition of selector expressions.
* <p>Note: The message selector may be replaced at runtime, with the listener
* container picking up the new selector value immediately (works e.g. with
* container picking up the new selector value immediately (works, for example, with
* DefaultMessageListenerContainer, as long as the cache level is less than
* CACHE_CONSUMER). However, this is considered advanced usage; use it with care!
*/
@@ -290,7 +290,7 @@ public abstract class AbstractMessageListenerContainer extends AbstractJmsListen
* This can be either a standard JMS {@link MessageListener} object
* or a Spring {@link SessionAwareMessageListener} object.
* <p>Note: The message listener may be replaced at runtime, with the listener
* container picking up the new listener object immediately (works e.g. with
* container picking up the new listener object immediately (works, for example, with
* DefaultMessageListenerContainer, as long as the cache level is less than
* CACHE_CONSUMER). However, this is considered advanced usage; use it with care!
* @throws IllegalArgumentException if the supplied listener is not a

View File

@@ -115,7 +115,7 @@ public abstract class AbstractPollingMessageListenerContainer extends AbstractMe
* Simply switch the {@link #setSessionTransacted "sessionTransacted"} flag
* to "true" in order to use a locally transacted JMS Session for the entire
* receive processing, including any Session operations performed by a
* {@link SessionAwareMessageListener} (e.g. sending a response message). This
* {@link SessionAwareMessageListener} (for example, sending a response message). This
* allows for fully synchronized Spring transactions based on local JMS
* transactions, similar to what
* {@link org.springframework.jms.connection.JmsTransactionManager} provides. Check
@@ -259,7 +259,7 @@ public abstract class AbstractPollingMessageListenerContainer extends AbstractMe
catch (RuntimeException ex) {
// Typically a late persistence exception from a listener-used resource
// -> handle it as listener exception, not as an infrastructure problem.
// E.g. a database locking failure should not lead to listener shutdown.
// For example, a database locking failure should not lead to listener shutdown.
handleListenerException(ex);
}
return messageReceived;

View File

@@ -89,7 +89,7 @@ import org.springframework.util.backoff.FixedBackOff;
* by specifying a {@link #setMaxConcurrentConsumers "maxConcurrentConsumers"}
* value that is higher than the {@link #setConcurrentConsumers "concurrentConsumers"}
* value. Since the latter's default is 1, you can also simply specify a
* "maxConcurrentConsumers" of e.g. 5, which will lead to dynamic scaling up to
* "maxConcurrentConsumers" of, for example, 5, which will lead to dynamic scaling up to
* 5 concurrent consumers in case of increasing message load, as well as dynamic
* shrinking back to the standard number of consumers once the load decreases.
* Consider adapting the {@link #setIdleTaskExecutionLimit "idleTaskExecutionLimit"}
@@ -353,8 +353,8 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
/**
* Specify concurrency limits via a "lower-upper" String, e.g. "5-10", or a simple
* upper limit String, e.g. "10" (the lower limit will be 1 in this case).
* Specify concurrency limits via a "lower-upper" String, for example, "5-10", or a simple
* upper limit String, for example, "10" (the lower limit will be 1 in this case).
* <p>This listener container will always hold on to the minimum number of consumers
* ({@link #setConcurrentConsumers}) and will slowly scale up to the maximum number
* of consumers {@link #setMaxConcurrentConsumers} in case of increasing load.
@@ -374,7 +374,7 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
}
catch (NumberFormatException ex) {
throw new IllegalArgumentException("Invalid concurrency value [" + concurrency + "]: only " +
"single maximum integer (e.g. \"5\") and minimum-maximum combo (e.g. \"3-5\") supported.");
"single maximum integer (for example, \"5\") and minimum-maximum combo (for example, \"3-5\") supported.");
}
}

View File

@@ -115,8 +115,8 @@ public class SimpleMessageListenerContainer extends AbstractMessageListenerConta
}
/**
* Specify concurrency limits via a "lower-upper" String, e.g. "5-10", or a simple
* upper limit String, e.g. "10".
* Specify concurrency limits via a "lower-upper" String, for example, "5-10", or a simple
* upper limit String, for example, "10".
* <p>This listener container will always hold on to the maximum number of
* consumers {@link #setConcurrentConsumers} since it is unable to scale.
* <p>This property is primarily supported for configuration compatibility with
@@ -136,7 +136,7 @@ public class SimpleMessageListenerContainer extends AbstractMessageListenerConta
}
catch (NumberFormatException ex) {
throw new IllegalArgumentException("Invalid concurrency value [" + concurrency + "]: only " +
"single maximum integer (e.g. \"5\") and minimum-maximum combo (e.g. \"3-5\") supported. " +
"single maximum integer (for example, \"5\") and minimum-maximum combo (for example, \"3-5\") supported. " +
"Note that SimpleMessageListenerContainer will effectively ignore the minimum value and " +
"always keep a fixed number of consumers according to the maximum value.");
}

View File

@@ -30,7 +30,7 @@ import org.springframework.beans.BeanWrapper;
* through autodetection of well-known vendor-specific provider properties.
*
* <p>An ActivationSpec factory is effectively dependent on the concrete
* JMS provider, e.g. on ActiveMQ. This default implementation simply
* JMS provider, for example, on ActiveMQ. This default implementation simply
* guesses the ActivationSpec class name from the provider's class name
* ("ActiveMQResourceAdapter" &rarr; "ActiveMQActivationSpec" in the same package,
* or "ActivationSpecImpl" in the same package as the ResourceAdapter class),
@@ -67,7 +67,7 @@ public class DefaultJmsActivationSpecFactory extends StandardJmsActivationSpecFa
/**
* This implementation guesses the ActivationSpec class name from the
* provider's class name: e.g. "ActiveMQResourceAdapter" &rarr;
* provider's class name: for example, "ActiveMQResourceAdapter" &rarr;
* "ActiveMQActivationSpec" in the same package, or a class named
* "ActivationSpecImpl" in the same package as the ResourceAdapter class.
*/
@@ -76,7 +76,7 @@ public class DefaultJmsActivationSpecFactory extends StandardJmsActivationSpecFa
String adapterClassName = adapter.getClass().getName();
if (adapterClassName.endsWith(RESOURCE_ADAPTER_SUFFIX)) {
// e.g. ActiveMQ
// for example, ActiveMQ
String providerName =
adapterClassName.substring(0, adapterClassName.length() - RESOURCE_ADAPTER_SUFFIX.length());
String specClassName = providerName + ACTIVATION_SPEC_SUFFIX;
@@ -91,7 +91,7 @@ public class DefaultJmsActivationSpecFactory extends StandardJmsActivationSpecFa
}
else if (adapterClassName.endsWith(RESOURCE_ADAPTER_IMPL_SUFFIX)){
//e.g. WebSphere
// for example, WebSphere
String providerName =
adapterClassName.substring(0, adapterClassName.length() - RESOURCE_ADAPTER_IMPL_SUFFIX.length());
String specClassName = providerName + ACTIVATION_SPEC_IMPL_SUFFIX;
@@ -105,7 +105,7 @@ public class DefaultJmsActivationSpecFactory extends StandardJmsActivationSpecFa
}
}
// e.g. JORAM
// for example, JORAM
String providerPackage = adapterClassName.substring(0, adapterClassName.lastIndexOf('.') + 1);
String specClassName = providerPackage + ACTIVATION_SPEC_IMPL_SUFFIX;
try {

View File

@@ -230,8 +230,8 @@ public class JmsActivationSpecConfig {
}
/**
* Specify concurrency limits via a "lower-upper" String, e.g. "5-10", or a simple
* upper limit String, e.g. "10".
* Specify concurrency limits via a "lower-upper" String, for example, "5-10", or a simple
* upper limit String, for example, "10".
* <p>JCA listener containers will always scale from zero to the given upper limit.
* A specified lower limit will effectively be ignored.
* <p>This property is primarily supported for configuration compatibility with
@@ -250,7 +250,7 @@ public class JmsActivationSpecConfig {
}
catch (NumberFormatException ex) {
throw new IllegalArgumentException("Invalid concurrency value [" + concurrency + "]: only " +
"single maximum integer (e.g. \"5\") and minimum-maximum combo (e.g. \"3-5\") supported. " +
"single maximum integer (for example, \"5\") and minimum-maximum combo (for example, \"3-5\") supported. " +
"Note that JmsActivationSpecConfig will effectively ignore the minimum value and " +
"scale from zero up to the number of consumers according to the maximum value.");
}

View File

@@ -29,7 +29,7 @@ import org.springframework.util.Assert;
* JMS-specific implementation of the JCA 1.7
* {@link jakarta.resource.spi.endpoint.MessageEndpointFactory} interface,
* providing transaction management capabilities for a JMS listener object
* (e.g. a {@link jakarta.jms.MessageListener} object).
* (for example, a {@link jakarta.jms.MessageListener} object).
*
* <p>Uses a static endpoint implementation, simply wrapping the
* specified message listener object and exposing all of its implemented

View File

@@ -102,9 +102,9 @@ public class JmsMessageEndpointManager extends GenericMessageEndpointManager
* Set the factory for concrete JCA 1.5 ActivationSpec objects,
* creating JCA ActivationSpecs based on
* {@link #setActivationSpecConfig JmsActivationSpecConfig} objects.
* <p>This factory is dependent on the concrete JMS provider, e.g. on ActiveMQ.
* <p>This factory is dependent on the concrete JMS provider, for example, on ActiveMQ.
* The default implementation simply guesses the ActivationSpec class name
* from the provider's class name (e.g. "ActiveMQResourceAdapter" &rarr;
* from the provider's class name (for example, "ActiveMQResourceAdapter" &rarr;
* "ActiveMQActivationSpec" in the same package), and populates the
* ActivationSpec properties as suggested by the JCA 1.5 specification
* (plus a couple of autodetected vendor-specific properties).

View File

@@ -39,7 +39,7 @@ import org.springframework.lang.Nullable;
*
* <p>The 'activationSpecClass' property is required, explicitly defining
* the fully-qualified class name of the provider's ActivationSpec class
* (e.g. "org.apache.activemq.ra.ActiveMQActivationSpec").
* (for example, "org.apache.activemq.ra.ActiveMQActivationSpec").
*
* <p>Check out {@link DefaultJmsActivationSpecFactory} for an extended variant
* of this class, supporting some further default conventions beyond the plain
@@ -64,7 +64,7 @@ public class StandardJmsActivationSpecFactory implements JmsActivationSpecFactor
/**
* Specify the fully-qualified ActivationSpec class name for the target
* provider (e.g. "org.apache.activemq.ra.ActiveMQActivationSpec").
* provider (for example, "org.apache.activemq.ra.ActiveMQActivationSpec").
*/
public void setActivationSpecClass(Class<?> activationSpecClass) {
this.activationSpecClass = activationSpecClass;
@@ -86,7 +86,7 @@ public class StandardJmsActivationSpecFactory implements JmsActivationSpecFactor
* <p>If not specified, destination names will simply be passed in as Strings.
* If specified, destination names will be resolved into Destination objects first.
* <p>Note that a DestinationResolver for use with this factory must be
* able to work <i>without</i> an active JMS Session: e.g.
* able to work <i>without</i> an active JMS Session: for example,
* {@link org.springframework.jms.support.destination.JndiDestinationResolver}
* or {@link org.springframework.jms.support.destination.BeanFactoryDestinationResolver}
* but not {@link org.springframework.jms.support.destination.DynamicDestinationResolver}.
@@ -213,7 +213,7 @@ public class StandardJmsActivationSpecFactory implements JmsActivationSpecFactor
ackMode == Session.DUPS_OK_ACKNOWLEDGE ? "Dups-ok-acknowledge" : "Auto-acknowledge");
}
else if (ackMode == Session.DUPS_OK_ACKNOWLEDGE) {
// Standard JCA 1.5 "acknowledgeMode" apparently not supported (e.g. WebSphere MQ 6.0.2.1)
// Standard JCA 1.5 "acknowledgeMode" apparently not supported (for example, WebSphere MQ 6.0.2.1)
throw new IllegalArgumentException("Dups-ok-acknowledge not supported by underlying provider");
}
}

View File

@@ -22,7 +22,7 @@ import org.springframework.messaging.support.HeaderMapper;
/**
* Strategy interface for mapping {@link org.springframework.messaging.Message}
* headers to an outbound JMS {@link jakarta.jms.Message} (e.g. to configure JMS
* headers to an outbound JMS {@link jakarta.jms.Message} (for example, to configure JMS
* properties) or extracting messaging header values from an inbound JMS Message.
*
* @author Mark Fisher

View File

@@ -28,7 +28,7 @@ public interface JmsHeaders {
/**
* Prefix used for JMS API related headers in order to distinguish from
* user-defined headers and other internal headers (e.g. correlationId).
* user-defined headers and other internal headers (for example, correlationId).
* @see SimpleJmsHeaderMapper
*/
String PREFIX = "jms_";

View File

@@ -32,13 +32,13 @@ import org.springframework.util.StringUtils;
/**
* Simple implementation of {@link JmsHeaderMapper}.
*
* <p>This implementation copies JMS API headers (e.g. JMSReplyTo) to and from
* <p>This implementation copies JMS API headers (for example, JMSReplyTo) to and from
* {@link org.springframework.messaging.Message Messages}. Any user-defined
* properties will also be copied from a JMS Message to a Message, and any
* other headers on a Message (beyond the JMS API headers) will likewise
* be copied to a JMS Message. Those other headers will be copied to the
* general properties of a JMS Message whereas the JMS API headers are passed
* to the appropriate setter methods (e.g. setJMSReplyTo).
* to the appropriate setter methods (for example, setJMSReplyTo).
*
* <p>Constants for the JMS API headers are defined in {@link JmsHeaders}.
* Note that most of the JMS headers are read-only: the JMSDestination,

View File

@@ -304,7 +304,7 @@ public class MappingJackson2MessageConverter implements SmartMessageConverter, B
objectWriter.writeValue(writer, object);
}
else {
// Jackson usually defaults to UTF-8 but can also go straight to bytes, e.g. for Smile.
// Jackson usually defaults to UTF-8 but can also go straight to bytes, for example, for Smile.
// We use a direct byte array argument for the latter case to work as well.
objectWriter.writeValue(bos, object);
}
@@ -445,7 +445,7 @@ public class MappingJackson2MessageConverter implements SmartMessageConverter, B
* typically parsing a type id message property.
* <p>The default implementation parses the configured type id property name
* and consults the configured type id mapping. This can be overridden with
* a different strategy, e.g. doing some heuristics based on message origin.
* a different strategy, for example, doing some heuristics based on message origin.
* @param message the JMS Message from which to get the type id property
* @throws JMSException if thrown by JMS methods
* @see #setTypeIdOnMessage(Object, jakarta.jms.Message)

View File

@@ -132,7 +132,7 @@ public class MessagingMessageConverter implements MessageConverter, Initializing
/**
* Create a JMS message for the specified payload and conversionHint.
* The conversion hint is 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}}.
* @since 4.3
* @see MessageConverter#toMessage(Object, Session)
*/

View File

@@ -36,12 +36,12 @@ public interface SmartMessageConverter extends MessageConverter {
/**
* A variant of {@link #toMessage(Object, Session)} which takes an extra conversion
* context as an argument, allowing to take e.g. annotations on a payload parameter
* context as an argument, allowing to take, for example, annotations on a payload parameter
* into account.
* @param object the object to convert
* @param session the Session to use for creating a JMS Message
* @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 JMS Message
* @throws jakarta.jms.JMSException if thrown by JMS API methods
* @throws MessageConversionException in case of conversion failure

View File

@@ -296,7 +296,7 @@
<xsd:annotation>
<xsd:documentation><![CDATA[
A reference to an external PlatformTransactionManager (typically an
XA-based transaction coordinator, e.g. Spring's JtaTransactionManager).
XA-based transaction coordinator, for example, Spring's JtaTransactionManager).
If not specified, native acknowledging will be used (see "acknowledge" attribute).
]]></xsd:documentation>
<xsd:appinfo>
@@ -310,8 +310,8 @@
<xsd:annotation>
<xsd:documentation><![CDATA[
The number of concurrent sessions/consumers to start for each listener.
Can either be a simple number indicating the maximum number (e.g. "5")
or a range indicating the lower as well as the upper limit (e.g. "3-5").
Can either be a simple number indicating the maximum number (for example, "5")
or a range indicating the lower as well as the upper limit (for example, "3-5").
Note that a specified minimum is just a hint and might be ignored at runtime.
Default is 1; keep concurrency limited to 1 in case of a topic listener
or if message ordering is important; consider raising it for general queues.
@@ -379,7 +379,7 @@
Each listener child element will be hosted by a container whose configuration is
determined by this parent element. This variant builds standard JCA-based listener
containers, operating against a specified JCA ResourceAdapter (which needs to be
provided by the JMS message broker, e.g. ActiveMQ). When a factory-id attribute is
provided by the JMS message broker, for example, ActiveMQ). When a factory-id attribute is
present, the configuration defined by this element is exposed as a bean of type
org.springframework.jms.config.JmsListenerContainerFactory. It is therefore possible
to only define this element without any child to just expose a container factory.
@@ -529,8 +529,8 @@
<xsd:annotation>
<xsd:documentation><![CDATA[
The number of concurrent sessions/consumers to start for each listener.
Can either be a simple number indicating the maximum number (e.g. "5")
or a range indicating the lower as well as the upper limit (e.g. "3-5").
Can either be a simple number indicating the maximum number (for example, "5")
or a range indicating the lower as well as the upper limit (for example, "3-5").
Note that a specified minimum is just a hint and will typically be ignored
at runtime when using a JCA listener container. Default is 1.
]]></xsd:documentation>
@@ -624,8 +624,8 @@
<xsd:annotation>
<xsd:documentation><![CDATA[
The number of concurrent sessions/consumers to start for this listener.
Can either be a simple number indicating the maximum number (e.g. "5")
or a range indicating the lower as well as the upper limit (e.g. "3-5").
Can either be a simple number indicating the maximum number (for example, "5")
or a range indicating the lower as well as the upper limit (for example, "3-5").
Note that a specified minimum is just a hint and might be ignored at runtime.
Default is the value provided by the container.
]]></xsd:documentation>