KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > savant > Process


1 /*
2  * Copyright (c) 2003-2004, Inversoft, All Rights Reserved
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.savant;
8
9
10 import java.io.File JavaDoc;
11
12
13 /**
14  * <p>
15  * This interface is a workflow processor that is used to
16  * locate artifacts that a project depends on.
17  * </p>
18  *
19  * @author Brian Pontarelli
20  */

21 public interface Process {
22
23     /**
24      * <p>
25      * This method attempts to locate the dependencies of the given Artifact using
26      * the an XML dependency file. If the process can resolve the dependency it
27      * should update the given artifact and return true.
28      * </p>
29      *
30      * @param artifact The artifact to update with the resolved dependencies.
31      * @param localCache The local cache store to cache the dependency XML file
32      * if it is resolved.
33      * @return True if the artifact was updated, false otherwise.
34      * @throws SavantException If the resolution failed or the XML was corrupt.
35      */

36     boolean resolveArtifactDependencies(Artifact artifact, LocalCacheStore localCache)
37     throws SavantException;
38
39     /**
40      * <p>
41      * Attempts to fetch the artifact using the definition given. If the artifact
42      * can be found, it is first copied to the localCache using the LocalCacheStore
43      * interface given. After it has been stored locally, it is returned as a File
44      * object to the locally cached copy.
45      * </p>
46      *
47      * @param artifact The artifact to locate
48      * @param localCache The LocalCacheStore interface that must be called in
49      * order to store a local copy of the artifact.
50      * @return The file that references the artifact from the localCache
51      */

52     File JavaDoc fetch(Artifact artifact, LocalCacheStore localCache)
53     throws SavantException;
54
55     /**
56      * Validates that the process is configured correctly.
57      *
58      * @throws SavantException If the process is not configured correctly
59      */

60     void validate() throws SavantException;
61 }
Popular Tags