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.define;
17  
18  import java.util.ArrayList;
19  import java.util.List;
20  
21  import org.apache.commons.logging.Log;
22  import org.apache.commons.logging.LogFactory;
23  
24  //import org.apache.tools.ant.types.FileSet;
25  
26  /***
27   * An example Runnable bean that is framework neutral and just performs
28   * some useful function.
29   *
30   * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
31   * @version $Revision: 1.4 $
32   */
33  public class MyRunnable implements Runnable {
34  
35      /*** The Log to which logging calls will be made. */
36      private static final Log log = LogFactory.getLog(MyRunnable.class);
37  
38      private int x;
39      private String y;
40      private List fileSets = new ArrayList();
41  
42      public MyRunnable() {
43      }
44  
45  
46      // Adder methods
47      //-------------------------------------------------------------------------
48      /*
49  
50      Commented out method to remove test-only dependency on ant
51  
52      public void addFileset(FileSet fileSet) {
53          fileSets.add(fileSet);
54      }
55      */
56  
57      // Runnable interface
58      //-------------------------------------------------------------------------
59      public void run() {
60          log.info( "About to do something where x = " + getX() + " y = " + getY() );
61          log.info( "FileSets are: " + fileSets );
62      }
63  
64  
65      // Properties
66      //-------------------------------------------------------------------------
67      public int getX() {
68          return x;
69      }
70  
71      public void setX(int x) {
72          this.x = x;
73      }
74  
75      public String getY() {
76          return y;
77      }
78  
79      public void setY(String y) {
80          this.y = y;
81      }
82  }