Source Code Cross Referenced for Handler.java in  » Web-Server » Brazil » sunlabs » brazil » server » 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 » Web Server » Brazil » sunlabs.brazil.server 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Handler.java
003:         *
004:         * Brazil project web application Framework,
005:         * export version: 1.1 
006:         * Copyright (c) 1998-1999 Sun Microsystems, Inc.
007:         *
008:         * Sun Public License Notice
009:         *
010:         * The contents of this file are subject to the Sun Public License Version 
011:         * 1.0 (the "License"). You may not use this file except in compliance with 
012:         * the License. A copy of the License is included as the file "license.terms",
013:         * and also available at http://www.sun.com/
014:         * 
015:         * The Original Code is from:
016:         *    Brazil project web application Framework release 1.1.
017:         * The Initial Developer of the Original Code is: suhler.
018:         * Portions created by suhler are Copyright (C) Sun Microsystems, Inc.
019:         * All Rights Reserved.
020:         * 
021:         * Contributor(s): cstevens, suhler.
022:         *
023:         * Version:  1.5
024:         * Created by suhler on 98/09/14
025:         * Last modified by cstevens on 99/11/17 15:36:59
026:         */
027:
028:        package sunlabs.brazil.server;
029:
030:        import java.io.IOException;
031:
032:        /**
033:         * The interface for writing HTTP handlers.  Provides basic functionality
034:         * to accept HTTP requests and dispatch to methods to handle the request.
035:         * <p>
036:         * The {@link #init(Server, String)} method is called before this
037:         * <code>Handler</code> processes the first HTTP request, to allow it to
038:         * prepare itself, such as by allocating any resources needed for the
039:         * lifetime of the <code>Handler</code>.
040:         * <p>
041:         * The {@link #respond(Request)} method is called to handle an HTTP request.
042:         * This method and all methods it calls must be thread-safe since they may
043:         * handle HTTP requests from multiple sockets concurrently.  However, each
044:         * concurrent request gets its own individual {@link Request} object.
045:         *
046:         * @author	Stephen Uhler (stephen.uhler@sun.com)
047:         * @author	Colin Stevens (colin.stevens@sun.com)
048:         * @version	1.5, 99/11/17
049:         */
050:
051:        public interface Handler {
052:            /**
053:             * Initializes the handler.
054:             *
055:             * @param	server
056:             *		The HTTP server that created this <code>Handler</code>.
057:             *		Typical <code>Handler</code>s will use {@link Server#props}
058:             *		to obtain run-time configuration information.
059:             *
060:             * @param	prefix
061:             *		A prefix that this <code>Handler</code> may prepend to all
062:             *		of the keys that it uses to extract configuration information
063:             *		from {@link Server#props}.  This is set (by the {@link Server}
064:             *		and {@link ChainHandler}) to help avoid configuration parameter
065:             *		namespace collisions.
066:             *		<p>
067:             *		For example, if a <code>Handler</code> uses the property
068:             *		"account", and the specified prefix is "bank.", then the
069:             *		<code>Handler</code> should actually examine the property
070:             *		"bank.account" in <code>Server.props</code>.
071:             *
072:             * @return	<code>true</code> if this <code>Handler</code> initialized
073:             *		successfully, <code>false</code> otherwise.  If
074:             *		<code>false</code> is returned, this <code>Handler</code>
075:             *		should not be used.
076:             */
077:            boolean init(Server server, String prefix);
078:
079:            /**
080:             * Responds to an HTTP request.
081:             *
082:             * @param	request
083:             *		The <code>Request</code> object that represents the HTTP
084:             *		request.
085:             *
086:             * @return	<code>true</code> if the request was handled.  A request was
087:             *		handled if a response was supplied to the client, typically
088:             *		by calling <code>Request.sendResponse()</code> or
089:             *		<code>Request.sendError</code>.
090:             *
091:             * @throws	IOException
092:             *		if there was an I/O error while sending the response to
093:             *		the client.  Typically, in that case, the <code>Server</code>
094:             *		will (try to) send an error message to the client and then
095:             *		close the client's connection.
096:             *		<p>
097:             *		The <code>IOException</code> should not be used to silently
098:             *		ignore problems such as being unable to access some
099:             *		server-side resource (for example getting a
100:             *		<code>FileNotFoundException</code> due to not being able
101:             *		to open a file).  In that case, the <code>Handler</code>'s
102:             *		duty is to turn that <code>IOException</code> into a
103:             *		HTTP response indicating, in this case, that a file could
104:             *		not be found.
105:             */
106:            boolean respond(Request request) throws IOException;
107:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.