APIdia Launch Partner
Top Inners Fields Constructors Methods
sun.print

public final Class UnixPrintJob

extends Object
implements CancelablePrintJob
Class Inheritance
All Implemented Interfaces
javax.print.CancelablePrintJob, javax.print.DocPrintJob
Imports
java.net.URI, .URL, java.io.BufferedInputStream, .BufferedOutputStream, .BufferedReader, .BufferedWriter, .File, .FileOutputStream, .InputStream, .InputStreamReader, .OutputStream, .OutputStreamWriter, .IOException, .PrintWriter, .Reader, .StringWriter, java.nio.file.Files, java.util.ArrayList, javax.print.CancelablePrintJob, .Doc, .DocFlavor, .PrintService, .PrintException, javax.print.event.PrintJobEvent, .PrintJobListener, .PrintJobAttributeListener, javax.print.attribute.Attribute, .AttributeSetUtilities, .DocAttributeSet, .HashPrintJobAttributeSet, .HashPrintRequestAttributeSet, .PrintJobAttribute, .PrintJobAttributeSet, .PrintRequestAttribute, .PrintRequestAttributeSet, javax.print.attribute.standard.Copies, .Destination, .DocumentName, .Fidelity, .JobName, .JobOriginatingUserName, .JobSheets, .Media, .MediaSize, .MediaSizeName, .OrientationRequested, .RequestingUserName, .NumberUp, .Sides, .PrinterIsAcceptingJobs, java.awt.print.PageFormat, .PrinterJob, .Pageable, .Paper, .Printable, .PrinterException

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private class

Field Summary

Modifier and TypeField and Description
private transient ArrayList<PrintJobAttributeListener>
private int
private CustomMediaTray
private static String
private static int
private static int
private Doc
private boolean
private InputStream
private PrinterJob
private PrintJobAttributeSet
private transient ArrayList<PrintJobListener>
private String
private transient ArrayList<PrintJobAttributeSet>
private String
private int
private MediaSizeName
private MediaSize
private boolean
private String
private NumberUp
private OrientationRequested
private boolean
private boolean
private Reader
private PrintRequestAttributeSet
private PrintService
private Sides
private File

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
addPrintJobAttributeListener(PrintJobAttributeListener listener, PrintJobAttributeSet attributes)

Implements javax.print.DocPrintJob.addPrintJobAttributeListener.

Registers a listener for changes in the specified attributes.

public void
addPrintJobListener(PrintJobListener listener)

Implements javax.print.DocPrintJob.addPrintJobListener.

Registers a listener for event occurring during this print job.

public void
cancel()

Implements javax.print.CancelablePrintJob.cancel.

Stops further processing of a print job.

private void
public PrintJobAttributeSet
getAttributes()

Implements javax.print.DocPrintJob.getAttributes.

Obtains this Print Job's set of printing attributes.

private void
public PrintService
getPrintService()

Implements javax.print.DocPrintJob.getPrintService.

Determines the PrintService object to which this print job object is bound.

private synchronized void
private void
notifyEvent(int reason)

public void
public void
private String[]
printExecCmd(String printer, String options, boolean noJobSheet, String jobTitle, int copies, String spoolFile)

public void
removePrintJobAttributeListener(PrintJobAttributeListener listener)

Implements javax.print.DocPrintJob.removePrintJobAttributeListener.

Removes an attribute listener from this print job.

public void
removePrintJobListener(PrintJobListener listener)

Implements javax.print.DocPrintJob.removePrintJobListener.

Removes a listener from this print job.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

attrListenersback to summary
private transient ArrayList<PrintJobAttributeListener> attrListeners
copiesback to summary
private int copies
customTrayback to summary
private CustomMediaTray customTray
debugPrefixback to summary
private static String debugPrefix
DESTFILEback to summary
private static int DESTFILE
DESTPRINTERback to summary
private static int DESTPRINTER
docback to summary
private Doc doc
fidelityback to summary
private boolean fidelity
instreamback to summary
private InputStream instream
jobback to summary
private PrinterJob job
jobAttrSetback to summary
private PrintJobAttributeSet jobAttrSet
jobListenersback to summary
private transient ArrayList<PrintJobListener> jobListeners
jobNameback to summary
private String jobName
listenedAttributeSetsback to summary
private transient ArrayList<PrintJobAttributeSet> listenedAttributeSets
mDestinationback to summary
private String mDestination
mDestTypeback to summary
private int mDestType
mediaNameback to summary
private MediaSizeName mediaName
mediaSizeback to summary
private MediaSize mediaSize
mNoJobSheetback to summary
private boolean mNoJobSheet
mOptionsback to summary
private String mOptions
nUpback to summary
private NumberUp nUp
orientback to summary
private OrientationRequested orient
printingback to summary
private boolean printing
printReturnedback to summary
private boolean printReturned
readerback to summary
private Reader reader
reqAttrSetback to summary
private PrintRequestAttributeSet reqAttrSet
serviceback to summary
private PrintService service
sidesback to summary
private Sides sides
spoolFileback to summary
private File spoolFile

Constructor Detail

UnixPrintJobback to summary
pack-priv UnixPrintJob(PrintService service)

