KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > clustering > MBeanImpl


1 /**
2  *
3  * Copyright 2003-2004 The Apache Software Foundation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18 package org.apache.geronimo.clustering;
19
20 import javax.management.MBeanServer JavaDoc;
21 import javax.management.ObjectName JavaDoc;
22
23 import org.apache.commons.logging.Log;
24 import org.apache.commons.logging.LogFactory;
25
26 /**
27  * A base class containing fnality useful to the MBeans of the
28  * Clustering module.
29  *
30  * @version $Rev: 46019 $ $Date: 2004-09-14 02:56:06 -0700 (Tue, 14 Sep 2004) $
31  */

32 public abstract class
33   MBeanImpl
34   //implements GeronimoMBeanTarget
35
{
36   protected Log _log=LogFactory.getLog(MBeanImpl.class);
37   protected ObjectName JavaDoc _objectName;
38   protected MBeanServer JavaDoc _server;
39
40   /**
41    * Return a local reference to this Object. For tight coupling via
42    * JMX (bad idea?).
43    *
44    * @return a <code>Object</code> value
45    */

46   public Object JavaDoc getReference(){return this;}
47
48   //----------------------------------------
49
// GeronimoMBeanTarget
50
//----------------------------------------
51

52   public boolean canStart(){return true;}
53   public boolean canStop(){return true;}
54
55   public void doStart(){}
56   public void doStop(){}
57   public void doFail(){}
58   /*
59   public void
60     setMBeanContext(GeronimoMBeanContext context)
61   {
62     _objectName=(context==null)?null:context.getObjectName();
63     _server =(context==null)?null:context.getServer();
64   }
65   */

66   public ObjectName JavaDoc getObjectName() {return _objectName;}
67   /*
68   public static GeronimoMBeanInfo
69     getGeronimoMBeanInfo()
70   {
71     GeronimoMBeanInfo mbeanInfo=new GeronimoMBeanInfo();
72     // set target class in concrete subclasses...
73     mbeanInfo.addAttributeInfo(new GeronimoAttributeInfo("Reference", true, false, "a local reference to this Object"));
74     return mbeanInfo;
75   }
76   */

77 }
78
Popular Tags