KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > print > event > PrintJobListener


1 /*
2  * @(#)PrintJobListener.java 1.7 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.print.event;
9
10 /**
11   * Implementations of this listener interface should be attached to a
12   * {@link javax.print.DocPrintJob DocPrintJob} to monitor the status of
13   * the printer job.
14   * These callback methods may be invoked on the thread processing the
15   * print job, or a service created notification thread. In either case
16   * the client should not perform lengthy processing in these callbacks.
17   */

18
19 public interface PrintJobListener {
20
21     /**
22      * Called to notify the client that data has been successfully
23      * transferred to the print service, and the client may free
24      * local resources allocated for that data. The client should
25      * not assume that the data has been completely printed after
26      * receiving this event.
27      * If this event is not received the client should wait for a terminal
28      * event (completed/canceled/failed) before freeing the resources.
29      * @param pje the job generating this event
30      */

31     public void printDataTransferCompleted(PrintJobEvent JavaDoc pje) ;
32     
33     
34     /**
35      * Called to notify the client that the job completed successfully.
36      * @param pje the job generating this event
37      */

38     public void printJobCompleted(PrintJobEvent JavaDoc pje) ;
39     
40     
41     /**
42      * Called to notify the client that the job failed to complete
43      * successfully and will have to be resubmitted.
44      * @param pje the job generating this event
45      */

46     public void printJobFailed(PrintJobEvent JavaDoc pje) ;
47
48     
49     /**
50      * Called to notify the client that the job was canceled
51      * by a user or a program.
52      * @param pje the job generating this event
53      */

54     public void printJobCanceled(PrintJobEvent JavaDoc pje) ;
55     
56     
57     /**
58      * Called to notify the client that no more events will be delivered.
59      * One cause of this event being generated is if the job
60      * has successfully completed, but the printing system
61      * is limited in capability and cannot verify this.
62      * This event is required to be delivered if none of the other
63      * terminal events (completed/failed/canceled) are delivered.
64      * @param pje the job generating this event
65      */

66     public void printJobNoMoreEvents(PrintJobEvent JavaDoc pje) ;
67     
68     
69     /**
70      * Called to notify the client that an error has occurred that the
71      * user might be able to fix. One example of an error that can
72      * generate this event is when the printer runs out of paper.
73      * @param pje the job generating this event
74      */

75     public void printJobRequiresAttention(PrintJobEvent JavaDoc pje) ;
76     
77 }
78
Popular Tags