01: // Copyright 2004, 2005 The Apache Software Foundation
02: //
03: // Licensed under the Apache License, Version 2.0 (the "License");
04: // you may not use this file except in compliance with the License.
05: // You may obtain a copy of the License at
06: //
07: // http://www.apache.org/licenses/LICENSE-2.0
08: //
09: // 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: private String _id;
30:
31: private String _title;
32:
33: private String _after;
34:
35: private String _before;
36:
37: private Executable _executable;
38:
39: public String getBefore() {
40: return _before;
41: }
42:
43: public String getId() {
44: return _id;
45: }
46:
47: public String getAfter() {
48: return _after;
49: }
50:
51: public String getTitle() {
52: return _title;
53: }
54:
55: public void setExecutable(Executable executable) {
56: _executable = executable;
57: }
58:
59: public void setBefore(String string) {
60: _before = string;
61: }
62:
63: public void setId(String string) {
64: _id = string;
65: }
66:
67: public void setAfter(String string) {
68: _after = string;
69: }
70:
71: public void setTitle(String string) {
72: _title = string;
73: }
74:
75: /**
76: * Delegates to the {@link #setExecutable(Executable) executable} object.
77: */
78: public void execute() throws Exception {
79: _executable.execute();
80: }
81:
82: }
|