01: /*
02: * Copyright 2002,2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.apache.catalina.mbeans;
18:
19: import javax.management.MBeanException;
20: import javax.management.RuntimeOperationsException;
21: import org.apache.commons.modeler.BaseModelMBean;
22:
23: /**
24: * <p>A convenience base class for <strong>ModelMBean</strong> implementations
25: * where the underlying base class (and therefore the set of supported
26: * properties) is different for varying implementations of a standard
27: * interface. For Catalina, that includes at least the following:
28: * Connector, Logger, Realm, and Valve. This class creates an artificial
29: * MBean attribute named <code>className</code>, which reports the fully
30: * qualified class name of the managed object as its value.</p>
31: *
32: * @author Craig R. McClanahan
33: * @version $Revision: 1.2 $ $Date: 2004/02/27 14:58:44 $
34: */
35:
36: public class ClassNameMBean extends BaseModelMBean {
37:
38: // ---------------------------------------------------------- Constructors
39:
40: /**
41: * Construct a <code>ModelMBean</code> with default
42: * <code>ModelMBeanInfo</code> information.
43: *
44: * @exception MBeanException if the initialize of an object
45: * throws an exception
46: * @exception RuntimeOperationsException if an IllegalArgumentException
47: * occurs
48: */
49: public ClassNameMBean() throws MBeanException,
50: RuntimeOperationsException {
51:
52: super ();
53:
54: }
55:
56: // ------------------------------------------------------------ Properties
57:
58: /**
59: * Return the fully qualified Java class name of the managed object
60: * for this MBean.
61: */
62: public String getClassName() {
63:
64: return (this.resource.getClass().getName());
65:
66: }
67:
68: }
|