Method Detail

addPrintJobAttributeListenerback to summary
public void addPrintJobAttributeListener(PrintJobAttributeListener listener, PrintJobAttributeSet attributes)

Implements javax.print.DocPrintJob.addPrintJobAttributeListener.

Doc from javax.print.DocPrintJob.addPrintJobAttributeListener.

Registers a listener for changes in the specified attributes. If listener is null, no exception is thrown and no action is performed. To determine the attribute updates that may be reported by this job, a client can call getAttributes() and identify the subset that are interesting and likely to be reported to the listener. Clients expecting to be updated about changes in a specific job attribute should verify it is in that set, but updates about an attribute will be made only if it changes and this is detected by the job. Also updates may be subject to batching by the job. To minimize overhead in print job processing it is recommended to listen on only that subset of attributes which are likely to change. If the specified set is empty no attribute updates will be reported to the listener. If the attribute set is null, then this means to listen on all dynamic attributes that the job supports. This may result in no update notifications if a job can not report any attribute updates.

If listener is already registered, it will be registered again.

Annotations
@Override
addPrintJobListenerback to summary
public void addPrintJobListener(PrintJobListener listener)

Implements javax.print.DocPrintJob.addPrintJobListener.

Doc from javax.print.DocPrintJob.addPrintJobListener.

Registers a listener for event occurring during this print job. If listener is null, no exception is thrown and no action is performed. If listener is already registered, it will be registered again.

Annotations
@Override
cancelback to summary
public void cancel() throws PrintException

Implements javax.print.CancelablePrintJob.cancel.

Doc from javax.print.CancelablePrintJob.cancel.

Stops further processing of a print job.

If a service supports this method it cannot be concluded that job cancellation will always succeed. 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.

Annotations
@Override
Exceptions
PrintException:
if the job could not be successfully cancelled
closeDataStreamsback to summary
private void closeDataStreams()
getAttributesback to summary
public PrintJobAttributeSet getAttributes()

Implements javax.print.DocPrintJob.getAttributes.

Doc from javax.print.DocPrintJob.getAttributes.

Obtains this Print Job's set of printing attributes. The returned attribute set object is unmodifiable. The returned attribute set object is a "snapshot" of this Print Job's attribute set at the time of the getAttributes() method call; that is, the returned attribute set's object's contents will not be updated if this Print Job's attribute set's contents change in the future. To detect changes in attribute values, call getAttributes() again and compare the new attribute set to the previous attribute set; alternatively, register a listener for print job events. The returned value may be an empty set but should not be null.

Annotations
@Override
getAttributeValuesback to summary
private void getAttributeValues(DocFlavor flavor) throws PrintException
getPrintServiceback to summary
public PrintService getPrintService()

Implements javax.print.DocPrintJob.getPrintService.

Doc from javax.print.DocPrintJob.getPrintService.

Determines the PrintService object to which this print job object is bound.

Annotations
@Override
initializeAttributeSetsback to summary
private synchronized void initializeAttributeSets(Doc doc, PrintRequestAttributeSet reqSet)
notifyEventback to summary
private void notifyEvent(int reason)
pageableJobback to summary
public void pageableJob(Pageable pageable) throws PrintException
printableJobback to summary
public void printableJob(Printable printable) throws PrintException
printExecCmdback to summary
private String[] printExecCmd(String printer, String options, boolean noJobSheet, String jobTitle, int copies, String spoolFile)
removePrintJobAttributeListenerback to summary
public void removePrintJobAttributeListener(PrintJobAttributeListener listener)

Implements javax.print.DocPrintJob.removePrintJobAttributeListener.

Doc from javax.print.DocPrintJob.removePrintJobAttributeListener.

Removes an attribute listener from this print job. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this print job. If the listener is null, no exception is thrown and no action is performed. If a listener is registered more than once, even for a different set of attributes, no guarantee is made which listener is removed.

Annotations
@Override
removePrintJobListenerback to summary
public void removePrintJobListener(PrintJobListener listener)

Implements javax.print.DocPrintJob.removePrintJobListener.

Doc from javax.print.DocPrintJob.removePrintJobListener.

Removes a listener from this print job. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this print job. If listener is null, no exception is thrown and no action is performed. If a listener was registered more than once only one of the registrations will be removed.

Annotations
@Override
sun.print back to summary

private final Class UnixPrintJob.PrinterOpener

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv PrintException
pack-priv OutputStream

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public OutputStream
run()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

pexback to summary
pack-priv PrintException pex
resultback to summary
pack-priv OutputStream result

Constructor Detail

PrinterOpenerback to summary
private PrinterOpener()

Method Detail

runback to summary
public OutputStream run()
sun.print back to summary

private final Class UnixPrintJob.PrinterSpooler

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv PrintException

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private void
handleProcessFailure(final Process failedProcess, final String[] execCmd, final int result)

public Object
run()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

pexback to summary
pack-priv PrintException pex

Constructor Detail

PrinterSpoolerback to summary
private PrinterSpooler()

Method Detail

handleProcessFailureback to summary
private void handleProcessFailure(final Process failedProcess, final String[] execCmd, final int result) throws IOException
runback to summary
public Object run()