Source Code Cross Referenced for ReaderWriter.java in  » Portal » Open-Portal » com » sun » portal » rproxy » https » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Portal » Open Portal » com.sun.portal.rproxy.https 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: ReaderWriter.java,v 1.4 2005/11/30 11:27:27 ss150821 Exp $
003:         * $Source: /m/portal/ps/srap/src/com/sun/portal/rproxy/https/ReaderWriter.java,v $
004:         * $Log: ReaderWriter.java,v $
005:         * Revision 1.4  2005/11/30 11:27:27  ss150821
006:         * 6356996 - Srap Code base needs to save files in the unix file format and not windows
007:         *
008:         * Revision 1.3  2005/02/23 08:59:23  ss150821
009:         * RFE 6223490 - SRA Should use JDK based logging
010:         *
011:         * Revision 1.2  2004/07/27 12:58:28  vt126379
012:         * RFE#5075809, CRT#99
013:         *
014:         * Revision 1.1  2002/06/14 09:53:57  rt130506
015:         * SRAP rebranding
016:         *
017:         * Revision 1.2  2002/06/11 16:02:09  bv131302
018:         * new branded
019:         *
020:         * Revision 1.1  2002/05/28 09:38:18  mm132998
021:         * Bug id - 4692062 , CRT - 1215 , Desc - Support for iDSAME in https mode.
022:         *
023:         *
024:         */
025:        // @(#)ReaderWriter.java 1.11     "@(#)ReaderWriter.java	1.11 99/09/23 Sun Microsystems"
026:        package com.sun.portal.rproxy.https;
027:
028:        import java.io.DataInputStream;
029:        import java.io.DataOutputStream;
030:        import java.io.IOException;
031:        import java.net.Socket;
032:        import java.util.logging.Level;
033:        import java.util.logging.Logger;
034:
035:        import com.sun.portal.log.common.PortalLogger;
036:
037:        public abstract class ReaderWriter implements  Runnable {
038:            protected ReaderWriterLock rwLock;
039:
040:            protected DataInputStream in;
041:
042:            protected DataOutputStream out;
043:
044:            final protected int MAXBUFFERSIZE = 8 * 1024;
045:
046:            protected boolean sent = false;
047:
048:            protected volatile boolean go = true;
049:
050:            // private static Logger logger =
051:            // Logger.getLogger("com.sun.portal.sra.rproxy");
052:            private static Logger logger = PortalLogger
053:                    .getLogger(ReaderWriter.class);
054:
055:            public ReaderWriter(ReaderWriterLock l, Socket fs, Socket ts) {
056:                rwLock = l;
057:
058:                // create data input and output streams
059:                try {
060:                    in = new DataInputStream(fs.getInputStream());
061:                    out = new DataOutputStream(ts.getOutputStream());
062:                } catch (IOException e) {
063:                    in = null;
064:                    out = null;
065:                    //logger.log(Level.SEVERE, "ReaderWriter: Cannot construct ReaderWriter ", e);
066:                    Object[] params = { e };
067:                    logger.log(Level.SEVERE, "PSSRRPROXY_CSPRH024", params);
068:                }
069:            }
070:
071:            public abstract void run();
072:
073:            void clean() {
074:                if (in != null) {
075:                    try {
076:                        in.close();
077:                    } catch (Exception e) {
078:                    } finally {
079:                        in = null;
080:                    }
081:                }
082:
083:                if (out != null) {
084:                    try {
085:                        out.close();
086:                    } catch (Exception e) {
087:                    } finally {
088:                        out = null;
089:                    }
090:                }
091:            }
092:
093:            public void netletstop() {
094:                go = false;
095:                clean();
096:            }
097:
098:            public void stop() {
099:                go = false;
100:                clean();
101:            }
102:
103:            public boolean sentDataFlag() {
104:                return (sent);
105:            }
106:
107:            public void clearDataFlag() {
108:                sent = false;
109:            }
110:
111:            public boolean isAlive() {
112:                return (go);
113:            }
114:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.