KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > deployers > plugins > structure > ContextInfoImpl


1 /*
2  * JBoss, Home of Professional Open Source
3  * Copyright 2006, Red Hat Middleware LLC, and individual contributors
4  * by the @authors tag. See the copyright.txt in the distribution for a
5  * full listing of individual contributors.
6  *
7  * This is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as
9  * published by the Free Software Foundation; either version 2.1 of
10  * the License, or (at your option) any later version.
11  *
12  * This software is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this software; if not, write to the Free
19  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21  */

22 package org.jboss.deployers.plugins.structure;
23
24 import java.io.Serializable JavaDoc;
25 import java.util.ArrayList JavaDoc;
26 import java.util.List JavaDoc;
27
28 import org.jboss.deployers.spi.structure.vfs.ClassPathInfo;
29 import org.jboss.deployers.spi.structure.vfs.ContextInfo;
30
31 /**
32  * Represents a deployment context in the vfs.
33  *
34  * @author Scott.Stark@jboss.org
35  * @version $Revision:$
36  */

37 public class ContextInfoImpl
38    implements ContextInfo, Serializable JavaDoc
39 {
40    private static final long serialVersionUID = 1;
41
42    private String JavaDoc vfsPath;
43    private String JavaDoc metaDataPath;
44    private ContextInfo parent;
45    private ArrayList JavaDoc<ClassPathInfo> classpath = new ArrayList JavaDoc<ClassPathInfo>();
46
47    public ContextInfoImpl()
48    {
49       this(null);
50    }
51    public ContextInfoImpl(String JavaDoc vfsPath)
52    {
53       setVfsPath(vfsPath);
54    }
55    public ContextInfoImpl(String JavaDoc vfsPath, ContextInfo parent)
56    {
57       setVfsPath(vfsPath);
58       setParent(parent);
59    }
60
61    public ContextInfo getParent()
62    {
63       return parent;
64    }
65    public void setParent(ContextInfo parent)
66    {
67       this.parent = parent;
68    }
69
70    public String JavaDoc getVfsPath()
71    {
72       return vfsPath;
73    }
74    public void setVfsPath(String JavaDoc path)
75    {
76       this.vfsPath = path;
77    }
78
79    public String JavaDoc getMetaDataPath()
80    {
81       return metaDataPath;
82    }
83    public void setMetaDataPath(String JavaDoc metaDataPath)
84    {
85       this.metaDataPath = metaDataPath;
86    }
87
88    public List JavaDoc<ClassPathInfo> getClassPath()
89    {
90       return classpath;
91    }
92    public void setClassPath(List JavaDoc<ClassPathInfo> classpath)
93    {
94       this.classpath.clear();
95       this.classpath.addAll(classpath);
96    }
97    public void addClassPathInfo(ClassPathInfo info)
98    {
99       classpath.add(info);
100    }
101
102    public String JavaDoc toString()
103    {
104       StringBuilder JavaDoc tmp = new StringBuilder JavaDoc(super.toString());
105       tmp.append('(');
106       tmp.append(this.getVfsPath());
107       tmp.append(')');
108       return tmp.toString();
109    }
110 }
111
Popular Tags