Source Code Cross Referenced for RWGroupJSSProxy.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: RWGroupJSSProxy.java,v 1.6 2005/11/30 11:27:27 ss150821 Exp $
003:         * $Source: /m/portal/ps/srap/src/com/sun/portal/rproxy/https/RWGroupJSSProxy.java,v $
004:         * $Log: RWGroupJSSProxy.java,v $
005:         * Revision 1.6  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.5  2005/02/25 09:44:17  ss150821
009:         * RFE 6223490 - SRA Should use JDK based logging, changed to start throwing the full stacktrace for the  exception in the logs
010:         *
011:         * Revision 1.4  2005/02/23 09:02:01  ss150821
012:         * RFE 6223490 - SRA Should use JDK based logging
013:         *
014:         * Revision 1.3  2005/02/23 08:59:23  ss150821
015:         * RFE 6223490 - SRA Should use JDK based logging
016:         *
017:         * Revision 1.2  2004/07/27 12:58:28  vt126379
018:         * RFE#5075809, CRT#99
019:         *
020:         * Revision 1.1  2002/06/14 09:53:57  rt130506
021:         * SRAP rebranding
022:         *
023:         * Revision 1.2  2002/06/11 16:02:09  bv131302
024:         * new branded
025:         *
026:         * Revision 1.1  2002/05/28 09:38:18  mm132998
027:         * Bug id - 4692062 , CRT - 1215 , Desc - Support for iDSAME in https mode.
028:         *
029:         *
030:         */
031:        package com.sun.portal.rproxy.https;
032:
033:        import java.net.Socket;
034:        import java.util.logging.Level;
035:        import java.util.logging.Logger;
036:
037:        import com.sun.portal.log.common.PortalLogger;
038:
039:        public class RWGroupJSSProxy extends ReaderWriterLock {
040:            private Socket fromClient;
041:
042:            private Socket toServer;
043:
044:            private ReaderWriterClear src_to_dst;
045:
046:            private ReaderWriterClear dst_to_src;
047:
048:            private boolean src_to_dst_clean = false;
049:
050:            private boolean dst_to_src_clean = false;
051:
052:            // private static Logger logger =
053:            // Logger.getLogger("com.sun.portal.sra.rproxy");
054:            private static Logger logger = PortalLogger
055:                    .getLogger(RWGroupJSSProxy.class);
056:
057:            public RWGroupJSSProxy(Socket fromSocket, Socket toSocket) {
058:                fromClient = fromSocket;
059:                toServer = toSocket;
060:
061:                src_to_dst = new ReaderWriterClear(this , fromClient, toServer);
062:                dst_to_src = new ReaderWriterClear(this , toServer, fromClient);
063:                try {
064:                    JSSThreadPool.run(src_to_dst);
065:                    JSSThreadPool.run(dst_to_src);
066:                } catch (InterruptedException e) {
067:                    // logger.log(Level.SEVERE, "Could not start ReaderWriterClear
068:                    // tasks", e);
069:                    logger.log(Level.SEVERE, "PSSRRPROXY_CSPRH023", e);
070:                }
071:            }
072:
073:            public synchronized void notifyFinished(ReaderWriter obj) {
074:                if (obj == src_to_dst) {
075:                    if (dst_to_src.isAlive()) {
076:                        dst_to_src.stop();
077:                    }
078:                } else if (obj == dst_to_src) {
079:                    if (src_to_dst.isAlive()) {
080:                        src_to_dst.stop();
081:                    }
082:                }
083:                cleanup();
084:                if (obj == src_to_dst) {
085:                    src_to_dst_clean = true;
086:                } else if (obj == dst_to_src) {
087:                    dst_to_src_clean = true;
088:                }
089:            }
090:
091:            public void cleanup() {
092:                if (fromClient != null) {
093:                    try {
094:                        fromClient.close();
095:                    } catch (Exception e) {
096:                    } finally {
097:                        fromClient = null;
098:                    }
099:                }
100:                if (toServer != null) {
101:                    try {
102:                        toServer.close();
103:                    } catch (Exception e) {
104:                    } finally {
105:                        toServer = null;
106:                    }
107:                }
108:            }
109:
110:            public boolean isDone() {
111:                if (dst_to_src_clean && src_to_dst_clean) {
112:                    dst_to_src = null;
113:                    src_to_dst = null;
114:                }
115:                return (dst_to_src_clean && src_to_dst_clean);
116:            }
117:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.