-
- All Superinterfaces:
- DocPrintJob
public interface CancelablePrintJob extends DocPrintJob
This interface is used by a printing application to cancel a print job. This interface extendsDocPrintJob
. ADocPrintJob
implementation returned from a print service implements this interface if the print job can be cancelled. Before trying to cancel a print job, the client needs to test if theDocPrintJob
object returned from the print service actually implements this interface. Clients should never assume that aDocPrintJob
implements this interface. A print service might support cancellation only for certain types of print data and representation class names. This means that only some of theDocPrintJob
objects returned from a service will implement this interface.Service implementors are encouraged to implement this optional interface and to deliver a javax.print.event.PrintJobEvent.JOB_CANCELLED event to any listeners if a job is successfully cancelled with an implementation of this interface. Services should also note that an implementation of this method may be made from a separate client thread than that which made the print request. Thus the implementation of this interface must be made thread safe.
-
-
Method Summary
Methods Modifier and Type Method and Description void
cancel()
Stops further processing of a print job.-
Methods inherited from interface javax.print.DocPrintJob
addPrintJobAttributeListener, addPrintJobListener, getAttributes, getPrintService, print, removePrintJobAttributeListener, removePrintJobListener
-
-
-
-
Method Detail
-
cancel
void cancel() throws PrintException
Stops further processing of a print job.If a service supports this method it cannot be concluded that job cancellation will always suceeed. A job may not be able to be cancelled once it has reached and passed some point in its processing. A successful cancellation means only that the entire job was not printed, some portion may already have printed when cancel returns.
The service will throw a PrintException if the cancellation did not succeed. A job which has not yet been submitted for printing should throw this exception. Cancelling an already successfully cancelled Print Job is not considered an error and will always succeed.
Cancellation in some services may be a lengthy process, involving requests to a server and processing of its print queue. Clients may wish to execute cancel in a thread which does not affect application execution.
- Throws:
PrintException
- if the job could not be successfully cancelled.
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
17/11/2024 17:24:45 Cette version de la page est en cache (à la date du 17/11/2024 17:24:45) afin d'accélérer le traitement. Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la dernère version de la page.Document créé le 31/08/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-javax/print/cancelableprintjob.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.