KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > portal > bridges > ServletContextProviderImpl


1 /*
2  * Copyright 2005 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.cocoon.portal.bridges;
17
18 import javax.portlet.GenericPortlet;
19 import javax.portlet.PortletRequest;
20 import javax.portlet.PortletResponse;
21 import javax.servlet.ServletContext JavaDoc;
22 import javax.servlet.http.HttpServletRequest JavaDoc;
23 import javax.servlet.http.HttpServletRequestWrapper JavaDoc;
24 import javax.servlet.http.HttpServletResponse JavaDoc;
25 import javax.servlet.http.HttpServletResponseWrapper JavaDoc;
26
27 import org.apache.pluto.core.impl.PortletContextImpl;
28 import org.apache.portals.bridges.common.ServletContextProvider;
29
30 /**
31  * This is the "bridge" to the bridges project.
32  *
33  * @version $Id: ServletContextProviderImpl.java 264772 2005-08-30 12:57:18Z cziegeler $
34  */

35 public class ServletContextProviderImpl implements ServletContextProvider {
36
37     /**
38      * @see org.apache.portals.bridges.common.ServletContextProvider#getHttpServletRequest(javax.portlet.GenericPortlet, javax.portlet.PortletRequest)
39      */

40     public HttpServletRequest JavaDoc getHttpServletRequest(GenericPortlet portlet, PortletRequest request) {
41         return (HttpServletRequest JavaDoc) ((HttpServletRequestWrapper JavaDoc) request).getRequest();
42     }
43
44     /**
45      * @see org.apache.portals.bridges.common.ServletContextProvider#getHttpServletResponse(javax.portlet.GenericPortlet, javax.portlet.PortletResponse)
46      */

47     public HttpServletResponse JavaDoc getHttpServletResponse(GenericPortlet portlet, PortletResponse response) {
48         return (HttpServletResponse JavaDoc) ((HttpServletResponseWrapper JavaDoc) response).getResponse();
49     }
50
51     /**
52      * @see org.apache.portals.bridges.common.ServletContextProvider#getServletContext(javax.portlet.GenericPortlet)
53      */

54     public ServletContext JavaDoc getServletContext(GenericPortlet portlet) {
55         return ((PortletContextImpl)portlet.getPortletContext()).getServletContext();
56     }
57
58 }
59
Popular Tags