[OpenJDK 2D-Dev] JDK-8153732 Add refresh prossibility for known printers

Philip Race philip.race at oracle.com
Sat Oct 28 19:01:06 UTC 2017

I think this is the issue you raised last year in this thread, correct ?

And the problem is that even though we use the Windows APIs to be 
notified of a change
in printers, for whatever reason (did we discuss the reasons ?, I don't 
see a reference but
I think we must have .. ) it is not informing us of changes of remote 
printers, only local ones.

So you would like an API that will refresh the list without any 
knowledge of whether it
is actually needed .. but you (somehow) will decide what is a reasonable 
policy for that.
But it would seem better if possible for Windows to tell us about the 
I've re-read the docs for FindFirstPrinterChangeNotification
and I wonder if we just need to include : PRINTER_CHANGE_SERVER in the 
bitfield ?
The docs there say it is Windows 7 .. and I see a list of unsupported 
versions here :
which includes WIndows Server 2008 .. but perhaps anything later than 
that will be fine.

However the docs are very light on explaining what this bit actually means !
So I am kind of just hoping/guessing here.

What I see at 
suggests it might even be triggered for a Print Job arriving at the 
server which is NOT what
we'd want to hear about.

So can you add anything about your config etc and remind me if you filed 
a bug/rfe on this ?


On 10/28/17, 3:59 AM, Patrick Reinhart wrote:
> Hi everybody,
> Now that the JDK 9 is out and the access for printing internal classes
> will go away, our currently used work around to refresh the printers
> known to the system will be no longer working.
> In our case a reboot of our server is very difficult due the fact that
> our customers work 24x7. So we would need to attach/detach printers
> during a running system. The windows server, where we run our software
> has those printers attached as network printers and such a change is not
> recognised buy the current printing API.
> It would be preferable to somehow signal that an printer change has been
> taken place and the known printers to the system has to be refreshed on
> the PrintServiceLookup class.
> I know, that there are at least two questions around that:
> How to handle an method call, that take a long time to complete?
> - A possible way would be to pass some reference to an Executor for the
> action being run within
> What should be done in order such a method is invoked too many times?
> - As this method is not be needed to be called a lot, I do not think
> that this should be a problem. But if it would be done via an given
> Executor, the caller would be responsible to execute
> Cheers
> Patrick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20171028/2a93adad/attachment.html>

More information about the 2d-dev mailing list