Skip to content

Change default SCL instance, and allow selecting from service loader#10103

Merged
niloc132 merged 9 commits intogwtproject:mainfrom
niloc132:10058-service-loader-test
Jan 1, 2026
Merged

Change default SCL instance, and allow selecting from service loader#10103
niloc132 merged 9 commits intogwtproject:mainfrom
niloc132:10058-service-loader-test

Conversation

@niloc132
Copy link
Member

@niloc132 niloc132 commented Feb 27, 2025

The default is now to ask a service loader for a ServletContainerLauncher if there is a single entry available, and failing that to use the static server - no servlets will be available.

ServletContainerLaunchers registered as a provider for the service loader must provide a name that matches a specific regex. Those names may now also be used when specifying a particular server name rather than the fully qualified class name.

The JettyLauncher will be kept for at least another version to ensure that projects can easily migrate to newer versions.

Fixes #10057
Fixes #10058

The default is now to ask a service loader for a
ServletContainerLauncher if there is a single entry available, and
failing that to use the static server - no servlets will be available.

ServletContainerLaunchers registered as a provider for the service
loader must provide a name that matches a specific regex. Those names
may now also be used when specifying a particular server name rather
than the fully qualified class name.

The JettyLauncher will be kept for at least another version to ensure
that projects can easily migrate to newer versions.

This patch also moves `setBaseRequestLogLevel` to
ServletContainerLauncher so other implementations can use it to log
appropriately based on how they were started.

Fixes gwtproject#10057
@niloc132 niloc132 added this to the 2.13 milestone Feb 27, 2025
@eliasbalasis
Copy link

I am aligned with this approach, particularly in relation to the custom launchers project at https://bitbucket.org/upperlimit-public/gwt-devmode-server of which I am the owner and I will make the relevant adjustments.

@eliasbalasis
Copy link

eliasbalasis commented Feb 27, 2025

Should we allow hyphens as well as underscores in the launcher name ? or perhaps only hyphens ?
What do you think?

@niloc132
Copy link
Member Author

Should we allow hyphens as well as underscores in the launcher name ? or perhaps only hyphens ? What do you think?

Sure - I kept the regex simple, just what things are allowed for 99% of class names. I mostly don't want to encourage named types, which could be referenced from command line, to include characters that need to be escaped when used from the command lie ( , *, etc).

@eliasbalasis
Copy link

Thanks @niloc132 , this makes sense, I will name my launchers accordingly.

@niloc132 niloc132 marked this pull request as ready for review November 22, 2025 20:35
@niloc132 niloc132 requested review from vegegoku and zbynek December 3, 2025 23:45
@niloc132 niloc132 requested review from vegegoku and zbynek December 17, 2025 18:59

@Override
public String[] getTags() {
return new String[] {getTag(), "-launcherDir"};
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can revert this if we don't think it makes sense, but it makes CodeServer and DevMode just a little more alike.

zbynek
zbynek previously approved these changes Dec 18, 2025
Copy link
Collaborator

@zbynek zbynek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving code changes, didn't test.

vegegoku
vegegoku previously approved these changes Dec 21, 2025
@niloc132
Copy link
Member Author

Test sample: https://github.com/niloc132/gwt-devmode-server-sample
Build this repo, and you can add it to any project just by putting the newly built launcher jar on the classpath to swap in Jetty 12.1 support with EE11. Supporting EE8 instead (e.g. javax.servlet) requires changing some code in the launcher and its dependencies (and so should be its own distributed jar) will probably be needed for existing projects that don't intend to update a newer EE in the near future.

@niloc132 niloc132 added the ready This PR has been reviewed by a maintainer and is ready for a CI run. label Dec 27, 2025
@niloc132 niloc132 dismissed stale reviews from zbynek and vegegoku via ae01699 December 29, 2025 12:57
@niloc132
Copy link
Member Author

Added a change to restore samples that require a working server by explicitly setting -server for the legacy JettyLauncher. This should be temporary, removed when #10232 is fixed.

@niloc132 niloc132 requested a review from zbynek December 31, 2025 18:22
@niloc132 niloc132 merged commit e28c671 into gwtproject:main Jan 1, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready This PR has been reviewed by a maintainer and is ready for a CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider service loader for picking up custom implementations Change default dev mode server to static implementation

4 participants