CancelablePrintJob.java revision 0
2362N/A * Copyright 2001 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 2362N/A * published by the Free Software Foundation. Sun designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/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. 2362N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 2362N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A * This interface is used by a printing application to cancel a 0N/A * print job. This interface extends {@link DocPrintJob}. A 0N/A * <code>DocPrintJob</code> implementation returned from a print 0N/A * service implements this interface if the print job can be 0N/A * cancelled. Before trying to cancel 0N/A * a print job, the client needs to test if the 0N/A * <code>DocPrintJob</code> object returned from the print service 0N/A * actually implements this interface. Clients should never assume 0N/A * that a <code>DocPrintJob</code> implements this interface. A 0N/A * print service might support cancellation only for certain types 0N/A * of print data and representation class names. This means that 0N/A * only some of the <code>DocPrintJob</code> objects returned from 0N/A * a service will implement this interface. 0N/A * Service implementors are encouraged to implement this optional interface 0N/A * and to deliver a javax.print.event.PrintJobEvent.JOB_CANCELLED event 0N/A * to any listeners if a job is successfully cancelled with an 0N/A * implementation of this interface. Services should also note that an 0N/A * implementation of this method may be made from a separate client thread 0N/A * than that which made the print request. Thus the implementation of 0N/A * this interface must be made thread safe. 0N/A * Stops further processing of a print job. 0N/A * If a service supports this method it cannot be concluded that 0N/A * job cancellation will always suceeed. A job may not be able to be 0N/A * cancelled once it has reached and passed some point in its processing. 0N/A * A successful cancellation means only that the entire job was not 0N/A * printed, some portion may already have printed when cancel returns. 0N/A * The service will throw a PrintException if the cancellation did not 0N/A * succeed. A job which has not yet been submitted for printing should 0N/A * throw this exception. 0N/A * Cancelling an already successfully cancelled Print Job is not 0N/A * considered an error and will always succeed. 0N/A * Cancellation in some services may be a lengthy process, involving 0N/A * requests to a server and processing of its print queue. Clients 0N/A * may wish to execute cancel in a thread which does not affect 0N/A * application execution. 0N/A * @throws PrintException if the job could not be successfully cancelled.