Hi,
I think this is the issue you raised last year in this thread, correct ?
http://mail.openjdk.java.net/pipermail/2d-dev/2016-May/006897.html

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 update.
I've re-read the docs for FindFirstPrinterChangeNotification
at https://msdn.microsoft.com/en-us/library/windows/desktop/dd162722(v=vs.85).aspx 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 :
https://msdn.microsoft.com/en-us/library/cc244870.aspx#Appendix_A_139
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 https://stackoverflow.com/questions/14054935/im-getting-duplicated-print-job-on-windows-7-client-machine-for-shared-printer 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 ?


-phil.

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



Reply via email to