[OpenJDK 2D-Dev] JDK-8153732 would it be possible to extend the PrintServiceLookup with a refresh method?

Patrick Reinhart patrick at reini.net
Wed May 25 21:18:03 UTC 2016


Hi Phil,

> Am 25.05.2016 um 22:28 schrieb Phil Race <philip.race at oracle.com>:
> 
> Possible, but should we ?

I think yes, but it should be clearly documented, that a call to this method can be expensive.

> That is the method that does the refresh once we've received the notification.
> We wanted to avoid applications having to continually call this method every time
> the applications asks for the list because it may be a lengthy operation.

In my opinion, this method should only be called in rare cases in order to force an update. That’s our current way to trigger an update without restarting the VM (using reflection)

> If it were not we probably would have just done that.
> 
> So then the app has to figure out a policy on how often to ask for a refresh
> and this is what we wanted to avoid.

It should state that this method is time consuming and should used with cause.

> And given that the reason to call the method is somewhat environmental
> it might be tricky to explain why and when to call it given that mostly it
> is not necessary.

That is true, on the other hand I see no better way to trigger such an update.

Cheers

Patrick


> -phil.
> 
> 
> 
> On 05/25/2016 12:59 PM, Patrick Reinhart wrote:
>> Hi everyone,
>> 
>> I know you that this issue does not have the highest priority. Even though I would like to work on a possible solution without having to relay exclusively on a OS specific solution. I have looked into the different actual implementations of the PrintServiceLookup and found out that there all having already such a functionality that is called refreshServices().
>> 
>> My question is now: Could this method not me made available as a public API method on the PrintServiceLookup? That would solve my problem in a pretty simple way, that if a remote printer is being changed this method could be called to manually refresh the printers.
>> 
>> What is your opinion about this?
>> 
>> Cheers
>> 
>> Patrick
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20160525/da1118e8/signature.asc>


More information about the 2d-dev mailing list