001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041: package org.netbeans.modules.visualweb.jsfsupport.container;
042:
043: import java.io.IOException;
044:
045: import javax.servlet.Servlet;
046: import javax.servlet.ServletConfig;
047: import javax.servlet.ServletException;
048: import javax.servlet.ServletRequest;
049: import javax.servlet.ServletResponse;
050:
051: /**
052: * <p>Rave <em>Servlet</em> for hosting JSF design</p>
053: *
054: * @author Robert Brewin
055: * @version 1.0
056: */
057: public class RaveServlet implements Servlet {
058:
059: /**
060: * Holds the ServletConfig object for this Servlet
061: */
062: private ServletConfig servletConfig;
063:
064: /**
065: * Get the configuration object
066: *
067: * @return the <em>ServletConfig</em> object
068: */
069: public ServletConfig getServletConfig() {
070: return this .servletConfig;
071: }
072:
073: /**
074: * Set the <em>ServletConfig</em> object for this <em>RaveServlet</em>
075: *
076: * @param config The new <em>ServletConfig</em> object
077: */
078: public void setServletConfig(ServletConfig config) {
079: this .servletConfig = config;
080: }
081:
082: /**
083: * Get information about this servlet
084: *
085: * @return the ServletInfo for this mock Servlet
086: */
087: public String getServletInfo() {
088: return "MockServlet";
089: }
090:
091: /**
092: * Construct the basic mock Servlet
093: */
094: public RaveServlet() {
095: }
096:
097: /**
098: * Construct a mock Servlet initialized with a specific ServletConfig object
099: */
100: public RaveServlet(ServletConfig config) throws ServletException {
101: init(config);
102: }
103:
104: /**
105: * Destroy this mock Servlet
106: */
107: public void destroy() {
108: }
109:
110: /**
111: * Initialize this servlet with a specific configuration object
112: *
113: * @param config The <em>ServletConfig</em> object to use
114: *
115: * @exception javax.servlet.ServletException on an error during initialization
116: */
117: public void init(ServletConfig config) throws ServletException {
118: this .servletConfig = config;
119: }
120:
121: /**
122: * Process a given request. At present, this is a <em>no-op</em> for this
123: * mock environment and will throw an <em>UnsupportedOperationException</em>
124: *
125: * @param request The <em>ServletRequest</em> object
126: * @param response The <em>ServletResponse</em> object
127: *
128: * @exception java.io.IOException required by the Servlet interface
129: * @exception javax.servlet.ServletException required by the Servlet interface
130: * @exception java.lang.UnsupportedOperationException thrown if invoked at present
131: */
132: public void service(ServletRequest request, ServletResponse response)
133: throws IOException, ServletException {
134: throw new UnsupportedOperationException();
135: }
136: }
|