diff --git a/spring-pulsar/src/main/java/org/springframework/pulsar/config/ListenerEndpointRegistry.java b/spring-pulsar/src/main/java/org/springframework/pulsar/config/ListenerEndpointRegistry.java index bbd399f7..16743c59 100644 --- a/spring-pulsar/src/main/java/org/springframework/pulsar/config/ListenerEndpointRegistry.java +++ b/spring-pulsar/src/main/java/org/springframework/pulsar/config/ListenerEndpointRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 the original author or authors. + * Copyright 2022-2023 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. @@ -36,8 +36,8 @@ import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.SmartLifecycle; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.lang.Nullable; -import org.springframework.pulsar.listener.ListenerContainerRegistry; import org.springframework.pulsar.listener.MessageListenerContainer; +import org.springframework.pulsar.listener.PulsarListenerContainerRegistry; import org.springframework.util.Assert; /** @@ -59,7 +59,7 @@ import org.springframework.util.Assert; * @author Christophe Bornet */ public class ListenerEndpointRegistry> - implements ListenerContainerRegistry, DisposableBean, SmartLifecycle, ApplicationContextAware, + implements PulsarListenerContainerRegistry, DisposableBean, SmartLifecycle, ApplicationContextAware, ApplicationListener { private final Class type; diff --git a/spring-pulsar/src/main/java/org/springframework/pulsar/listener/ListenerContainerRegistry.java b/spring-pulsar/src/main/java/org/springframework/pulsar/listener/ListenerContainerRegistry.java deleted file mode 100644 index 5bc0825f..00000000 --- a/spring-pulsar/src/main/java/org/springframework/pulsar/listener/ListenerContainerRegistry.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 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. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.pulsar.listener; - -import java.util.Collection; -import java.util.Set; - -import org.springframework.lang.Nullable; -import org.springframework.pulsar.config.ListenerEndpoint; - -/** - * A registry for containers. - * - * @author Christophe Bornet - */ -public interface ListenerContainerRegistry { - - /** - * Return the listener container with the specified id or {@code null} if no such - * container exists. - * @param id the id of the container - * @return the container or {@code null} if no container with that id exists - * @see ListenerEndpoint#getId() - * @see #getListenerContainerIds() - */ - @Nullable - MessageListenerContainer getListenerContainer(String id); - - /** - * Return the ids of the managed listener container instance(s). - * @return the ids. - * @see #getListenerContainer(String) - */ - Set getListenerContainerIds(); - - /** - * Return the managed listener container instance(s). - * @return the managed listener container instance(s). - * @see #getAllListenerContainers() - */ - Collection getListenerContainers(); - - /** - * Return all listener container instances including those managed by this registry - * and those declared as beans in the application context. Prototype-scoped containers - * will be included. Lazy beans that have not yet been created will not be initialized - * by a call to this method. - * @return the listener container instance(s). - * @see #getListenerContainers() - */ - Collection getAllListenerContainers(); - -} diff --git a/spring-pulsar/src/main/java/org/springframework/pulsar/listener/PulsarListenerContainerRegistry.java b/spring-pulsar/src/main/java/org/springframework/pulsar/listener/PulsarListenerContainerRegistry.java index 9891eb7d..d35121ca 100644 --- a/spring-pulsar/src/main/java/org/springframework/pulsar/listener/PulsarListenerContainerRegistry.java +++ b/spring-pulsar/src/main/java/org/springframework/pulsar/listener/PulsarListenerContainerRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 the original author or authors. + * Copyright 2022-2023 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. @@ -20,21 +20,49 @@ import java.util.Collection; import java.util.Set; import org.springframework.lang.Nullable; +import org.springframework.pulsar.config.ListenerEndpoint; /** - * A registry for listener containers. + * A registry for containers. * + * @author Christophe Bornet * @author Soby Chacko */ public interface PulsarListenerContainerRegistry { + /** + * Return the listener container with the specified id or {@code null} if no such + * container exists. + * @param id the id of the container + * @return the container or {@code null} if no container with that id exists + * @see ListenerEndpoint#getId() + * @see #getListenerContainerIds() + */ @Nullable - PulsarMessageListenerContainer getListenerContainer(String id); + MessageListenerContainer getListenerContainer(String id); + /** + * Return the ids of the managed listener container instance(s). + * @return the ids. + * @see #getListenerContainer(String) + */ Set getListenerContainerIds(); - Collection getListenerContainers(); + /** + * Return the managed listener container instance(s). + * @return the managed listener container instance(s). + * @see #getAllListenerContainers() + */ + Collection getListenerContainers(); - Collection getAllListenerContainers(); + /** + * Return all listener container instances including those managed by this registry + * and those declared as beans in the application context. Prototype-scoped containers + * will be included. Lazy beans that have not yet been created will not be initialized + * by a call to this method. + * @return the listener container instance(s). + * @see #getListenerContainers() + */ + Collection getAllListenerContainers(); }