KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > lenya > cms > task > AbstractTask


1 /*
2  * Copyright 1999-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  */

17
18 /* $Id: AbstractTask.java 42598 2004-03-01 16:18:28Z gregor $ */
19
20 package org.apache.lenya.cms.task;
21
22 import org.apache.avalon.framework.parameters.ParameterException;
23 import org.apache.avalon.framework.parameters.Parameters;
24
25
26 public abstract class AbstractTask implements Task {
27     private Parameters parameters = new Parameters();
28
29     /**
30      * DOCUMENT ME!
31      *
32      * @return DOCUMENT ME!
33      */

34     public Parameters getParameters() {
35         Parameters params = new Parameters();
36         params = params.merge(parameters);
37
38         return params;
39     }
40
41     /**
42      * DOCUMENT ME!
43      *
44      * @param parameters DOCUMENT ME!
45      *
46      * @throws ParameterException if the parametrizing fails
47      */

48     public void parameterize(Parameters parameters) throws ParameterException {
49         this.parameters = this.parameters.merge(parameters);
50     }
51
52     /**
53      * DOCUMENT ME!
54      *
55      * @param label DOCUMENT ME!
56      */

57     public void setLabel(String JavaDoc label) {
58     }
59     
60     private int result = SUCCESS;
61
62     /**
63      * @see org.apache.lenya.cms.task.Task#getResult()
64      */

65     public int getResult() {
66         return result;
67     }
68     
69     /**
70      * Sets the result of this task.
71      * @param result An integer ({@link Task#SUCCESS}, {@link Task#FAILURE}).
72      */

73     protected void setResult(int result) {
74         this.result = result;
75     }
76 }
77
Popular Tags