NonStop Server for Java 6.0 Programmer's Reference

#define SPT_THREAD_AWARE
Adding this define in the native C/C++ code, transparently provides you the thread-aware
equivalents of many of the interfaces, for example, the Socket interface. Additionally, the
interfaces are available to determine if a socket is read-ready (spt_fd_read_ready) or
write-ready (spt_fd_write_ready). The Socket implementation on NonStop systems supports
streaming; multiple sends and receives are outstanding at a time.
Be careful when using thread-aware interfaces.
The OSS Programmer’s Guide lists thread-aware equivalents of NonStop system-specific
interfaces. These interfaces have an explicit spt_ prefix.
For example, when using a thread-aware function, do not attempt to control the set of files
that are enabled for completion or directly attempt to wait for a completion on a file registered
with pthreads (FILE_COMPLETE_SET_,FILE_COMPLETE_, AWAITIO, or AWAITIOX
procedure).
Java Print Service (JPS)
The Java Print Service is implemented in NonStop Server for Java 6.0. The Java Print Service allows
you to print on printers directly to NonStop systems and to network printers attached to a local
area network (LAN) or wide area network (WAN). For information on configuring network printers,
see the Spooler FASTP Network Print Processes Manual. For information on the Spooler subsystem,
see the Spooler Utilities Reference Manual.
The Java Print Service implemented into NonStop Server for Java 6.0 uses the headless version of
the javax.print API. All printing features and attributes in the JPS classes listed below work when
the NonStop spooler and printer support the API. However, the NonStop operating system
requirement for sending text and postscript files to separate printers also applies when printing
under JPs The JPs classes are:
javax.print
javax.print.attribute
javax.print.attribute.standard
javax.print.event
NOTE: For applications using the java.awt.print.PrinterJob class, the printer should be
postscript enabled. For information on enabling postscript printing, see the Spooler FASTP Network
Print Processes Manual.
Using the Guardian Printer
NonStop Java API accepts the Guardian printer filenames.
The following code fragment shows how to set the Guardian printer filename and print the
print.txt file.
..
String printer = "\$s.#<guardian-printer-name>";
FileInputStream stream = new FileInputStream("print.txt"); // file to print
..
PrintServiceAttributeSet prAttr = new HashPrintServiceAttributeSet();
prAttr.add(new PrinterName(printer, null));
PrintServiceLookup lookup = new UnixPrintServiceLookup();
PrintService[] services = null;
..
services = lookup.getPrintServices(null, prAttr);
..
DocPrintJob job = services[0].createPrintJob();
SimpleDoc doc = new SimpleDoc(stream, DocFlavor.INPUT_STREAM.AUTOSENSE, null);
..
job.print(doc, null);
Java Print Service (JPS) 51