KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > examples > panorama > startup > impl > Task


1 // Copyright 2004, 2005 The Apache Software Foundation
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15 package org.apache.examples.panorama.startup.impl;
16
17 import org.apache.hivemind.impl.BaseLocatable;
18
19 import org.apache.examples.panorama.startup.Executable;
20
21 /**
22  * An operation that may be executed. A Task exists to wrap an
23  * {@link org.apache.examples.panorama.startup.Executable} object with a title and ordering information (id, after,
24  * before).
25  *
26  * @author Howard Lewis Ship
27  */

28 public class Task extends BaseLocatable implements Executable
29 {
30     private String JavaDoc _id;
31
32     private String JavaDoc _title;
33
34     private String JavaDoc _after;
35
36     private String JavaDoc _before;
37
38     private Executable _executable;
39
40     public String JavaDoc getBefore()
41     {
42         return _before;
43     }
44
45     public String JavaDoc getId()
46     {
47         return _id;
48     }
49
50     public String JavaDoc getAfter()
51     {
52         return _after;
53     }
54
55     public String JavaDoc getTitle()
56     {
57         return _title;
58     }
59
60     public void setExecutable(Executable executable)
61     {
62         _executable = executable;
63     }
64
65     public void setBefore(String JavaDoc string)
66     {
67         _before = string;
68     }
69
70     public void setId(String JavaDoc string)
71     {
72         _id = string;
73     }
74
75     public void setAfter(String JavaDoc string)
76     {
77         _after = string;
78     }
79
80     public void setTitle(String JavaDoc string)
81     {
82         _title = string;
83     }
84
85     /**
86      * Delegates to the {@link #setExecutable(Executable) executable} object.
87      */

88     public void execute() throws Exception JavaDoc
89     {
90         _executable.execute();
91     }
92
93 }
Popular Tags