KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > xml > mbeanserver > MBeanData


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
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.test.xml.mbeanserver;
23
24 import java.util.ArrayList JavaDoc;
25 import java.util.List JavaDoc;
26 import java.util.Map JavaDoc;
27 import java.util.HashMap JavaDoc;
28
29 /**
30  * An encapsulation of the mbean deployment data
31  *
32  * @author Scott.Stark@jboss.org
33  * @version $Revision: 37406 $
34  */

35 public class MBeanData
36 {
37    /** mbean/@name */
38    private String JavaDoc name;
39    /** mbean/@code */
40    private String JavaDoc code;
41    /** mbean/attribute == ArrayList<javax.management.Attribute> */
42    private ArrayList JavaDoc attributes = new ArrayList JavaDoc();
43    /** mbean/depends == ArrayList<javax.management.ObjectName> */
44    private ArrayList JavaDoc depends = new ArrayList JavaDoc();
45
46    public String JavaDoc getName()
47    {
48       
49       return name;
50    }
51
52    public void setName(String JavaDoc name)
53    {
54       this.name = name;
55    }
56
57    public String JavaDoc getCode()
58    {
59       return code;
60    }
61
62    public void setCode(String JavaDoc code)
63    {
64       this.code = code;
65    }
66
67    public List JavaDoc getAttributes()
68    {
69       return attributes;
70    }
71
72    public void setAttributes(List JavaDoc attributes)
73    {
74       this.attributes.clear();
75       this.attributes.addAll(attributes);
76    }
77
78    public List JavaDoc getDepends()
79    {
80       return depends;
81    }
82    public void setDepends(List JavaDoc depends)
83    {
84       this.depends.clear();
85       this.depends.addAll(depends);
86    }
87
88    public Map JavaDoc getAttributeMap()
89    {
90       HashMap JavaDoc map = new HashMap JavaDoc();
91       for(int n = 0; n < attributes.size(); n ++)
92       {
93          MBeanAttribute attr = (MBeanAttribute) attributes.get(n);
94          map.put(attr.getName(), attr);
95       }
96       return map;
97    }
98 }
99
Popular Tags