forked from spring-projects/spring-amqp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
spring-projectsGH-1517: added configuration support for multiple Cont…
…ainerCustomizer at once
- Loading branch information
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
...it/src/main/java/org/springframework/amqp/rabbit/config/CompositeContainerCustomizer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.springframework.amqp.rabbit.config; | ||
|
||
import java.util.List; | ||
import org.springframework.amqp.rabbit.listener.MessageListenerContainer; | ||
import org.springframework.util.Assert; | ||
|
||
/** | ||
* Implementation of {@link ContainerCustomizer<C>} providing the configuration of multiple customizers at the same time. | ||
*/ | ||
public class CompositeContainerCustomizer<C extends MessageListenerContainer> implements ContainerCustomizer<C> { | ||
|
||
private final List<ContainerCustomizer<C>> customizers; | ||
|
||
public CompositeContainerCustomizer(List<ContainerCustomizer<C>> customizers) { | ||
Assert.notNull(customizers, "At lease one customizers must be present"); | ||
this.customizers = customizers; | ||
} | ||
|
||
@Override | ||
public void configure(C container) { | ||
customizers.forEach(c -> c.configure(container)); | ||
} | ||
} |