KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > portlet > PortletApplication


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Distributable under LGPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  *****************************************/

9 package org.jboss.portal.portlet;
10
11 import java.util.Map JavaDoc;
12
13 import javax.portlet.PortletContext;
14
15 import org.jboss.portal.portlet.impl.PortletContextImpl;
16 import org.jboss.portal.portlet.metadata.PortletApplicationMetaData;
17 import org.jboss.portal.server.Application;
18
19 /**
20  * @author <a HREF="mailto:julien@jboss.org">Julien Viet</a>
21  * @version $Revision: 1.2 $
22  */

23 public class PortletApplication extends Application
24 {
25
26    private PortletApplicationMetaData portletApplicationMD;
27    private PortletContext portletContext;
28    private String JavaDoc version;
29    private Map JavaDoc portletModes;
30    private Map JavaDoc windowStates;
31
32    public PortletApplication(String JavaDoc name, PortletApplicationMetaData portletApplicationMD)
33    {
34       super(name, portletApplicationMD);
35       this.portletApplicationMD = portletApplicationMD;
36    }
37
38    public void create() throws Exception JavaDoc
39    {
40       version = portletApplicationMD.getVersion();
41       portletModes = portletApplicationMD.getPortletModes();
42       windowStates = portletApplicationMD.getWindowStates();
43       portletContext = new PortletContextImpl(servletContext);
44    }
45
46    public void destroy()
47    {
48       version = null;
49       portletModes = null;
50       windowStates = null;
51       portletContext = null;
52    }
53
54    public String JavaDoc getVersion()
55    {
56       return version;
57    }
58
59    public PortletContext getPortletContext()
60    {
61       return portletContext;
62    }
63
64    public Map JavaDoc getPortletModes()
65    {
66       return portletModes;
67    }
68
69    public Map JavaDoc getWindowStates()
70    {
71       return windowStates;
72    }
73 }
74
Popular Tags