diff --git a/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/config/AzureBootstrapConfiguration.java b/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/config/AzureBootstrapConfiguration.java index 7445494ed9a40..1f5e4dbd20f6c 100644 --- a/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/config/AzureBootstrapConfiguration.java +++ b/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/config/AzureBootstrapConfiguration.java @@ -27,12 +27,20 @@ @Role(BeanDefinition.ROLE_INFRASTRUCTURE) public class AzureBootstrapConfiguration { + /** + * Bean for the {@link AzureListenerAnnotationBeanPostProcessor}. + * @return the bean post processor bean. + */ @Role(BeanDefinition.ROLE_INFRASTRUCTURE) @Bean public AzureListenerAnnotationBeanPostProcessor azureListenerAnnotationProcessor() { return new AzureListenerAnnotationBeanPostProcessor(); } + /** + * Bean for the {@link AzureListenerEndpointRegistry}. + * @return the listener endpoint registry bean. + */ @Bean(name = AzureListenerAnnotationBeanPostProcessor.DEFAULT_AZURE_LISTENER_ENDPOINT_REGISTRY_BEAN_NAME) public AzureListenerEndpointRegistry azureListenerEndpointRegistry() { return new AzureListenerEndpointRegistry(); diff --git a/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/config/AzureListenerAnnotationBeanPostProcessor.java b/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/config/AzureListenerAnnotationBeanPostProcessor.java index 2e00d7ac1dfbc..e0e27380f0524 100644 --- a/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/config/AzureListenerAnnotationBeanPostProcessor.java +++ b/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/config/AzureListenerAnnotationBeanPostProcessor.java @@ -91,6 +91,10 @@ public class AzureListenerAnnotationBeanPostProcessor @Nullable private StringValueResolver embeddedValueResolver; + /** + * Set the container factory bean name. + * @param containerFactoryBeanName the container factory bean name. + */ public void setContainerFactoryBeanName(String containerFactoryBeanName) { this.containerFactoryBeanName = containerFactoryBeanName; } diff --git a/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/config/AzureListenerEndpointRegistrar.java b/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/config/AzureListenerEndpointRegistrar.java index e336af2fb8d74..d29e1cc8c2b65 100644 --- a/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/config/AzureListenerEndpointRegistrar.java +++ b/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/config/AzureListenerEndpointRegistrar.java @@ -53,6 +53,9 @@ public void afterPropertiesSet() { registerAllEndpoints(); } + /** + * Register all {@link AzureListenerEndpoint}s under the registrar to create the associated containers. + */ protected void registerAllEndpoints() { Assert.state(this.endpointRegistry != null, "No AzureListenerEndpointRegistry set"); synchronized (this.mutex) { @@ -120,26 +123,50 @@ public void registerEndpoint(AzureListenerEndpoint endpoint) { registerEndpoint(endpoint, null); } + /** + * Set the bean name of the container factory. + * @param containerFactoryBeanName the bean name of the container factory. + */ public void setContainerFactoryBeanName(String containerFactoryBeanName) { this.containerFactoryBeanName = containerFactoryBeanName; } + /** + * Get the {@link AzureListenerEndpointRegistry}. + * @return the {@link AzureListenerEndpointRegistry}. + */ public AzureListenerEndpointRegistry getEndpointRegistry() { return this.endpointRegistry; } + /** + * Set the {@link AzureListenerEndpointRegistry}. + * @param endpointRegistry the {@link AzureListenerEndpointRegistry}. + */ public void setEndpointRegistry(AzureListenerEndpointRegistry endpointRegistry) { this.endpointRegistry = endpointRegistry; } + /** + * Get the {@link MessageHandlerMethodFactory}. + * @return the {@link MessageHandlerMethodFactory}. + */ public MessageHandlerMethodFactory getMessageHandlerMethodFactory() { return this.messageHandlerMethodFactory; } + /** + * Set the {@link MessageHandlerMethodFactory}. + * @param messageHandlerMethodFactory the {@link MessageHandlerMethodFactory}. + */ public void setMessageHandlerMethodFactory(MessageHandlerMethodFactory messageHandlerMethodFactory) { this.messageHandlerMethodFactory = messageHandlerMethodFactory; } + /** + * Set the {@link ListenerContainerFactory}. + * @param containerFactory the {@link ListenerContainerFactory}. + */ public void setContainerFactory(ListenerContainerFactory containerFactory) { this.containerFactory = containerFactory; } diff --git a/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/config/AzureMessagingConfiguration.java b/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/config/AzureMessagingConfiguration.java index f5f22c2d79253..d75d1c9d2eaca 100644 --- a/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/config/AzureMessagingConfiguration.java +++ b/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/config/AzureMessagingConfiguration.java @@ -17,6 +17,11 @@ @Configuration public class AzureMessagingConfiguration { + /** + * Bean for the {@link ListenerContainerFactory}. + * @param subscribeByGroupOperation the {@link SubscribeByGroupOperation}. + * @return the {@link ListenerContainerFactory} bean. + */ @ConditionalOnMissingBean @Bean(name = AzureListenerAnnotationBeanPostProcessor.DEFAULT_AZURE_LISTENER_CONTAINER_FACTORY_BEAN_NAME) public ListenerContainerFactory azureListenerContainerFactory( diff --git a/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/container/DefaultAzureListenerContainerFactory.java b/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/container/DefaultAzureListenerContainerFactory.java index 173f163755089..e1b18edfd8b1c 100644 --- a/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/container/DefaultAzureListenerContainerFactory.java +++ b/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/container/DefaultAzureListenerContainerFactory.java @@ -14,6 +14,10 @@ public class DefaultAzureListenerContainerFactory extends AbstractAzureListenerContainerFactory { + /** + * Construct the listener container factory with the {@link SubscribeByGroupOperation}. + * @param subscribeOperation the {@link SubscribeByGroupOperation}. + */ public DefaultAzureListenerContainerFactory(SubscribeByGroupOperation subscribeOperation) { super(subscribeOperation); } diff --git a/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/endpoint/AbstractAzureListenerEndpoint.java b/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/endpoint/AbstractAzureListenerEndpoint.java index c708e7210c429..4daa76f895c5b 100644 --- a/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/endpoint/AbstractAzureListenerEndpoint.java +++ b/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/endpoint/AbstractAzureListenerEndpoint.java @@ -63,18 +63,34 @@ public String toString() { return getEndpointDescription().toString(); } + /** + * Get the destination. + * @return the destination. + */ public String getDestination() { return destination; } + /** + * Set the destination. + * @param destination the destination. + */ public void setDestination(String destination) { this.destination = destination; } + /** + * Get the group for the corresponding listener container. + * @return the group for the corresponding listener container. + */ public String getGroup() { return group; } + /** + * Set the group for the corresponding listener container. + * @param group the group for the corresponding listener container. + */ public void setGroup(String group) { this.group = group; } @@ -84,14 +100,26 @@ public String getId() { return id; } + /** + * Set the id of this endpoint. + * @param id the id of this endpoint. + */ public void setId(String id) { this.id = id; } + /** + * Set the concurrency expression. + * @param concurrency the concurrency expression. + */ public void setConcurrency(String concurrency) { this.concurrency = concurrency; } + /** + * Get the concurrency expression. + * @return the concurrency expression. + */ public String getConcurrency() { return concurrency; } diff --git a/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/endpoint/MethodAzureListenerEndpoint.java b/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/endpoint/MethodAzureListenerEndpoint.java index 39c277169b5bf..8881eda2d5c35 100644 --- a/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/endpoint/MethodAzureListenerEndpoint.java +++ b/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/endpoint/MethodAzureListenerEndpoint.java @@ -66,22 +66,44 @@ protected StringBuilder getEndpointDescription() { .append(this.method).append("'"); } + /** + * Get the object instance that should manage this endpoint. + * @return the target bean instance. + */ public Object getBean() { return bean; } + /** + * Set the object instance that should manage this endpoint. + * @param bean the target bean instance. + */ public void setBean(Object bean) { this.bean = bean; } + /** + * Get the method to invoke to process a message managed by this endpoint. + * @return the method to invoke to process a message managed by this endpoint. + */ public Method getMethod() { return method; } + /** + * Set the method to invoke to process a message managed by this endpoint. + * @param method the target method for the {@link #bean}. + */ public void setMethod(Method method) { this.method = method; } + /** + * Set the {@link MessageHandlerMethodFactory} to use to build the + * {@link InvocableHandlerMethod} responsible to manage the invocation + * of this endpoint. + * @param messageHandlerMethodFactory the {@link MessageHandlerMethodFactory} instance. + */ public void setMessageHandlerMethodFactory(MessageHandlerMethodFactory messageHandlerMethodFactory) { this.messageHandlerMethodFactory = messageHandlerMethodFactory; } diff --git a/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/endpoint/SimpleAzureListenerEndpoint.java b/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/endpoint/SimpleAzureListenerEndpoint.java index c1c18a40a0d6f..d58fb71cfe89f 100644 --- a/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/endpoint/SimpleAzureListenerEndpoint.java +++ b/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/endpoint/SimpleAzureListenerEndpoint.java @@ -23,10 +23,18 @@ protected AzureMessageHandler createMessageHandler(MessageListenerContainer cont return this.azureMessageHandler; } + /** + * Get the message handler. + * @return the message handler. + */ public AzureMessageHandler getAzureMessageHandler() { return azureMessageHandler; } + /** + * Set the message handler. + * @param azureMessageHandler the message handler. + */ public void setAzureMessageHandler(AzureMessageHandler azureMessageHandler) { this.azureMessageHandler = azureMessageHandler; } diff --git a/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/listener/DefaultAzureMessageHandler.java b/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/listener/DefaultAzureMessageHandler.java index 4e304263f45f1..e61dbe8182c90 100644 --- a/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/listener/DefaultAzureMessageHandler.java +++ b/sdk/spring/azure-spring-cloud-messaging/src/main/java/com/azure/spring/messaging/listener/DefaultAzureMessageHandler.java @@ -53,6 +53,10 @@ private Class resolveMessagePayloadType(InvocableHandlerMethod method) { return parameterTypes[0]; } + /** + * Get the handler method. + * @return the handler method. + */ public InvocableHandlerMethod getHandlerMethod() { return handlerMethod; } diff --git a/sdk/spring/azure-spring-cloud-stream-binder-test/src/main/java/com/azure/spring/servicebus/stream/binder/test/AzurePartitionBinderTests.java b/sdk/spring/azure-spring-cloud-stream-binder-test/src/main/java/com/azure/spring/servicebus/stream/binder/test/AzurePartitionBinderTests.java index 97a0e34c75d10..b13cb508604ad 100644 --- a/sdk/spring/azure-spring-cloud-stream-binder-test/src/main/java/com/azure/spring/servicebus/stream/binder/test/AzurePartitionBinderTests.java +++ b/sdk/spring/azure-spring-cloud-stream-binder-test/src/main/java/com/azure/spring/servicebus/stream/binder/test/AzurePartitionBinderTests.java @@ -39,6 +39,9 @@ public abstract class AzurePartitionBinderTests extends PartitionCapableBinderTests { + /** + * Execute necessary operations to enable tests. + */ @BeforeAll public static void enableTests() { }