Skip to content
Discussion options

You must be logged in to vote

You can use shared state for this: shared state is a special per application stortage for various tricky cases (for components interconnection, to avoid additional static state usage).

During startup it is available with thread local SharedConfigurationState.getStartupInstance() and later values could be accessed with Application or Environment instance: SharedConfigurationState.lookup(application, MyClass.class).

We will need to create a value object to store in shared state (supplier used for case 2, see below):

public static class Collector implements Supplier<Class<? extends MyType>[]> {
        private List<Class<? extends MyType>> extensions = new ArrayList<>();

        public void a…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@JKomoroski
Comment options

Answer selected by JKomoroski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants