File tree 1 file changed +9
-3
lines changed
src/main/java/io/github/stavshamir/springwolf/asyncapi/scanners/channels
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1
1
package io .github .stavshamir .springwolf .asyncapi .scanners .channels ;
2
2
3
3
import com .google .common .collect .Maps ;
4
+ import io .github .stavshamir .springwolf .asyncapi .scanners .components .ComponentsScanner ;
4
5
import io .github .stavshamir .springwolf .asyncapi .types .channel .Channel ;
5
6
import io .github .stavshamir .springwolf .asyncapi .types .channel .operation .Operation ;
6
7
import io .github .stavshamir .springwolf .asyncapi .types .channel .operation .bindings .OperationBinding ;
20
21
@ Slf4j
21
22
public abstract class AbstractChannelScanner <T extends Annotation > implements ChannelsScanner {
22
23
24
+ @ Autowired
25
+ private ComponentsScanner componentsScanner ;
26
+
23
27
@ Autowired
24
28
private SchemasService schemasService ;
25
29
26
30
@ Override
27
31
public Map <String , Channel > scan () {
28
- return getClassesToScan ().stream ()
32
+ String basePackage = getBasePackage ();
33
+
34
+ return componentsScanner .scanForComponents (basePackage ).stream ()
29
35
.map (this ::getAnnotatedMethods ).flatMap (Collection ::stream )
30
36
.map (this ::mapMethodToChannel )
31
37
.collect (toMap (Map .Entry ::getKey , Map .Entry ::getValue ));
32
38
}
33
39
34
40
/**
35
- * @return The @Component classes to scan for listener annotations.
41
+ * @return The base package containing @Component classes with listener annotations.
36
42
*/
37
- protected abstract Set < Class <?>> getClassesToScan ();
43
+ protected abstract String getBasePackage ();
38
44
39
45
/**
40
46
* @return The class object of the listener annotation.
You can’t perform that action at this time.
0 commit comments