View Javadoc

1   /**
2    * The MIT License
3    *
4    * Copyright 2006-2012 The Codehaus.
5    *
6    * Permission is hereby granted, free of charge, to any person obtaining a copy of
7    * this software and associated documentation files (the "Software"), to deal in
8    * the Software without restriction, including without limitation the rights to
9    * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
10   * of the Software, and to permit persons to whom the Software is furnished to do
11   * so, subject to the following conditions:
12   *
13   * The above copyright notice and this permission notice shall be included in all
14   * copies or substantial portions of the Software.
15   *
16   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22   * SOFTWARE.
23   */
24  package org.codehaus.mojo.appassembler.daemon;
25  
26  import org.apache.maven.artifact.repository.ArtifactRepository;
27  import org.apache.maven.project.MavenProject;
28  import org.codehaus.mojo.appassembler.model.Daemon;
29  
30  import java.io.File;
31  
32  /**
33   * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
34   * @version $Id: DaemonGeneratorService.java 16448 2012-04-22 15:47:18Z khmarbaise $
35   */
36  public interface DaemonGeneratorService
37  {
38      /**
39       * The plexus role.
40       */
41      String ROLE = DaemonGeneratorService.class.getName ( );
42  
43      void generateDaemon ( String platform, File stubDescriptor, File outputDirectory, MavenProject mavenProject,
44              ArtifactRepository localRepository )
45              throws DaemonGeneratorException;
46  
47      void generateDaemon ( String platform, File stubDescriptor, Daemon stubDaemon, File outputDirectory,
48              MavenProject mavenProject, ArtifactRepository localRepository )
49              throws DaemonGeneratorException;
50  
51      void generateDaemon ( DaemonGenerationRequest generationRequest )
52              throws DaemonGeneratorException;
53  
54      Daemon mergeDaemons ( Daemon dominant, Daemon recessive )
55              throws DaemonGeneratorException;
56  
57      Daemon loadModel ( File stubDescriptor )
58              throws DaemonGeneratorException;
59  
60      /**
61       * @param daemon
62       *            The daemon to validate
63       * @param descriptor
64       *            An optional file reference that will be used in the exception messages.
65       * @throws DaemonGeneratorException
66       */
67      void validateDaemon ( Daemon daemon, File descriptor )
68              throws DaemonGeneratorException;
69  }