View Javadoc

1   /*
2    Copyright (C) 2007 Grid Systems, S.A.
3   
4    This library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Lesser General Public
6    License as published by the Free Software Foundation; either
7    version 2.1 of the License, or (at your option) any later version.
8   
9    This library is distributed in the hope that it will be useful,
10   but WITHOUT ANY WARRANTY; without even the implied warranty of
11   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12   Lesser General Public License for more details.
13  
14   You should have received a copy of the GNU Lesser General Public
15   License along with this library; if not, write to the Free Software
16   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
17  */
18  package nextgrid.api.pom;
19  
20  import java.util.Collection;
21  import java.util.List;
22  
23  /**
24   * An AbstractProcess represents a process with no implementation binding
25   * details, but only semantic information that can be used to discover compliant
26   * implementations through the grid.
27   * <p>
28   * Such an abstract process must be fulfilled with binding information or
29   * "replaced" by a more specific, yet still abstract, process during enaction.
30   * This replacement is really implemented through a child containment structure
31   * to prevent losing original semantic data: In case of error, the enactor must
32   * be able to revert to the original abstract description and repeat the
33   * discovery phase to reach an alternative service provider.
34   * <p>
35   * The presence of instances of this class within a workflow representation
36   * as leaf nodes marks this workflow as abstract, meaning that it will require
37   * some extra process before being "executable".
38   * <p>
39   * In OWL-WS terms, an AbstractProcessImpl can be mapped to a service that only
40   * contains a profile, but no grounding; that is, it only states service
41   * constraints, but no capabilities.
42   * <p>
43   * During the evaluation of an AbstractProcess, candidates are searched for
44   * its implementation. After that, the process will contain a list of
45   * candidates, all of which link to the abstract process as their parent.
46   * However, unlike ControlProcess, only one of them will be selected at a given
47   * point in time.
48   *
49   * @author Rodrigo Ruiz
50   */
51  public interface AbstractProcess extends Process {
52  
53    /**
54     * Priority value used for processes without an assigned priority.
55     */
56    int UNDEFINED_PRIORITY = -1;
57  
58    //----------------------------------------------------------------------------
59    // Process Hierarchy Management
60    //----------------------------------------------------------------------------
61  
62    /**
63     * Gets the list of candidates for this abstract process.
64     *
65     * @return The list of candidates for this process
66     */
67    List<Process> getCandidates();
68  
69    /**
70     * Sets the list of candidates for this abstract process.
71     *
72     * @param candidates The list of candidates
73     */
74    void setCandidates(Collection<Process> candidates);
75  
76    /**
77     * Gets the currently selected implementation candidate.
78     *
79     * @return The candidate process currently selected
80     */
81    Process getSelected();
82  
83    /**
84     * Selects the specified process as the implementation of this instance.
85     *
86     * @param p The process to select
87     */
88    void setSelected(Process p);
89  
90    //----------------------------------------------------------------------------
91    // Enaction Management
92    //----------------------------------------------------------------------------
93  
94    /**
95     * Gets the current priority of this process.
96     *
97     * @return The process priority
98     */
99    int getPriority();
100 
101   /**
102    * Sets the priority of this process.
103    *
104    * @param priority The process priority
105    */
106   void setPriority(int priority);
107 
108   /**
109    * Gets the profile model associated to this instance.
110    *
111    * @return The profile model
112    */
113   QueryProfile getProfile();
114 
115   /**
116    * Sets the profile model associated to this instance.
117    *
118    * @param profile The profile model
119    */
120   void setProfile(QueryProfile profile);
121 }