Win32PrintServiceLookup.java revision 0
0N/A * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. Sun designates this 0N/A * particular file as subject to the "Classpath" exception as provided 0N/A * by Sun in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A * have any questions. 0N/A /* The singleton win32 print lookup service. 0N/A * Code that is aware of this field and wants to use it must first 0N/A * see if its null, and if so instantiate it by calling a method such as 0N/A * javax.print.PrintServiceLookup.defaultPrintService() so that the 0N/A * same instance is stored there. 0N/A /* Think carefully before calling this. Preferably don't call it. */ 0N/A /* This call is internally synchronized. 0N/A * When it returns an instance of this class will have 0N/A * been instantiated - else there's a JDK internal error. 0N/A // There's no capability for Win98 to refresh printers. 0N/A // See "OpenPrinter" for more info. 0N/A // start the printer listener thread 0N/A }
/* else condition ought to never happen! */ 0N/A /* Want the PrintService which is default print service to have 0N/A * equality of reference with the equivalent in list of print services 0N/A * This isn't required by the API and there's a risk doing this will 0N/A * lead people to assume its guaranteed. 0N/A // In Windows it is safe to assume no default if printers == null so we 0N/A // don't get the default. 0N/A // Look for deleted services and invalidate these 0N/A /* getPrintServices() is now very fast. */ 0N/A * Special case: If client is asking for a particular printer 0N/A * (by name) then we can save time by getting just that service 0N/A * to check against the rest of the specified attributes. 0N/A * return empty array as don't support multi docs 0N/A // Windows does not have notification for a change in default 0N/A // so we always get the latest. 0N/A // Not the same as default so proceed to get new PrintService. 0N/A // clear defaultPrintService 0N/A // wait for configuration to change