Add hints for Availability targets

- Annotate ShellComponent with @Reflective and use custom
  AvailabilityReflectiveProcessor to find possible method
  targets returning Availability.
- Backport #747
- Fixes #758
This commit is contained in:
Janne Valkealahti
2023-06-01 21:17:29 +01:00
parent 8e98c183df
commit 08b16d5290
3 changed files with 114 additions and 0 deletions

View File

@@ -22,6 +22,8 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.aot.hint.annotation.Reflective;
import org.springframework.shell.AvailabilityReflectiveProcessor;
import org.springframework.stereotype.Component;
/**
@@ -38,6 +40,7 @@ import org.springframework.stereotype.Component;
@Target(ElementType.TYPE)
@Documented
@Component
@Reflective(AvailabilityReflectiveProcessor.class)
public @interface ShellComponent {
/**