%line | %branch | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
org.apache.jetspeed.container.PortletRequestContext |
|
|
1 | /* |
|
2 | * Licensed to the Apache Software Foundation (ASF) under one or more |
|
3 | * contributor license agreements. See the NOTICE file distributed with |
|
4 | * this work for additional information regarding copyright ownership. |
|
5 | * The ASF licenses this file to You under the Apache License, Version 2.0 |
|
6 | * (the "License"); you may not use this file except in compliance with |
|
7 | * the License. You may obtain a copy of the License at |
|
8 | * |
|
9 | * http://www.apache.org/licenses/LICENSE-2.0 |
|
10 | * |
|
11 | * Unless required by applicable law or agreed to in writing, software |
|
12 | * distributed under the License is distributed on an "AS IS" BASIS, |
|
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
14 | * See the License for the specific language governing permissions and |
|
15 | * limitations under the License. |
|
16 | */ |
|
17 | package org.apache.jetspeed.container; |
|
18 | ||
19 | import javax.portlet.Portlet; |
|
20 | import javax.portlet.PortletRequest; |
|
21 | import javax.portlet.PortletResponse; |
|
22 | ||
23 | import org.apache.pluto.om.portlet.PortletDefinition; |
|
24 | ||
25 | public class PortletRequestContext |
|
26 | { |
|
27 | 0 | private static ThreadLocal context = new ThreadLocal(); |
28 | ||
29 | private PortletDefinition pd; |
|
30 | private Portlet portlet; |
|
31 | private PortletRequest request; |
|
32 | private PortletResponse response; |
|
33 | ||
34 | public static PortletRequestContext getContext() |
|
35 | { |
|
36 | 0 | return (PortletRequestContext)context.get(); |
37 | } |
|
38 | ||
39 | public static void createContext(PortletDefinition pd, Portlet portlet, PortletRequest request, PortletResponse response) |
|
40 | { |
|
41 | 0 | context.set(new PortletRequestContext(pd, portlet, request, response)); |
42 | 0 | } |
43 | ||
44 | public static void clearContext() |
|
45 | { |
|
46 | 0 | context.set(null); |
47 | 0 | } |
48 | ||
49 | private PortletRequestContext(PortletDefinition pd, Portlet portlet, PortletRequest request, PortletResponse response) |
|
50 | 0 | { |
51 | 0 | this.pd = pd; |
52 | 0 | this.portlet = portlet; |
53 | 0 | this.request = request; |
54 | 0 | this.response = response; |
55 | 0 | } |
56 | ||
57 | public PortletDefinition getPortletDefinition() |
|
58 | { |
|
59 | 0 | return pd; |
60 | } |
|
61 | ||
62 | public Portlet getPortlet() |
|
63 | { |
|
64 | 0 | return portlet; |
65 | } |
|
66 | ||
67 | public PortletRequest getRequest() |
|
68 | { |
|
69 | 0 | return request; |
70 | } |
|
71 | ||
72 | public PortletResponse getResponse() |
|
73 | { |
|
74 | 0 | return response; |
75 | } |
|
76 | } |
This report is generated by jcoverage, Maven and Maven JCoverage Plugin. |