View Javadoc
1   /*
2    * Copyright (C) 2007-2012 Argeo GmbH
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.argeo.slc.execution;
17  
18  import java.util.Iterator;
19  
20  /** Abstraction of an execution that can be identified and configured. */
21  public interface ExecutionFlow extends Runnable {
22  	/** Retrieve an immutable parameter */
23  	public Object getParameter(String key);
24  
25  	/** Whether this immutable parameter is set */
26  	public Boolean isSetAsParameter(String key);
27  
28  	/** The specifications of the execution flow. */
29  	public ExecutionSpec getExecutionSpec();
30  
31  	/**
32  	 * List sub-runnables that would be executed if run() method would be
33  	 * called.
34  	 */
35  	public Iterator<Runnable> runnables();
36  
37  	/**
38  	 * If there is one and only one runnable wrapped return it, throw an
39  	 * exception otherwise.
40  	 */
41  	public Runnable getRunnable();
42  
43  	/**
44  	 * The name of this execution flow. Can contains '/' which will be
45  	 * interpreted by UIs as a hierarchy;
46  	 */
47  	public String getName();
48  }