KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > console > manager > interfaces > impl > MBeanResource


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.console.manager.interfaces.impl;
23
24 import org.jboss.console.manager.interfaces.ManageableResource;
25
26 import javax.management.ObjectName JavaDoc;
27
28 /**
29  * <description>
30  *
31  * @see <related>
32  *
33  * @author <a HREF="mailto:sacha.labourey@cogito-info.ch">Sacha Labourey</a>.
34  * @version $Revision: 37459 $
35  *
36  * <p><b>Revisions:</b>
37  *
38  * <p><b>December 16, 2002 Sacha Labourey:</b>
39  * <ul>
40  * <li> First implementation </li>
41  * </ul>
42  */

43
44 public class MBeanResource
45    implements ManageableResource
46 {
47    
48    // Constants -----------------------------------------------------
49

50    // Attributes ----------------------------------------------------
51

52    String JavaDoc className = null;
53    ObjectName JavaDoc oj = null;
54    transient Object JavaDoc mbean = null; // SUPPORT FOR REMOTE MBEANS!!!!
55

56    // Static --------------------------------------------------------
57

58    // Constructors --------------------------------------------------
59

60    public MBeanResource () {}
61    
62    public MBeanResource (ObjectName JavaDoc oj, String JavaDoc clazz)
63    {
64       this.oj = oj;
65       this.className = clazz;
66    }
67    
68    public MBeanResource (ObjectName JavaDoc oj, String JavaDoc clazz, Object JavaDoc proxy)
69    {
70       this.oj = oj;
71       this.className = clazz;
72       this.mbean = proxy;
73    }
74    
75    // Public --------------------------------------------------------
76

77    public String JavaDoc getClassName ()
78    {
79       return this.className;
80    }
81    
82    public ObjectName JavaDoc getObjectName ()
83    {
84       return this.oj;
85    }
86    
87    public Object JavaDoc getMBeanProxy ()
88    {
89       return this.mbean;
90    }
91    
92    // ManageableResource implementation ----------------------------------------------
93

94    public String JavaDoc getId ()
95    {
96       return this.oj.toString ();
97    }
98    
99    // Object overrides ---------------------------------------------------
100

101    public boolean equals (Object JavaDoc other)
102    {
103       if (other instanceof MBeanResource)
104          return this.oj.equals (((MBeanResource)other).oj);
105       else
106          return false;
107    }
108    
109    // Package protected ---------------------------------------------
110

111    // Protected -----------------------------------------------------
112

113    // Private -------------------------------------------------------
114

115    // Inner classes -------------------------------------------------
116

117 }
118
Popular Tags