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;
25  
26  import java.util.ArrayList;
27  import java.util.List;
28  
29  /**
30   * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
31   * @version $Id: Daemon.java 16492 2012-04-29 18:26:21Z khmarbaise $
32   */
33  public class Daemon
34  {
35      private String id;
36  
37      private String mainClass;
38  
39      private String descriptor;
40  
41      private List platforms;
42  
43      private List commandLineArguments;
44  
45      private JvmSettings jvmSettings;
46  
47      private List generatorConfigurations;
48  
49      private boolean showConsoleWindow = true;
50  
51      private String environmentSetupFileName;
52  
53      /**
54       * The daemon id which must be unique.
55       * 
56       * @return The name of the id.
57       */
58      public String getId ()
59      {
60          return id;
61      }
62  
63      /**
64       * The FQN of the main class.
65       * 
66       * @return The name of the main class.
67       */
68      public String getMainClass ()
69      {
70          return mainClass;
71      }
72  
73      /**
74       * The descriptor.
75       * 
76       * @return The descriptor string.
77       */
78      public String getDescriptor ()
79      {
80          return descriptor;
81      }
82  
83      /**
84       * The list of platforms.
85       * 
86       * @return The list of platforms or an empty list if non have been defined before.
87       */
88      public List getPlatforms ()
89      {
90          if ( platforms == null )
91          {
92              platforms = new ArrayList ( );
93          }
94  
95          return platforms;
96      }
97  
98      /**
99       * Get the list of command line arguments.
100      * 
101      * @return The list of command line arguments.
102      */
103     public List getCommandLineArguments ()
104     {
105         return commandLineArguments;
106     }
107 
108     /**
109      * Get the current JVM settings.
110      * 
111      * @return The instance with the current JVM settings back.
112      */
113     public JvmSettings getJvmSettings ()
114     {
115         return jvmSettings;
116     }
117 
118     /**
119      * Return the generator configurations.
120      * 
121      * @return The list of generator configurations.
122      */
123     public List getGeneratorConfigurations ()
124     {
125         return generatorConfigurations;
126     }
127 
128     /**
129      * Return the state of the {@link #showConsoleWindow} flag.
130      * 
131      * @return true if ShowConsoleWindow is active false otherwise.
132      */
133     public boolean isShowConsoleWindow ()
134     {
135         return showConsoleWindow;
136     }
137 
138     /**
139      * The file name as string.
140      * 
141      * @return The environment setup file name.
142      */
143     public String getEnvironmentSetupFileName ()
144     {
145         return environmentSetupFileName;
146     }
147 
148     /**
149      * Define the environment setup file name.
150      * 
151      * @param environmentSetupFileName
152      *            The filename as string.
153      */
154     public void setEnvironmentSetupFileName ( String environmentSetupFileName )
155     {
156         this.environmentSetupFileName = environmentSetupFileName;
157     }
158 
159 }