Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor dagger mains for better extensibility #3159

Merged
merged 7 commits into from
Jan 5, 2023

Conversation

devinrsmith
Copy link
Member

@devinrsmith devinrsmith commented Dec 6, 2022

This PR moves JettyMain from server-jetty to server-jetty-app; the main class isn't really meant to be a "library". That said, it's a very few short lines of code for integrators to achieve the same thing that JettyMain does:

public final class MyCustomMain {
    public static void main(String[] args)
            throws IOException, InterruptedException, ClassNotFoundException, TimeoutException {
        final Configuration configuration = MainHelper.init(args, MyCustomMain.class);
        new CommunityComponentFactory()
                .build(configuration)
                .getServer()
                .run()
                .join();
    }
}

This PR also uses the "Community" prefix in more places to hint to integrators that it may or may not be appropriate for "Enterprise" contexts.

This PR also introduces server-jetty-app-custom as an example for how an integrator can customize the structure and configuration of the Deephaven server. It's also useful from the perspective of dogfooding and ensuring DHC developers are aware of any changes that may break integrators.

As part of the above, ComponentFactoryBase has been added as an abstraction around creating Components. While not technically necessary, it's a useful construct that allows constructing components without callers needing to directly invoke dagger.

Out-of-the-box defaults provides common configuration values, but leaves authorization as an explicit choice for the integrator.
@devinrsmith devinrsmith changed the title WIP: Refactor dagger mains for better extensibility Refactor dagger mains for better extensibility Dec 28, 2022
@devinrsmith devinrsmith marked this pull request as ready for review December 28, 2022 20:18
@devinrsmith devinrsmith merged commit a32f0d1 into deephaven:main Jan 5, 2023
@devinrsmith devinrsmith deleted the dagger-main-refactor branch January 5, 2023 18:53
@github-actions github-actions bot locked and limited conversation to collaborators Jan 5, 2023
@deephaven-internal
Copy link
Contributor

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants