KickJava   Java API By Example, From Geeks To Geeks.

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


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: TaskWrapper.java 42598 2004-03-01 16:18:28Z gregor $ */
19
20 package org.apache.lenya.cms.task;
21
22 import java.util.Map JavaDoc;
23
24 import org.apache.lenya.xml.NamespaceHelper;
25 import org.w3c.dom.Element JavaDoc;
26
27 /**
28  * A TaskWrapper encapsulates all information that is needed to execute a
29  * certain task, including e.g. workflow and notification parameters.
30  */

31 public interface TaskWrapper {
32     
33     /**
34      * Executes the task.
35      * @throws ExecutionException when something went wrong.
36      */

37     void execute() throws ExecutionException;
38     
39     /**
40      * Saves the wrapper parameters to an XML element.
41      * @param helper The namespace helper of the document.
42      * @return An XML element.
43      */

44     Element JavaDoc save(NamespaceHelper helper);
45     
46     /**
47      * @param helper The namespace helper of the document.
48      * Restores the wrapper parameters from an XML element.
49      * @param element An XML element.
50      */

51     void restore(NamespaceHelper helper, Element JavaDoc element);
52     
53     /**
54      * Returns the task wrapper parameters.
55      * @return A map.
56      */

57     Map JavaDoc getParameters();
58     
59 }
Popular Tags