changeset 490:fc322b1af8ec

new servlet version 1.7.0b - changed semaphore code to use Java 1.5 - changed digilib worker to do write the output outside the semaphore
author robcast
date Thu, 02 Aug 2007 19:22:47 +0200
parents 882ee6a055bd
children 5cfbd6f99cf2
files servlet/src/digilib/servlet/DigilibImageWorker.java
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/servlet/src/digilib/servlet/DigilibImageWorker.java	Mon May 28 19:20:00 2007 +0200
+++ b/servlet/src/digilib/servlet/DigilibImageWorker.java	Thu Aug 02 19:22:47 2007 +0200
@@ -134,7 +134,7 @@
 	/*
 	 * do the work
 	 */
-	public void work() throws FileOpException, IOException, ImageOpException {
+	public DocuImage render() throws FileOpException, IOException, ImageOpException {
 		;
 		logger.debug("image worker " + this.getName() + " working");
 		startTime = System.currentTimeMillis();
@@ -244,8 +244,12 @@
 			docuImage.enhance(mult, paramBRGT);
 		}
 
-		logger.debug("time " + (System.currentTimeMillis() - startTime) + "ms");
+		logger.debug("rendered in " + (System.currentTimeMillis() - startTime) + "ms");
 
+		return docuImage;
+	}
+
+	public void write(DocuImage img) throws FileOpException, IOException {
 		/* write the resulting image */
 
 		// setup output -- if output type is forced use that otherwise
@@ -266,12 +270,12 @@
 		response.setContentType(mimeType);
 
 		// write the image
-		docuImage.writeImage(mimeType, response.getOutputStream());
+		img.writeImage(mimeType, response.getOutputStream());
 		response.flushBuffer();
 
 		logger.info("image worker " + this.getName() + " done in "
 				+ (System.currentTimeMillis() - startTime));
 
-		docuImage.dispose();
+		img.dispose();
 	}
 }