View Javadoc

1   /*
2    * Copyright 2002,2004 The Apache Software Foundation.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
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  package org.apache.commons.jelly.tags.jmx;
17  
18  import javax.management.ObjectName;
19  
20  import org.apache.commons.beanutils.ConvertUtils;
21  import org.apache.commons.jelly.tags.bean.BeanTag;
22  import org.apache.commons.jelly.tags.bean.BeanTagLibrary;
23  
24  
25  /***
26   * A Tag library for creating an instantiating Java Beans and MBeans
27   * and registering them with JMX. Support for setting JMX attributes
28   * and invoking JMX operations is also supported.
29   *
30   * @author
31   * @version $Revision: 155420 $
32   */
33  public class JMXTagLibrary extends BeanTagLibrary {
34  
35      static {
36          // register the various beanutils Converters from Strings to various JMX types
37          ConvertUtils.register( new ObjectNameConverter(), ObjectName.class );
38      }
39  
40      public JMXTagLibrary() {
41          registerTag("mbean", BeanTag.class);
42          registerTag("operation", OperationTag.class);
43          registerTag("register", RegisterTag.class);
44          registerTag("server", ServerTag.class);
45      }
46  }