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 | |
|
33 | |
public class PortletWebSession implements WebSession |
34 | |
{ |
35 | |
|
36 | |
private final PortletSession _portletSession; |
37 | |
|
38 | |
public PortletWebSession(final PortletSession portletSession) |
39 | 0 | { |
40 | 0 | Defense.notNull(portletSession, "portletSession"); |
41 | |
|
42 | 0 | _portletSession = portletSession; |
43 | 0 | } |
44 | |
|
45 | |
public void describeTo(DescriptionReceiver receiver) |
46 | |
{ |
47 | 0 | receiver.describeAlternate(_portletSession); |
48 | 0 | } |
49 | |
|
50 | |
public String getId() |
51 | |
{ |
52 | 0 | return _portletSession.getId(); |
53 | |
} |
54 | |
|
55 | |
public boolean isNew() |
56 | |
{ |
57 | 0 | return _portletSession.isNew(); |
58 | |
} |
59 | |
|
60 | |
public List getAttributeNames() |
61 | |
{ |
62 | 0 | return WebUtils.toSortedList(_portletSession.getAttributeNames()); |
63 | |
} |
64 | |
|
65 | |
public Object getAttribute(String name) |
66 | |
{ |
67 | 0 | return _portletSession.getAttribute(name); |
68 | |
} |
69 | |
|
70 | |
public void setAttribute(String name, Object attribute) |
71 | |
{ |
72 | 0 | _portletSession.setAttribute(name, attribute); |
73 | 0 | } |
74 | |
|
75 | |
public void invalidate() |
76 | |
{ |
77 | 0 | _portletSession.invalidate(); |
78 | 0 | } |
79 | |
|
80 | |
|
81 | |
|
82 | |
|
83 | |
public long getCreationTime() |
84 | |
{ |
85 | 0 | return _portletSession.getCreationTime(); |
86 | |
} |
87 | |
|
88 | |
|
89 | |
|
90 | |
|
91 | |
public long getLastAccessedTime() |
92 | |
{ |
93 | 0 | return _portletSession.getLastAccessedTime(); |
94 | |
} |
95 | |
|
96 | |
|
97 | |
|
98 | |
|
99 | |
public int getMaxInactiveInterval() |
100 | |
{ |
101 | 0 | return _portletSession.getMaxInactiveInterval(); |
102 | |
} |
103 | |
|
104 | |
|
105 | |
|
106 | |
|
107 | |
public void setMaxInactiveInterval(int interval) |
108 | |
{ |
109 | 0 | _portletSession.setMaxInactiveInterval(interval); |
110 | 0 | } |
111 | |
|
112 | |
} |