KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > deployers > spi > management > ManagedPropertyRef


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.deployers.spi.management;
23
24 /**
25  * A management view wrapper of a bean property.
26  *
27  * @author Scott.Stark@jboss.org
28  * @version $Revision$
29  */

30 public class ManagedPropertyRef
31 {
32    /**
33     * A namespace context that maps the managed property onto a managed view
34     * context (e.g., /, /DataSource, /DataSource/Pool).
35     */

36    private String JavaDoc context;
37    /**
38     * The DeploymentBean name which sources the property
39     * @return
40     */

41    private String JavaDoc beanName;
42    /**
43     * The DeploymentBean property name
44     */

45    private String JavaDoc propertyName;
46    /**
47     * An option management view description of the property
48     */

49    private String JavaDoc description;
50
51    /**
52     * Create a managed property ref for the indicated bean property.
53     * @param context
54     * @param beanName
55     * @param propertyName
56     * @param description
57     */

58    public ManagedPropertyRef(String JavaDoc context, String JavaDoc beanName,
59       String JavaDoc propertyName, String JavaDoc description)
60    {
61       this.context = context;
62       this.beanName = beanName;
63       this.propertyName = propertyName;
64       this.description = description;
65    }
66
67    /**
68     * @return Returns the beanName.
69     */

70    public String JavaDoc getBeanName()
71    {
72       return this.beanName;
73    }
74
75    /**
76     * @return Returns the context.
77     */

78    public String JavaDoc getContext()
79    {
80       return this.context;
81    }
82
83    /**
84     * @return Returns the description.
85     */

86    public String JavaDoc getDescription()
87    {
88       return this.description;
89    }
90
91    /**
92     * @return Returns the propertyName.
93     */

94    public String JavaDoc getPropertyName()
95    {
96       return this.propertyName;
97    }
98
99    /**
100     * Equality based on beanName + propertyName
101     */

102    public boolean equals(Object JavaDoc obj)
103    {
104       ManagedPropertyRef ref = (ManagedPropertyRef) obj;
105       boolean equals = beanName.equals(ref.beanName);
106       if( equals )
107       {
108          equals = propertyName.equals(ref.propertyName);
109       }
110       return equals;
111    }
112
113    /**
114     * Hash based on beanName + propertyName
115     */

116    public int hashCode()
117    {
118       return beanName.hashCode() + propertyName.hashCode();
119    }
120 }
121
Popular Tags