1 package org.apache.sandesha.interop.testclient; 2 3 import org.apache.commons.logging.Log; 4 import org.apache.commons.logging.LogFactory; 5 6 import java.io.PrintWriter ; 7 8 9 15 public class ResponseWriter { 16 17 private PrintWriter writer; 18 private static final Log log = LogFactory.getLog(PrintWriter .class.getName()); 19 20 public ResponseWriter(PrintWriter writer) { 21 this.writer = writer; 22 } 23 24 public synchronized boolean write(String s) { 25 try { 26 writer.println(s); 27 flush(); 28 return true; 29 } catch (Exception e) { 30 log.error("Exception: In method 'write' of 'ResponseWriter"); 31 return false; 32 } 33 } 34 35 public synchronized void flush() { 36 writer.flush(); 37 } 38 } 39 | Popular Tags |