KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > server > metadata > ApplicationMetaData


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.server.metadata;
10
11 import java.util.Collection JavaDoc;
12 import java.util.HashMap JavaDoc;
13 import java.util.Map JavaDoc;
14
15 import javax.servlet.ServletContext JavaDoc;
16
17 import org.jboss.portal.server.ServerObjectID;
18
19 /**
20  * @author <a HREF="mailto:julien@jboss.org">Julien Viet</a>
21  * @version $Revision: 1.4 $
22  */

23 public class ApplicationMetaData extends ServerObjectMetaData
24 {
25
26    private ServletContext JavaDoc servletContext;
27    private String JavaDoc contextPath;
28    private ClassLoader JavaDoc classLoader;
29    private Map JavaDoc components;
30
31    public ApplicationMetaData(String JavaDoc name,
32                               ServletContext JavaDoc servletContext,
33                               String JavaDoc contextPath,
34                               ClassLoader JavaDoc applicationClassLoader)
35    {
36       super(ServerObjectID.createApplicationID(name), name);
37       this.components = new HashMap JavaDoc();
38       this.servletContext = servletContext;
39       this.contextPath = contextPath;
40       this.classLoader = applicationClassLoader;
41       this.depends.add(ServerObjectID.createPortalContainerID());
42    }
43
44    public void addComponent(ComponentMetaData component)
45    {
46       components.put(component.getName(), component);
47    }
48
49    public ComponentMetaData getComponent(String JavaDoc name)
50    {
51       return (ComponentMetaData)components.get(name);
52    }
53
54    public Collection JavaDoc getComponents()
55    {
56       return components.values();
57    }
58
59    public ServletContext JavaDoc getServletContext()
60    {
61       return servletContext;
62    }
63
64    public String JavaDoc getContextPath()
65    {
66       return contextPath;
67    }
68
69    public ClassLoader JavaDoc getClassLoader()
70    {
71       return classLoader;
72    }
73
74 }
75
Popular Tags