Polishing
This commit is contained in:
@@ -26,21 +26,20 @@ import java.lang.annotation.Target;
|
||||
import org.springframework.messaging.handler.annotation.MessageMapping;
|
||||
|
||||
/**
|
||||
* Annotation that marks a method to be the target of a JMS message
|
||||
* listener on the specified {@link #destination}. The {@link #containerFactory}
|
||||
* identifies the {@link org.springframework.jms.config.JmsListenerContainerFactory
|
||||
* JmsListenerContainerFactory} to use to build the JMS listener container. If not
|
||||
* set, a <em>default</em> container factory is assumed to be available with a bean
|
||||
* name of {@code jmsListenerContainerFactory} unless an explicit default has been
|
||||
* provided through configuration.
|
||||
* Annotation that marks a method to be the target of a JMS message listener on the
|
||||
* specified {@link #destination}. The {@link #containerFactory} identifies the
|
||||
* {@link org.springframework.jms.config.JmsListenerContainerFactory} to use to build
|
||||
* the JMS listener container. If not set, a <em>default</em> container factory is
|
||||
* assumed to be available with a bean name of {@code jmsListenerContainerFactory}
|
||||
* unless an explicit default has been provided through configuration.
|
||||
*
|
||||
* <p>Processing of {@code @JmsListener} annotations is performed by
|
||||
* registering a {@link JmsListenerAnnotationBeanPostProcessor}. This can be
|
||||
* done manually or, more conveniently, through the {@code <jms:annotation-driven/>}
|
||||
* element or {@link EnableJms @EnableJms} annotation.
|
||||
* <p>Processing of {@code @JmsListener} annotations is performed by registering a
|
||||
* {@link JmsListenerAnnotationBeanPostProcessor}. This can be done manually or,
|
||||
* more conveniently, through the {@code <jms:annotation-driven/>} element or
|
||||
* {@link EnableJms @EnableJms} annotation.
|
||||
*
|
||||
* <p>Annotated methods are allowed to have flexible signatures similar to what
|
||||
* {@link MessageMapping} provides:
|
||||
* <p>Annotated JMS listener methods are allowed to have flexible signatures similar
|
||||
* to what {@link MessageMapping} provides:
|
||||
* <ul>
|
||||
* <li>{@link javax.jms.Session} to get access to the JMS session</li>
|
||||
* <li>{@link javax.jms.Message} or one of its subclasses to get access to the raw JMS message</li>
|
||||
@@ -49,15 +48,15 @@ import org.springframework.messaging.handler.annotation.MessageMapping;
|
||||
* arguments, including support for validation</li>
|
||||
* <li>{@link org.springframework.messaging.handler.annotation.Header @Header}-annotated method
|
||||
* arguments to extract specific header values, including standard JMS headers defined by
|
||||
* {@link org.springframework.jms.support.JmsHeaders JmsHeaders}</li>
|
||||
* {@link org.springframework.jms.support.JmsHeaders}</li>
|
||||
* <li>{@link org.springframework.messaging.handler.annotation.Headers @Headers}-annotated
|
||||
* method argument that must also be assignable to {@link java.util.Map} for obtaining access to all
|
||||
* headers</li>
|
||||
* <li>{@link org.springframework.messaging.MessageHeaders MessageHeaders} arguments for
|
||||
* obtaining access to all headers</li>
|
||||
* <li>{@link org.springframework.messaging.support.MessageHeaderAccessor MessageHeaderAccessor}
|
||||
* or {@link org.springframework.jms.support.JmsMessageHeaderAccessor JmsMessageHeaderAccessor}
|
||||
* for convenient access to all method arguments</li>
|
||||
* method argument that must also be assignable to {@link java.util.Map} for obtaining
|
||||
* access to all headers</li>
|
||||
* <li>{@link org.springframework.messaging.MessageHeaders} arguments for obtaining
|
||||
* access to all headers</li>
|
||||
* <li>{@link org.springframework.messaging.support.MessageHeaderAccessor} or
|
||||
* {@link org.springframework.jms.support.JmsMessageHeaderAccessor} for convenient
|
||||
* access to all method arguments</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>Annotated methods may have a non-{@code void} return type. When they do,
|
||||
@@ -75,9 +74,9 @@ import org.springframework.messaging.handler.annotation.MessageMapping;
|
||||
*/
|
||||
@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@MessageMapping
|
||||
@Documented
|
||||
@Repeatable(JmsListeners.class)
|
||||
@MessageMapping
|
||||
public @interface JmsListener {
|
||||
|
||||
/**
|
||||
@@ -88,7 +87,7 @@ public @interface JmsListener {
|
||||
String id() default "";
|
||||
|
||||
/**
|
||||
* The bean name of the {@link org.springframework.jms.config.JmsListenerContainerFactory JmsListenerContainerFactory}
|
||||
* The bean name of the {@link org.springframework.jms.config.JmsListenerContainerFactory}
|
||||
* to use to create the message listener container responsible for serving this endpoint.
|
||||
* <p>If not specified, the default container factory is used, if any.
|
||||
*/
|
||||
@@ -96,8 +95,7 @@ public @interface JmsListener {
|
||||
|
||||
/**
|
||||
* The destination name for this listener, resolved through the container-wide
|
||||
* {@link org.springframework.jms.support.destination.DestinationResolver DestinationResolver}
|
||||
* strategy.
|
||||
* {@link org.springframework.jms.support.destination.DestinationResolver} strategy.
|
||||
*/
|
||||
String destination();
|
||||
|
||||
|
||||
@@ -54,8 +54,8 @@ import org.springframework.util.StringUtils;
|
||||
/**
|
||||
* Bean post-processor that registers methods annotated with {@link JmsListener}
|
||||
* to be invoked by a JMS message listener container created under the cover
|
||||
* by a {@link org.springframework.jms.config.JmsListenerContainerFactory} according
|
||||
* to the parameters of the annotation.
|
||||
* by a {@link org.springframework.jms.config.JmsListenerContainerFactory}
|
||||
* according to the attributes of the annotation.
|
||||
*
|
||||
* <p>Annotated methods can use flexible arguments as defined by {@link JmsListener}.
|
||||
*
|
||||
@@ -63,10 +63,10 @@ import org.springframework.util.StringUtils;
|
||||
* {@code <jms:annotation-driven>} XML element, and also by the {@link EnableJms}
|
||||
* annotation.
|
||||
*
|
||||
* <p>Auto-detect any {@link JmsListenerConfigurer} instances in the container,
|
||||
* <p>Autodetects any {@link JmsListenerConfigurer} instances in the container,
|
||||
* allowing for customization of the registry to be used, the default container
|
||||
* factory or for fine-grained control over endpoints registration. See
|
||||
* {@link EnableJms} Javadoc for complete usage details.
|
||||
* factory or for fine-grained control over endpoints registration. See the
|
||||
* {@link EnableJms} javadocs for complete usage details.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
* @author Juergen Hoeller
|
||||
@@ -282,7 +282,7 @@ public class JmsListenerAnnotationBeanPostProcessor
|
||||
return resolve(jmsListener.id());
|
||||
}
|
||||
else {
|
||||
return "org.springframework.jms.JmsListenerEndpointContainer#" + counter.getAndIncrement();
|
||||
return "org.springframework.jms.JmsListenerEndpointContainer#" + this.counter.getAndIncrement();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user