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
JAMES-2886 Allow to load extensions in WebAdmin #2701
Conversation
.../protocols/webadmin/webadmin-core/src/test/java/org/apache/james/webadmin/WebAdminUtils.java
Outdated
Show resolved
Hide resolved
d98291d
to
2548fc9
Compare
Could you please provide the documentation of how you use this feature? |
test this please |
Thank you for the update on the webadmin configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, thanks!
...e/protocols/webadmin/src/main/java/org/apache/james/modules/server/WebAdminServerModule.java
Outdated
Show resolved
Hide resolved
dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/conf/webadmin.properties
Show resolved
Hide resolved
We demonstrate: - A previously defined route can not be overwritten - That public routes are applied after private routes, thus if a private route is already defined, the public route is ignored.
Note that route injection was revisited on this occasion: - Make WebAdmin server responsible of private/public triage. This avoids errors like the one with SwaggerRoutes where the developer forgets to declare his route as public upon injections. This also factorize the code between code & test (as a user might want to define custom public routes as well)
ba6703c
to
4e55cdc
Compare
Your extension class-loader will be the modified one (James and extensions-jars content) but James class-loader | ||
stays unmodified everywhere else.</p> | ||
|
||
<p>Once done, you need to explicitly require James to load your extensions. This needs to be done in the following |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we use an SPI for that? (https://docs.oracle.com/javase/tutorial/sound/SPI-intro.html)
It's the standard way of implementing extensions so why would we create a custom solution for that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does SPI interacts with injection system?
Do you want the users extensions to fully rely on SPI for their dependency resolution?
I would consider this being a burdon...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SPI is just a way to declare extension points so that people can put an extension on the classpath an get it loaded.
AFAIK, it doesn't mean that you can't use @Inject or any other DI system.
What it does mean is:
- we define clearly with a standard how to extend James
- we rely on a standard jar META-INF to declare extensions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got with your link how as an extension writer I can declare the Services I implement,
I did not get how as an extension user how I select the Services implementations I want to use....
What if a Jat contains listenerA & listenerB & I only want listenerA?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should be in two different files then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unless your jar parse some configuration by itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also does this mean a breaking change for already provided extensions (mailboxListeners?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
Merged |
Next step of #2699 , this work enables one to add new custom routes within the
WebAdmin
protocol from theextensions-jars
folder.The example of the ApacheCon preparation can then be handled as completly indepandantly source code.