1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.pluto.core;
21
22 import javax.portlet.*;
23 import org.apache.pluto.portlet.*;
24
25 public class CoreUtils
26 {
27
28 public static InternalPortletRequest getInternalRequest(PortletRequest request)
29 {
30 while (!(request instanceof InternalPortletRequest))
31 {
32 request = ((PortletRequestWrapper)request).getPortletRequest();
33 if (request == null)
34 {
35 throw new IllegalStateException("The internal portlet request cannot be found.");
36 }
37 }
38 return(InternalPortletRequest)request;
39 }
40
41
42 public static InternalPortletResponse getInternalResponse(PortletResponse response)
43 {
44 while (!(response instanceof InternalPortletResponse))
45 {
46 response = ((PortletResponseWrapper)response).getPortletResponse();
47 if (response == null)
48 {
49 throw new IllegalStateException("The internal portlet response cannot be found.");
50 }
51 }
52 return(InternalPortletResponse)response;
53 }
54
55
56 public static InternalPortletConfig getInternalConfig(PortletConfig config)
57 {
58 return(InternalPortletConfig)config;
59 }
60
61
62 public static InternalPortletContext getInternalContext(PortletContext context)
63 {
64 return(InternalPortletContext)context;
65 }
66
67 }