-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Issue #10437 - Refactor Local Deployment Scanning #12583
base: jetty-12.1.x
Are you sure you want to change the base?
Conversation
...-core/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/ScanningAppProvider.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/ContextProvider.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/ContextProvider.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/ContextProvider.java
Outdated
Show resolved
Hide resolved
...loy/src/test/java/org/eclipse/jetty/deploy/providers/ContextProviderDeferredStartupTest.java
Outdated
Show resolved
Hide resolved
...ploy/src/test/java/org/eclipse/jetty/deploy/providers/ContextProviderRuntimeUpdatesTest.java
Outdated
Show resolved
Hide resolved
...etty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/ContextProviderStartupTest.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/Deployable.java
Outdated
Show resolved
Hide resolved
jetty-ee10/jetty-ee10-webapp/src/main/java/org/eclipse/jetty/ee10/webapp/WebAppContext.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/ContextProvider.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/ContextProvider.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/ContextProvider.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-deploy/src/main/config/etc/jetty-deployment-manager.xml
Outdated
Show resolved
Hide resolved
jetty-core/jetty-deploy/src/main/config/modules/deployment-manager.mod
Outdated
Show resolved
Hide resolved
I'd like to see:
|
jetty-core/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/ContextProvider.java
Outdated
Show resolved
Hide resolved
@joakime @sbordet I've almost convinced myself that we should do the following renames:
I could be convinced to do |
Looking at the current jetty-deploy, we see only the following java files now ...
I can see it just being 4 files ...
|
It still seems the wrong way around that we configure something called a |
It's a separation of concerns.
|
That only works if we lose the interface. We can do that, but then we should do the same with the
So I see Option 1
Option 2
Option 2 is simplest. A user can still extend Deployer and CHF, but they get the standard implementations as their super, because there is no interface. @janbartel @sbordet @joakime thoughts? |
@gregw I'm 90% option 1. With option 1, IIUC, OSGi will be an With option 2, Also, I like that Deployer is an interface, as it can be implemented as a REST call for fancy deployments: you can have a local file scanner that monitors files that, when they change, get uploaded somewhere for the real deployment. |
OK so now I'm 70% option 1 30% option 2. Any other bidders? |
I did the rename to option 1 and did a first pass through the documentation. |
/** | ||
* Attributes that start with this name return a String pointing to XML on the filesystem that should be used for Environment based | ||
* modifications to the ContextHandler that was created. | ||
* | ||
* <pre> | ||
* jetty.deploy.environmentXml=config/base-ee8.xml | ||
* jetty.deploy.environmentXml.auditing=config/auditing-ee8.xml | ||
* </pre> | ||
*/ | ||
String ENVIRONMENT_XML_ATTRIBUTE = "jetty.deploy.environmentXml"; | ||
/** | ||
* Attribute name that stores the {@code List<Path>} pointing to XML files that represent | ||
* the Environment XML files to apply to the ContextHandler has been created. | ||
*/ | ||
String ENVIRONMENT_XML_PATHS_ATTRIBUTE = "jetty.deploy.paths.environmentXmls"; |
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.
Now that we have the environments
directory, is this mechanism still necessary?
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.
The first one can go.
The second one is the result of using the /environments/
directory, so I would like to keep that one.
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.
Actually, the first one can be used to have context specific environment XML.
Not sure the value of that nuanced behavior is.
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.
The second one is almost an internal implementation detail, not to be used by users.
|
||
//ensure a deployer | ||
StandardDeployer deployer = ensureDeployer(server); | ||
deployer.addEventListener(new OSGiDeploymentListener()); |
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.
There's a risk that the deployer might already exist and already have an OSGIDeploymentListener
.
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.
True, have to noodle out a better way for you 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.
Fixed in 2194b55
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 think this is good enough to commit. We can refine we other PRs.
@gregw So, for the other branch where we fix the git history here (like file renames/moves), how about this ... Renames in jetty-core/jetty-deploy
I don't think there's really going to be much else to focus on. |
I've created a new branch called If you pull from origin, you can verify that these branches are the same, content wise, via the command line ... git diff origin/fix/12.1.x/deployer-refactor-rename-fixes...origin/fix/12.1.x/unify-deploy |
Maybe make a new PR from https://github.com/jetty/jetty.project/tree/fix/12.1.x/deployer-refactor-rename-fixes |
Done. I had to create a new branch, as I was unhappy with the result of the older one. |
A single scanner for all Environments.
Environment attributes are how the environment specific deployment configuration is controlled.
Existing properties behaviors maintained.
Moved optional Environment XML resolution from
${jetty.base}/webapps/<env>.xml
to${jetty.base}/environments/<env>.xml
to avoid name collision with deployable XML contexts.