1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| package org.apache.tapestry.portlet; |
16 |
| |
17 |
| import java.util.List; |
18 |
| |
19 |
| import javax.portlet.PortletSession; |
20 |
| |
21 |
| import org.apache.hivemind.util.Defense; |
22 |
| import org.apache.tapestry.describe.DescriptionReceiver; |
23 |
| import org.apache.tapestry.web.WebSession; |
24 |
| import org.apache.tapestry.web.WebUtils; |
25 |
| |
26 |
| |
27 |
| |
28 |
| |
29 |
| |
30 |
| |
31 |
| |
32 |
| public class PortletWebSession implements WebSession |
33 |
| { |
34 |
| private final PortletSession _portletSession; |
35 |
| |
36 |
12
| public PortletWebSession(final PortletSession portletSession)
|
37 |
| { |
38 |
12
| Defense.notNull(portletSession, "portletSession");
|
39 |
| |
40 |
12
| _portletSession = portletSession;
|
41 |
| } |
42 |
| |
43 |
0
| public void describeTo(DescriptionReceiver receiver)
|
44 |
| { |
45 |
0
| receiver.describeAlternate(_portletSession);
|
46 |
| } |
47 |
| |
48 |
2
| public String getId()
|
49 |
| { |
50 |
2
| return _portletSession.getId();
|
51 |
| } |
52 |
| |
53 |
0
| public boolean isNew()
|
54 |
| { |
55 |
0
| return _portletSession.isNew();
|
56 |
| } |
57 |
| |
58 |
2
| public List getAttributeNames()
|
59 |
| { |
60 |
2
| return WebUtils.toSortedList(_portletSession.getAttributeNames());
|
61 |
| } |
62 |
| |
63 |
2
| public Object getAttribute(String name)
|
64 |
| { |
65 |
2
| return _portletSession.getAttribute(name);
|
66 |
| } |
67 |
| |
68 |
2
| public void setAttribute(String name, Object attribute)
|
69 |
| { |
70 |
2
| _portletSession.setAttribute(name, attribute);
|
71 |
| } |
72 |
| |
73 |
2
| public void invalidate()
|
74 |
| { |
75 |
2
| _portletSession.invalidate();
|
76 |
| } |
77 |
| |
78 |
| } |