Source Code Cross Referenced for WADIClusteredValve.java in  » EJB-Server-geronimo » plugins » org » apache » geronimo » tomcat » cluster » wadi » 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 » EJB Server geronimo » plugins » org.apache.geronimo.tomcat.cluster.wadi 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one
003:         * or more contributor license agreements.  See the NOTICE file
004:         * distributed with this work for additional information
005:         * regarding copyright ownership.  The ASF licenses this file
006:         * to you under the Apache License, Version 2.0 (the
007:         * "License"); you may not use this file except in compliance
008:         * with the License.  You may obtain a copy of the License at
009:         *
010:         *  http://www.apache.org/licenses/LICENSE-2.0
011:         *
012:         * Unless required by applicable law or agreed to in writing,
013:         * software distributed under the License is distributed on an
014:         * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015:         * KIND, either express or implied.  See the License for the
016:         * specific language governing permissions and limitations
017:         * under the License.
018:         */
019:
020:        package org.apache.geronimo.tomcat.cluster.wadi;
021:
022:        import java.io.BufferedReader;
023:        import java.io.IOException;
024:        import java.io.UnsupportedEncodingException;
025:        import java.security.Principal;
026:        import java.util.Enumeration;
027:        import java.util.Locale;
028:        import java.util.Map;
029:
030:        import javax.servlet.FilterChain;
031:        import javax.servlet.RequestDispatcher;
032:        import javax.servlet.ServletException;
033:        import javax.servlet.ServletInputStream;
034:        import javax.servlet.ServletRequest;
035:        import javax.servlet.ServletResponse;
036:        import javax.servlet.http.Cookie;
037:        import javax.servlet.http.HttpServletRequest;
038:        import javax.servlet.http.HttpSession;
039:
040:        import org.apache.catalina.connector.Request;
041:        import org.apache.catalina.connector.Response;
042:        import org.apache.geronimo.clustering.ClusteredInvocation;
043:        import org.apache.geronimo.clustering.ClusteredInvocationException;
044:        import org.apache.geronimo.tomcat.cluster.AbstractClusteredValve;
045:        import org.codehaus.wadi.core.contextualiser.InvocationException;
046:        import org.codehaus.wadi.core.manager.Manager;
047:        import org.codehaus.wadi.web.impl.WebInvocation;
048:
049:        /**
050:         * 
051:         * @version $Rev$ $Date$
052:         */
053:        public class WADIClusteredValve extends AbstractClusteredValve {
054:            private final Manager wadiManager;
055:
056:            public WADIClusteredValve(Manager wadiManager) {
057:                this .wadiManager = wadiManager;
058:            }
059:
060:            protected ClusteredInvocation newClusteredInvocation(
061:                    Request request, Response response) {
062:                return new WADIWebClusteredInvocation(request, response);
063:            }
064:
065:            protected class WADIWebClusteredInvocation extends
066:                    WebClusteredInvocation {
067:
068:                public WADIWebClusteredInvocation(Request request,
069:                        Response response) {
070:                    super (request, response);
071:                }
072:
073:                public void invoke() throws ClusteredInvocationException {
074:                    WebInvocation invocation = new WebInvocation(5000);
075:                    FilterChain chainAdapter = new FilterChain() {
076:                        public void doFilter(ServletRequest request,
077:                                ServletResponse response) throws IOException,
078:                                ServletException {
079:                            try {
080:                                invokeLocally();
081:                            } catch (ClusteredInvocationException e) {
082:                                throw (IOException) new IOException()
083:                                        .initCause(e);
084:                            }
085:                        }
086:                    };
087:                    invocation.init(
088:                            null == request ? NoOpHttpServletRequest.SINGLETON
089:                                    : request, response, chainAdapter);
090:                    try {
091:                        wadiManager.contextualise(invocation);
092:                    } catch (InvocationException e) {
093:                        Throwable throwable = e.getCause();
094:                        if (throwable instanceof  IOException) {
095:                            throw new ClusteredInvocationException(throwable);
096:                        } else if (throwable instanceof  ServletException) {
097:                            throw new ClusteredInvocationException(throwable);
098:                        } else {
099:                            throw new ClusteredInvocationException(e);
100:                        }
101:                    }
102:                }
103:            }
104:
105:            protected static class NoOpHttpServletRequest implements 
106:                    HttpServletRequest {
107:                public static final NoOpHttpServletRequest SINGLETON = new NoOpHttpServletRequest();
108:
109:                public String getAuthType() {
110:                    throw new UnsupportedOperationException();
111:                }
112:
113:                public String getContextPath() {
114:                    throw new UnsupportedOperationException();
115:                }
116:
117:                public Cookie[] getCookies() {
118:                    throw new UnsupportedOperationException();
119:                }
120:
121:                public long getDateHeader(String arg0) {
122:                    throw new UnsupportedOperationException();
123:                }
124:
125:                public String getHeader(String arg0) {
126:                    throw new UnsupportedOperationException();
127:                }
128:
129:                public Enumeration getHeaderNames() {
130:                    throw new UnsupportedOperationException();
131:                }
132:
133:                public Enumeration getHeaders(String arg0) {
134:                    throw new UnsupportedOperationException();
135:                }
136:
137:                public int getIntHeader(String arg0) {
138:                    throw new UnsupportedOperationException();
139:                }
140:
141:                public String getMethod() {
142:                    throw new UnsupportedOperationException();
143:                }
144:
145:                public String getPathInfo() {
146:                    throw new UnsupportedOperationException();
147:                }
148:
149:                public String getPathTranslated() {
150:                    throw new UnsupportedOperationException();
151:                }
152:
153:                public String getQueryString() {
154:                    throw new UnsupportedOperationException();
155:                }
156:
157:                public String getRemoteUser() {
158:                    throw new UnsupportedOperationException();
159:                }
160:
161:                public String getRequestURI() {
162:                    throw new UnsupportedOperationException();
163:                }
164:
165:                public StringBuffer getRequestURL() {
166:                    throw new UnsupportedOperationException();
167:                }
168:
169:                public String getRequestedSessionId() {
170:                    return null;
171:                }
172:
173:                public String getServletPath() {
174:                    throw new UnsupportedOperationException();
175:                }
176:
177:                public HttpSession getSession() {
178:                    throw new UnsupportedOperationException();
179:                }
180:
181:                public HttpSession getSession(boolean arg0) {
182:                    throw new UnsupportedOperationException();
183:                }
184:
185:                public Principal getUserPrincipal() {
186:                    throw new UnsupportedOperationException();
187:                }
188:
189:                public boolean isRequestedSessionIdFromCookie() {
190:                    throw new UnsupportedOperationException();
191:                }
192:
193:                public boolean isRequestedSessionIdFromURL() {
194:                    throw new UnsupportedOperationException();
195:                }
196:
197:                public boolean isRequestedSessionIdFromUrl() {
198:                    throw new UnsupportedOperationException();
199:                }
200:
201:                public boolean isRequestedSessionIdValid() {
202:                    throw new UnsupportedOperationException();
203:                }
204:
205:                public boolean isUserInRole(String arg0) {
206:                    throw new UnsupportedOperationException();
207:                }
208:
209:                public Object getAttribute(String arg0) {
210:                    throw new UnsupportedOperationException();
211:                }
212:
213:                public Enumeration getAttributeNames() {
214:                    throw new UnsupportedOperationException();
215:                }
216:
217:                public String getCharacterEncoding() {
218:                    throw new UnsupportedOperationException();
219:                }
220:
221:                public int getContentLength() {
222:                    throw new UnsupportedOperationException();
223:                }
224:
225:                public String getContentType() {
226:                    throw new UnsupportedOperationException();
227:                }
228:
229:                public ServletInputStream getInputStream() throws IOException {
230:                    throw new UnsupportedOperationException();
231:                }
232:
233:                public String getLocalAddr() {
234:                    throw new UnsupportedOperationException();
235:                }
236:
237:                public String getLocalName() {
238:                    throw new UnsupportedOperationException();
239:                }
240:
241:                public int getLocalPort() {
242:                    throw new UnsupportedOperationException();
243:                }
244:
245:                public Locale getLocale() {
246:                    throw new UnsupportedOperationException();
247:                }
248:
249:                public Enumeration getLocales() {
250:                    throw new UnsupportedOperationException();
251:                }
252:
253:                public String getParameter(String arg0) {
254:                    throw new UnsupportedOperationException();
255:                }
256:
257:                public Map getParameterMap() {
258:                    throw new UnsupportedOperationException();
259:                }
260:
261:                public Enumeration getParameterNames() {
262:                    throw new UnsupportedOperationException();
263:                }
264:
265:                public String[] getParameterValues(String arg0) {
266:                    throw new UnsupportedOperationException();
267:                }
268:
269:                public String getProtocol() {
270:                    throw new UnsupportedOperationException();
271:                }
272:
273:                public BufferedReader getReader() throws IOException {
274:                    throw new UnsupportedOperationException();
275:                }
276:
277:                public String getRealPath(String arg0) {
278:                    throw new UnsupportedOperationException();
279:                }
280:
281:                public String getRemoteAddr() {
282:                    throw new UnsupportedOperationException();
283:                }
284:
285:                public String getRemoteHost() {
286:                    throw new UnsupportedOperationException();
287:                }
288:
289:                public int getRemotePort() {
290:                    throw new UnsupportedOperationException();
291:                }
292:
293:                public RequestDispatcher getRequestDispatcher(String arg0) {
294:                    throw new UnsupportedOperationException();
295:                }
296:
297:                public String getScheme() {
298:                    throw new UnsupportedOperationException();
299:                }
300:
301:                public String getServerName() {
302:                    throw new UnsupportedOperationException();
303:                }
304:
305:                public int getServerPort() {
306:                    throw new UnsupportedOperationException();
307:                }
308:
309:                public boolean isSecure() {
310:                    throw new UnsupportedOperationException();
311:                }
312:
313:                public void removeAttribute(String arg0) {
314:                    throw new UnsupportedOperationException();
315:                }
316:
317:                public void setAttribute(String arg0, Object arg1) {
318:                    throw new UnsupportedOperationException();
319:                }
320:
321:                public void setCharacterEncoding(String arg0)
322:                        throws UnsupportedEncodingException {
323:                    throw new UnsupportedOperationException();
324:                }
325:
326:            }
327:
328:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.