Author: ningjiang
Date: Wed Feb 22 03:47:12 2012
New Revision: 1292117

URL: http://svn.apache.org/viewvc?rev=1292117&view=rev
Log:
Merged revisions 1292116 via svnmerge from 
https://svn.apache.org/repos/asf/camel/branches/camel-2.9.x

................
  r1292116 | ningjiang | 2012-02-22 11:33:01 +0800 (Wed, 22 Feb 2012) | 9 lines
  
  Merged revisions 1292114 via svnmerge from 
  https://svn.apache.org/repos/asf/camel/trunk
  
  ........
    r1292114 | ningjiang | 2012-02-22 11:19:44 +0800 (Wed, 22 Feb 2012) | 1 line
    
    CAMEL-5023 Fixed the issue that Printer endpoint can only print a single 
job.
  ........
................

Modified:
    camel/branches/camel-2.8.x/   (props changed)
    
camel/branches/camel-2.8.x/components/camel-printer/src/main/java/org/apache/camel/component/printer/PrinterOperations.java
    
camel/branches/camel-2.8.x/components/camel-printer/src/main/java/org/apache/camel/component/printer/PrinterProducer.java

Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Feb 22 03:47:12 2012
@@ -1,2 +1,2 @@
-/camel/branches/camel-2.9.x:1227549,1228229,1229567,1234054,1236672,1238942,1240157,1241006,1241489,1243052,1243058,1244875,1244877,1291871
-/camel/trunk:1226860,1227540,1228223,1229565,1234043,1236667,1238937,1240025,1240950,1240967,1241482,1243046,1243057,1244870,1244872,1291848
+/camel/branches/camel-2.9.x:1227549,1228229,1229567,1234054,1236672,1238942,1240157,1241006,1241489,1243052,1243058,1244875,1244877,1291871,1292116
+/camel/trunk:1226860,1227540,1228223,1229565,1234043,1236667,1238937,1240025,1240950,1240967,1241482,1243046,1243057,1244870,1244872,1291848,1292114

Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: 
camel/branches/camel-2.8.x/components/camel-printer/src/main/java/org/apache/camel/component/printer/PrinterOperations.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/components/camel-printer/src/main/java/org/apache/camel/component/printer/PrinterOperations.java?rev=1292117&r1=1292116&r2=1292117&view=diff
==============================================================================
--- 
camel/branches/camel-2.8.x/components/camel-printer/src/main/java/org/apache/camel/component/printer/PrinterOperations.java
 (original)
+++ 
camel/branches/camel-2.8.x/components/camel-printer/src/main/java/org/apache/camel/component/printer/PrinterOperations.java
 Wed Feb 22 03:47:12 2012
@@ -39,7 +39,6 @@ import org.slf4j.LoggerFactory;
 public class PrinterOperations implements PrinterOperationsInterface {
     private static final transient Logger LOG = 
LoggerFactory.getLogger(PrinterOperations.class);
     private PrintService printService;
-    private DocPrintJob job;
     private DocFlavor flavor;
     private PrintRequestAttributeSet printRequestAttributeSet;
     private Doc doc;
@@ -49,7 +48,6 @@ public class PrinterOperations implement
         if (printService == null) {
             throw new PrintException("Printer lookup failure. No default 
printer set up for this host");
         }
-        job = printService.createPrintJob(); 
         flavor = DocFlavor.BYTE_ARRAY.AUTOSENSE;
         printRequestAttributeSet = new HashPrintRequestAttributeSet();
         printRequestAttributeSet.add(new Copies(1));
@@ -57,10 +55,9 @@ public class PrinterOperations implement
         printRequestAttributeSet.add(Sides.ONE_SIDED);
     }
 
-    public PrinterOperations(PrintService printService, DocPrintJob job, 
DocFlavor flavor, PrintRequestAttributeSet printRequestAttributeSet) throws 
PrintException {
+    public PrinterOperations(PrintService printService, DocFlavor flavor, 
PrintRequestAttributeSet printRequestAttributeSet) throws PrintException {
         this();
         this.setPrintService(printService);
-        this.setJob(job);
         this.setFlavor(flavor);
         this.setPrintRequestAttributeSet(printRequestAttributeSet);
     }
@@ -104,6 +101,8 @@ public class PrinterOperations implement
     }
         
     public void print(Doc doc) throws PrintException {
+        // we need create a new job for each print 
+        DocPrintJob job = getPrintService().createPrintJob();
         job.print(doc, printRequestAttributeSet);
     }
 
@@ -114,15 +113,7 @@ public class PrinterOperations implement
     public void setPrintService(PrintService printService) {
         this.printService = printService;
     }
-
-    public DocPrintJob getJob() {
-        return job;
-    }
-
-    public void setJob(DocPrintJob job) {
-        this.job = job;
-    }
-
+    
     public DocFlavor getFlavor() {
         return flavor;
     }

Modified: 
camel/branches/camel-2.8.x/components/camel-printer/src/main/java/org/apache/camel/component/printer/PrinterProducer.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/components/camel-printer/src/main/java/org/apache/camel/component/printer/PrinterProducer.java?rev=1292117&r1=1292116&r2=1292117&view=diff
==============================================================================
--- 
camel/branches/camel-2.8.x/components/camel-printer/src/main/java/org/apache/camel/component/printer/PrinterProducer.java
 (original)
+++ 
camel/branches/camel-2.8.x/components/camel-printer/src/main/java/org/apache/camel/component/printer/PrinterProducer.java
 Wed Feb 22 03:47:12 2012
@@ -152,7 +152,7 @@ public class PrinterProducer extends Def
         ObjectHelper.notNull(printService, "PrintService", this);
 
         if (printerOperations == null) {
-            printerOperations = new PrinterOperations(printService, 
assignPrintJob(printService), assignDocFlavor(), assignPrintAttributes());
+            printerOperations = new PrinterOperations(printService, 
assignDocFlavor(), assignPrintAttributes());
         }
         super.doStart();
     }


Reply via email to