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 org.apache.commons.logging.Log;
19  import org.apache.commons.logging.LogFactory;
20  
21  /***
22   * A dummy MBean used for the demo
23   *
24   * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
25   * @version $Revision: 1.4 $
26   */
27  public class Dummy implements DummyMBean {
28  
29      /*** The Log to which logging calls will be made. */
30      private static final Log log = LogFactory.getLog(Dummy.class);
31  
32      private String name = "James";
33      private int count;
34  
35      public void doSomething() {
36          ++count;
37          log.info("Do something! on: " + this);
38      }
39  
40      public String toString() {
41          return super.toString() + "[name=" + name + "]";
42      }
43  
44  
45      // Properties
46      //-------------------------------------------------------------------------
47  
48      /***
49       * @return int
50       */
51      public int getCount() {
52          return count;
53      }
54  
55      /***
56       * @return String
57       */
58      public String getName() {
59          return name;
60      }
61  
62      /***
63       * Sets the count.
64       * @param count The count to set
65       */
66      public void setCount(int count) {
67          this.count = count;
68      }
69  
70      /***
71       * Sets the name.
72       * @param name The name to set
73       */
74      public void setName(String name) {
75          this.name = name;
76      }
77  
78  
79  }