-
Couldn't load subscription status.
- Fork 25.6k
Initialization class as argument to EntitlementAgent #127815
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -138,7 +138,7 @@ private static void loadAgent(String agentPath) { | |
| try { | ||
| VirtualMachine vm = VirtualMachine.attach(Long.toString(ProcessHandle.current().pid())); | ||
| try { | ||
| vm.loadAgent(agentPath); | ||
| vm.loadAgent(agentPath, EntitlementInitialization.class.getName()); | ||
| } finally { | ||
| vm.detach(); | ||
| } | ||
|
|
@@ -154,7 +154,7 @@ private static void exportInitializationToAgent() { | |
| EntitlementInitialization.class.getModule().addExports(initPkg, unnamedModule); | ||
| } | ||
|
|
||
| private static String findAgentJar() { | ||
| public static String findAgentJar() { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure why this became public, but I presume that will become clear in an upcoming PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can be package private, right? The TestEntitlementBootstrap can be in the same entitlement bootstrap package (split packages are ok when using the classpath) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes sorry this change slipped in (see the linked PR). |
||
| String propertyName = "es.entitlement.agentJar"; | ||
| String propertyValue = System.getProperty(propertyName); | ||
| if (propertyValue != null) { | ||
|
|
||
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.
Making the arguments just be the name of the class, rather than some kind of option flags, doesn't allow much evolution in the future, but then, we are in control of all of this code and change it in the future if need be, just like we did this time, so it doesn't actually matter much.
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 had exactly the same conversation in my head :D wondering if I should do that, and thinking we can change this any time anyway, so I decided to let it like this for now. Unless you or someone else feels strongly about this.