[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-awt-dev
Subject:    <AWT Dev> [11] JDK-8153732: Windows remote printer changes do not reflect in lookupPrintServices()
From:       Shashidhara Veerabhadraiah <shashidhara.veerabhadraiah () oracle ! com>
Date:       2018-06-20 10:12:03
Message-ID: afa12391-489d-4997-b2b8-9925a36cf756 () default
[Download RAW message or body]

Hi All, Please review this code changes for the below enhancement.

 

Enhancement: https://bugs.openjdk.java.net/browse/JDK-8153732

 

Webrev: http://cr.openjdk.java.net/~sveerabhadra/8153732/webrev.00/

 

Details of the changes: Windows provides *PrinterChangeNotification* functions that \
provides information about printer status changes of the local printers(subset) but \
not network printers.  Alternatively, Windows provides a way thro' which one can get \
the network printer status changes by using WMI, RegistryKeyChange combination, which \
is a slightly complex mechanism.  The Windows WMI offers an async and sync method to \
read thro' registry via the WQL query. The async method is considered dangerous as it \
leaves open a channel until we close it. But the async method has the advantage of \
being notified of a change in registry by calling callback without polling for it. \
The sync method uses the polling mechanism to notify.  RegistryValueChange cannot be \
used in combination with WMI to get registry value change notification because of an \
error that may be generated because the scope of the query would be too big to \
handle(at times).  Hence an alternative mechanism is choosen via the EnumPrinters by \
polling for the count of printer status changes(add\remove) and based on it update \
the printers list(both local and remote printers - superset).

 

Thanks and regards,

Shashi


[Attachment #3 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type \
content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 \
(filtered medium)"><style><!-- /* Font Definitions */
@font-face
	{font-family:PMingLiU;
	panose-1:2 1 6 1 0 1 1 1 1 1;}
@font-face
	{font-family:Tunga;
	panose-1:0 0 4 0 0 0 0 0 0 0;}
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:"\@PMingLiU";}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:#0563C1;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:#954F72;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri",sans-serif;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link="#0563C1" \
vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Hi All, Please review this \
code changes for the below enhancement.<o:p></o:p></p><p \
class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Enhancement: <a \
href="https://bugs.openjdk.java.net/browse/JDK-8153732">https://bugs.openjdk.java.net/browse/JDK-8153732</a><o:p></o:p></p><p \
class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Webrev: <a \
href="http://cr.openjdk.java.net/~sveerabhadra/8153732/webrev.00/">http://cr.openjdk.java.net/~sveerabhadra/8153732/webrev.00/</a><o:p></o:p></p><p \
class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Details of the changes: \
Windows provides *PrinterChangeNotification* functions that provides information \
about printer status changes of the local printers(subset) but not network \
printers.&nbsp;<br>Alternatively, Windows provides a way thro' which one can get the \
network printer status changes by using WMI, RegistryKeyChange combination, which is \
a slightly complex mechanism.&nbsp;<br>The Windows WMI offers an async and sync \
method to read thro' registry via the WQL query. The async method is considered \
dangerous as it leaves open a channel until we close it. But the async method has the \
advantage of being notified of a change in registry by calling callback without \
polling for it.&nbsp;The sync method uses the polling mechanism to \
notify.&nbsp;<br>RegistryValueChange cannot be used in combination with WMI to get \
registry value change notification because of an error that may be generated because \
the scope of the query would be too big to handle(at times).&nbsp;<br>Hence an \
alternative mechanism is choosen via the EnumPrinters by polling for the count of \
printer status changes(add\remove) and based on it update the printers list(both \
local and remote printers - superset).<o:p></o:p></p><p \
class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Thanks and \
regards,<o:p></o:p></p><p class=MsoNormal>Shashi<o:p></o:p></p></div></body></html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic