KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > portal > wsrp > consumer > GroupSessionImpl


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.wsrp.consumer;
17
18 import org.apache.avalon.framework.logger.Logger;
19 import org.apache.wsrp4j.consumer.PortletSession;
20 import org.apache.wsrp4j.consumer.driver.GenericGroupSessionImpl;
21 import org.apache.wsrp4j.exception.WSRPException;
22
23 /**
24  * Implements a consumer based group session<br/>
25  *
26  * @author <a HREF="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
27  * @author <a HREF="mailto:malessandrini@s-und-n.de">Michel Alessandrini</a>
28  *
29  * @version $Id: GroupSessionImpl.java 264755 2005-08-30 10:29:21Z cziegeler $
30  */

31 public class GroupSessionImpl extends GenericGroupSessionImpl {
32
33     /** The logger. */
34     protected Logger logger;
35
36     /**
37      * Constructs a new <code>GroupSessionImpl</code> object with the given groupID.
38      * The portletServicesURL is needed for implementing the <code>PortletServices</code>
39      * interface.
40      *
41      * @see org.apache.wsrp4j.consumer.PortletServices
42      *
43      * @param groupID
44      * @param markupInterfaceURL
45      * @param logger
46      * @throws WSRPException
47      */

48     public GroupSessionImpl(String JavaDoc groupID, String JavaDoc markupInterfaceURL, Logger logger)
49     throws WSRPException {
50         super(groupID, markupInterfaceURL);
51         this.logger = logger;
52     }
53
54     /**
55     * Get the portlet session object which is identified with
56     * the given instanceKey from the group session. If no portlet session
57     * with that instanceKey exists it depends of the implementation wether
58     * null or a newly created portlet session object is returned.
59     *
60     * @param handle The key which identifies the portlet session object
61     *
62     * @return PortletSession The portlet session with the given key
63     **/

64     public PortletSession getPortletSession(String JavaDoc handle) {
65         if (handle == null) {
66             return null;
67         }
68
69         PortletSession portletSession = (PortletSession)portletSessions.get(handle);
70         if (portletSession == null) {
71             portletSession = new PortletSessionImpl(handle, this.logger);
72             addPortletSession(portletSession);
73         }
74
75         return portletSession;
76     }
77 }
Popular Tags