This file contains hidden or 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
| @Override | |
| public Unit process() { | |
| Set<Method> annotatedMethods = reflections.getMethodsAnnotatedWith(annotationClass); | |
| Set<Field> annotatedFields = reflections.getFieldsAnnotatedWith(annotationClass); | |
| List<DataSet> dataSets = Sets.union(annotatedFields, annotatedMethods).stream() | |
| .map(this::buildDataSet) | |
| .sorted(Comparator.comparing(DataSet::getStaleAt)) | |
| .toList(); | |
| Multimap<Author, StaleDatasetRow> authorToStaleDatasetRows = ArrayListMultimap.create(); |
This file contains hidden or 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
| public class WReflectionsModule extends AbstractModule { | |
| @Override | |
| public void configure() { | |
| bind(Reflections.class).toProvider(WReflectionsProvider.class).in(ImmutableSingleton.class); | |
| } | |
| public static class WReflectionsProvider implements Provider<Reflections> { | |
| private static final Log LOG = getLog(WReflectionsProvider.class); |
This file contains hidden or 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
| @Component( | |
| crons = { | |
| @Cronjob( | |
| query = AlertOnStaleOrExpiredDatasets.class, | |
| conditions = IsLeaderQueryPredicate.class, | |
| triggers = "0 0 9 * * ?") | |
| }, | |
| modules = WReflectionsModule.class, | |
| queries = AlertOnStaleOrExpiredDatasets.class | |
| ) |
This file contains hidden or 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
| public class IraContributionLimitCalculator { | |
| @ValidUntil( | |
| author = "TRADING_PRODUCTS_TEAM", | |
| staleAt = "2025-12-01", | |
| expiredAt = "2026-01-01", | |
| message = "Add IRA contribution limit for 2026" | |
| ) | |
| private static final RangeMap<Year, Money> yearToIraContributionLimit = ImmutableRangeMap.<Year, Money>builder() | |
| .put(atMost(year(2021)), money(6000)) |
This file contains hidden or 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
| @Target({ElementType.FIELD, ElementType.METHOD}) | |
| @Retention(RetentionPolicy.RUNTIME) | |
| public @interface ValidUntil { | |
| String staleAt() default ""; | |
| String expiredAt() default ""; | |
| String author(); |