01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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.catalina.mbeans;
19:
20: import javax.management.MBeanException;
21: import javax.management.RuntimeOperationsException;
22:
23: import org.apache.tomcat.util.modeler.BaseModelMBean;
24:
25: /**
26: * <p>A convenience base class for <strong>ModelMBean</strong> implementations
27: * where the underlying base class (and therefore the set of supported
28: * properties) is different for varying implementations of a standard
29: * interface. For Catalina, that includes at least the following:
30: * Connector, Logger, Realm, and Valve. This class creates an artificial
31: * MBean attribute named <code>className</code>, which reports the fully
32: * qualified class name of the managed object as its value.</p>
33: *
34: * @author Craig R. McClanahan
35: * @version $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $
36: */
37:
38: public class ClassNameMBean extends BaseModelMBean {
39:
40: // ---------------------------------------------------------- Constructors
41:
42: /**
43: * Construct a <code>ModelMBean</code> with default
44: * <code>ModelMBeanInfo</code> information.
45: *
46: * @exception MBeanException if the initialize of an object
47: * throws an exception
48: * @exception RuntimeOperationsException if an IllegalArgumentException
49: * occurs
50: */
51: public ClassNameMBean() throws MBeanException,
52: RuntimeOperationsException {
53:
54: super ();
55:
56: }
57:
58: // ------------------------------------------------------------ Properties
59:
60: /**
61: * Return the fully qualified Java class name of the managed object
62: * for this MBean.
63: */
64: public String getClassName() {
65:
66: return (this.resource.getClass().getName());
67:
68: }
69:
70: }
|