01: /*
02: * $Id: ReaderWriterClear.java,v 1.5 2005/11/30 11:27:28 ss150821 Exp $
03: * $Source: /m/portal/ps/srap/src/com/sun/portal/rproxy/https/ReaderWriterClear.java,v $
04: * $Log: ReaderWriterClear.java,v $
05: * Revision 1.5 2005/11/30 11:27:28 ss150821
06: * 6356996 - Srap Code base needs to save files in the unix file format and not windows
07: *
08: * Revision 1.4 2005/02/23 09:02:01 ss150821
09: * RFE 6223490 - SRA Should use JDK based logging
10: *
11: * Revision 1.3 2005/02/23 08:59:23 ss150821
12: * RFE 6223490 - SRA Should use JDK based logging
13: *
14: * Revision 1.2 2004/07/27 12:58:29 vt126379
15: * RFE#5075809, CRT#99
16: *
17: * Revision 1.1 2002/06/14 09:53:57 rt130506
18: * SRAP rebranding
19: *
20: * Revision 1.2 2002/06/11 16:02:09 bv131302
21: * new branded
22: *
23: * Revision 1.1 2002/05/28 09:38:18 mm132998
24: * Bug id - 4692062 , CRT - 1215 , Desc - Support for iDSAME in https mode.
25: *
26: *
27: */
28: // @(#)ReaderWriterClear.java 1.11 "@(#)ReaderWriterClear.java 1.11 99/09/23 Sun Microsystems"
29: package com.sun.portal.rproxy.https;
30:
31: import java.io.IOException;
32: import java.net.Socket;
33: import java.util.logging.Logger;
34:
35: import com.sun.portal.log.common.PortalLogger;
36:
37: public class ReaderWriterClear extends ReaderWriter {
38:
39: // private static Logger logger =
40: // Logger.getLogger("com.sun.portal.sra.rproxy");
41: private static Logger logger = PortalLogger
42: .getLogger(ReaderWriterClear.class);
43:
44: public ReaderWriterClear(ReaderWriterLock l, Socket fs, Socket ts) {
45: super (l, fs, ts);
46: }
47:
48: public void run() {
49: int numBytes = 0;
50: byte[] buffer = new byte[MAXBUFFERSIZE];
51:
52: try {
53: while (go) {
54: numBytes = in.read(buffer);
55: if (numBytes > 0) {
56: out.write(buffer, 0, numBytes);
57: out.flush();
58: } else if (numBytes == 0) {
59: // logger.info("ReaderWriterClear: got a 0 length read");
60: logger.info("PSSRRPROXY_CSPRH025");
61: } else {
62: return;
63: }
64: }
65: } catch (IOException e) {
66: return;
67: } catch (NullPointerException e) {
68: // If this runnable is stopped, then either 'in' or 'out'
69: // would have been set to null and hence the
70: // NullPointerException. Gracefully return.
71: return;
72: } finally {
73: stop();
74: buffer = null;
75: rwLock.notifyFinished(this);
76: rwLock = null;
77: }
78: }
79: }
|