File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
src/main/java/io/github/stavshamir/springwolf/asyncapi/scanners/channels Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 11package io .github .stavshamir .springwolf .asyncapi .scanners .channels ;
22
33import com .google .common .collect .Maps ;
4+ import io .github .stavshamir .springwolf .asyncapi .scanners .components .ComponentsScanner ;
45import io .github .stavshamir .springwolf .asyncapi .types .channel .Channel ;
56import io .github .stavshamir .springwolf .asyncapi .types .channel .operation .Operation ;
67import io .github .stavshamir .springwolf .asyncapi .types .channel .operation .bindings .OperationBinding ;
2021@ Slf4j
2122public abstract class AbstractChannelScanner <T extends Annotation > implements ChannelsScanner {
2223
24+ @ Autowired
25+ private ComponentsScanner componentsScanner ;
26+
2327 @ Autowired
2428 private SchemasService schemasService ;
2529
2630 @ Override
2731 public Map <String , Channel > scan () {
28- return getClassesToScan ().stream ()
32+ String basePackage = getBasePackage ();
33+
34+ return componentsScanner .scanForComponents (basePackage ).stream ()
2935 .map (this ::getAnnotatedMethods ).flatMap (Collection ::stream )
3036 .map (this ::mapMethodToChannel )
3137 .collect (toMap (Map .Entry ::getKey , Map .Entry ::getValue ));
3238 }
3339
3440 /**
35- * @return The @Component classes to scan for listener annotations.
41+ * @return The base package containing @Component classes with listener annotations.
3642 */
37- protected abstract Set < Class <?>> getClassesToScan ();
43+ protected abstract String getBasePackage ();
3844
3945 /**
4046 * @return The class object of the listener annotation.
You can’t perform that action at this time.
0 commit comments