8263311: Watch registry changes for remote printers update instead of polling #2915
JDK-8153732 implemented polling for remote printers.
It is possible to replace polling mechanism with registry change notifications. If the registry at
It works perfectly well in my own testing with sharing a Generic / Text Only printer from another laptop. The notification comes as soon as the printer is installed, it results in a new key created under
I updated the steps in the manual test:
The text was updated successfully, but these errors were encountered:
@aivanov-jdk This change now passes all automated pre-integration checks.
After integration, the commit message for the final commit will be:
At the time when this comment was updated there had been 50 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.
@aivanov-jdk can you please check what that old comment was about:
Any idea why RegistryValueChange was rejected as a solution?
I've no idea. I read that comment, it's exactly the comment that was in the code above
It's very vague. I don't know what it really means. Neither do I know if a prototype was even tried.
The article discusses the subject with WMI and WQL. This is what it says:
Note: polling mechanism was not an option. Yet it is what was implemented in Java.
Then the articles describes the steps needed to monitor for printer changes.
Close to the end, there's the quoted sentence:
This statement is a bit confusing. It says they cannot use
I interpret the following statement this way: Registry notifications do not provide information on what changed under
I used this article as the inspiration and the implementation I'm proposing in this PR is purely based on this article. Yet I'm using Windows API function RegNotifyChangeKeyValue to watch for registry updates and to get notified as soon as a change under
@aivanov-jdk Since your change was applied there have been 128 commits pushed to the
Your commit was automatically rebased without conflicts.
Pushed as commit a85dc55.