Source Code Cross Referenced for ClientProcessorEnvironment.java in  » 6.0-JDK-Modules-com.sun » tools » com » sun » tools » internal » ws » processor » util » 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 » 6.0 JDK Modules com.sun » tools » com.sun.tools.internal.ws.processor.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
003:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004:         *
005:         * This code is free software; you can redistribute it and/or modify it
006:         * under the terms of the GNU General Public License version 2 only, as
007:         * published by the Free Software Foundation.  Sun designates this
008:         * particular file as subject to the "Classpath" exception as provided
009:         * by Sun in the LICENSE file that accompanied this code.
010:         *
011:         * This code is distributed in the hope that it will be useful, but WITHOUT
012:         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013:         * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
014:         * version 2 for more details (a copy is included in the LICENSE file that
015:         * accompanied this code).
016:         *
017:         * You should have received a copy of the GNU General Public License version
018:         * 2 along with this work; if not, write to the Free Software Foundation,
019:         * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020:         *
021:         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022:         * CA 95054 USA or visit www.sun.com if you need additional information or
023:         * have any questions.
024:         */
025:
026:        package com.sun.tools.internal.ws.processor.util;
027:
028:        import java.io.File;
029:        import java.io.OutputStream;
030:        import java.io.PrintStream;
031:        import java.util.ArrayList;
032:        import java.util.Iterator;
033:        import java.util.List;
034:
035:        import com.sun.tools.internal.ws.processor.ProcessorNotificationListener;
036:        import com.sun.tools.internal.ws.processor.generator.Names;
037:        import com.sun.tools.internal.ws.util.JAXWSClassFactory;
038:        import com.sun.xml.internal.ws.util.localization.Localizable;
039:
040:        /**
041:         *
042:         * @author WS Development Team
043:         */
044:        public class ClientProcessorEnvironment extends
045:                ProcessorEnvironmentBase implements  ProcessorEnvironment {
046:
047:            /**
048:             * The stream where error message are printed.
049:             */
050:            private OutputStream out;
051:
052:            /**
053:             * A printwriter created lazily in case there are exceptions to report.
054:             */
055:            private PrintStream outprintstream;
056:
057:            /**
058:             * listener for error/warning/info notifications
059:             */
060:            private ProcessorNotificationListener listener;
061:
062:            /**
063:             * The classpath to use
064:             */
065:            private String classPath;
066:
067:            /**
068:             * list of generated source files created in this environment and
069:             * its type
070:             */
071:            private List generatedFiles = new ArrayList();
072:
073:            /**
074:             * The number of errors and warnings
075:             */
076:            private int nwarnings;
077:            private int nerrors;
078:
079:            /**
080:             * flags
081:             */
082:            private int flags;
083:
084:            private Names names;
085:
086:            /**
087:             * Create a ClientProcessorEnvironment with the given class path,
088:             * stream for messages and ProcessorNotificationListener.
089:             */
090:            public ClientProcessorEnvironment(OutputStream out,
091:                    String classPath, ProcessorNotificationListener listener) {
092:
093:                this .out = out;
094:                this .classPath = classPath;
095:                this .listener = listener;
096:                flags = 0;
097:
098:                //bug fix:4904604
099:                names = JAXWSClassFactory.newInstance().createNames();
100:            }
101:
102:            /**
103:             * Set the environment flags
104:             */
105:            public void setFlags(int flags) {
106:                this .flags = flags;
107:            }
108:
109:            /**
110:             * Get the environment flags
111:             */
112:            public int getFlags() {
113:                return flags;
114:            }
115:
116:            /**
117:             * Get the ClassPath.
118:             */
119:            public String getClassPath() {
120:                return classPath;
121:            }
122:
123:            /**
124:             * Is verbose turned on
125:             */
126:            public boolean verbose() {
127:                return (flags & F_VERBOSE) != 0;
128:            }
129:
130:            /**
131:             * Remember info on  generated source file generated so that it
132:             * can be removed later, if appropriate.
133:             */
134:            public void addGeneratedFile(GeneratedFileInfo file) {
135:                generatedFiles.add(file);
136:            }
137:
138:            /**
139:             * Return all the generated files and its types.
140:             */
141:            public Iterator getGeneratedFiles() {
142:                return generatedFiles.iterator();
143:            }
144:
145:            /**
146:             * Delete all the generated source files made during the execution
147:             * of this environment (those that have been registered with the
148:             * "addGeneratedFile" method).
149:             */
150:            public void deleteGeneratedFiles() {
151:                synchronized (generatedFiles) {
152:                    Iterator iter = generatedFiles.iterator();
153:                    while (iter.hasNext()) {
154:                        File file = ((GeneratedFileInfo) iter.next()).getFile();
155:                        if (file.getName().endsWith(".java")) {
156:                            file.delete();
157:                        }
158:                    }
159:                    generatedFiles.clear();
160:                }
161:            }
162:
163:            /**
164:             * Release resources, if any.
165:             */
166:            public void shutdown() {
167:                listener = null;
168:                generatedFiles = null;
169:            }
170:
171:            public void error(Localizable msg) {
172:                if (listener != null) {
173:                    listener.onError(msg);
174:                }
175:                nerrors++;
176:            }
177:
178:            public void warn(Localizable msg) {
179:                if (warnings()) {
180:                    nwarnings++;
181:                    if (listener != null) {
182:                        listener.onWarning(msg);
183:                    }
184:                }
185:            }
186:
187:            public void info(Localizable msg) {
188:                if (listener != null) {
189:                    listener.onInfo(msg);
190:                }
191:            }
192:
193:            public void printStackTrace(Throwable t) {
194:                if (outprintstream == null) {
195:                    outprintstream = new PrintStream(out);
196:                }
197:                t.printStackTrace(outprintstream);
198:            }
199:
200:            public Names getNames() {
201:                return names;
202:            }
203:
204:            public int getErrorCount() {
205:                return nerrors;
206:            }
207:
208:            public int getWarningCount() {
209:                return nwarnings;
210:            }
211:
212:            private boolean warnings() {
213:                return (flags & F_WARNINGS) != 0;
214:            }
215:
216:            //bug fix:4904604
217:            //to called in compileTool after env is
218:            public void setNames(Names names) {
219:                this.names = names;
220:            }
221:
222:        }
w_ww.j_a__v___a__2___s__._c___o_m_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.