View Javadoc
1   package org.codehaus.mojo.appassembler;
2   
3   /*
4    * The MIT License
5    *
6    * Copyright (c) 2006-2012, The Codehaus
7    *
8    * Permission is hereby granted, free of charge, to any person obtaining a copy of
9    * this software and associated documentation files (the "Software"), to deal in
10   * the Software without restriction, including without limitation the rights to
11   * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
12   * of the Software, and to permit persons to whom the Software is furnished to do
13   * so, subject to the following conditions:
14   *
15   * The above copyright notice and this permission notice shall be included in all
16   * copies or substantial portions of the Software.
17   *
18   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24   * SOFTWARE.
25   */
26  
27  import java.util.ArrayList;
28  import java.util.List;
29  
30  /**
31   * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
32   * @version $Id$
33   */
34  public class Daemon
35  {
36      private String id;
37  
38      private String mainClass;
39  
40      private String wrapperMainClass = "org.tanukisoftware.wrapper.WrapperSimpleApp";
41  
42      private String descriptor;
43  
44      private List<String> platforms;
45  
46      private List<String> commandLineArguments;
47  
48      private String configurationDirectory;
49  
50      private JvmSettings jvmSettings;
51  
52      private List<GeneratorConfiguration> generatorConfigurations;
53  
54      private String licenseHeaderFile;
55  
56      private String repositoryName;
57  
58      private boolean showConsoleWindow = true;
59  
60      private String environmentSetupFileName;
61  
62      private String endorsedDir;
63  
64      private String preWrapperConf;
65  
66      private String wrapperLogFile;
67  
68      /**
69       * The daemon id which must be unique.
70       *
71       * @return The name of the id.
72       */
73      public String getId()
74      {
75          return id;
76      }
77  
78      /**
79       * The FQN of the main class.
80       *
81       * @return The name of the main class.
82       */
83      public String getMainClass()
84      {
85          return mainClass;
86      }
87  
88      /**
89       * Wrapper main class
90       *
91       * @return classname of wrapper main class
92       */
93      public String getWrapperMainClass()
94      {
95          return wrapperMainClass;
96      }
97  
98      /**
99       * The descriptor.
100      *
101      * @return The descriptor string.
102      */
103     public String getDescriptor()
104     {
105         return descriptor;
106     }
107 
108     /**
109      * The list of platforms.
110      *
111      * @return The list of platforms or an empty list if non have been defined before.
112      */
113     public List<String> getPlatforms()
114     {
115         if ( platforms == null )
116         {
117             platforms = new ArrayList<String>();
118         }
119 
120         return platforms;
121     }
122 
123     /**
124      * Get the list of command line arguments.
125      *
126      * @return The list of command line arguments.
127      */
128     public List<String> getCommandLineArguments()
129     {
130         return commandLineArguments;
131     }
132 
133     /**
134      * Return the configuration directory.
135      *
136      * @return The configuration directory.
137      */
138     public String getConfigurationDirectory()
139     {
140         return configurationDirectory;
141     }
142 
143     /**
144      * Get the current JVM settings.
145      *
146      * @return The instance with the current JVM settings back.
147      */
148     public JvmSettings getJvmSettings()
149     {
150         return jvmSettings;
151     }
152 
153     /**
154      * Return the generator configurations.
155      *
156      * @return The list of generator configurations.
157      */
158     public List<GeneratorConfiguration> getGeneratorConfigurations()
159     {
160         return generatorConfigurations;
161     }
162 
163     /**
164      * Return the name of the license header file.
165      *
166      * @return The name of the license header file.
167      */
168     public String getLicenseHeaderFile()
169     {
170         return licenseHeaderFile;
171     }
172 
173     /**
174      * Return the repository name.
175      *
176      * @return The repository name.
177      */
178     public String getRepositoryName()
179     {
180         return repositoryName;
181     }
182 
183     /**
184      * Return the state of the {@link #showConsoleWindow} flag.
185      *
186      * @return true if ShowConsoleWindow is active false otherwise.
187      */
188     public boolean isShowConsoleWindow()
189     {
190         return showConsoleWindow;
191     }
192 
193     /**
194      * The file name as string.
195      *
196      * @return The environment setup file name.
197      */
198     public String getEnvironmentSetupFileName()
199     {
200         return environmentSetupFileName;
201     }
202 
203     /**
204      * Define the environment setup file name.
205      *
206      * @param environmentSetupFileName The filename as string.
207      */
208     public void setEnvironmentSetupFileName( String environmentSetupFileName )
209     {
210         this.environmentSetupFileName = environmentSetupFileName;
211     }
212 
213     /**
214      * The directory where endorsed libraries can be found.
215      *
216      * @return The directory where endorsed libraries can be found.
217      */
218     public String getEndorsedDir()
219     {
220         return endorsedDir;
221     }
222 
223     /**
224      * Define the endorsed directory where optional jars will be loaded.
225      *
226      * @param endorsedDir The name of the endorsed directory.
227      */
228     public void setEndorsedDir( String endorsedDir )
229     {
230         this.endorsedDir = endorsedDir;
231     }
232 
233     public String getPreWrapperConf()
234     {
235         return preWrapperConf;
236     }
237 
238     public void setPreWrapperConf( String preWrapperConf )
239     {
240         this.preWrapperConf = preWrapperConf;
241     }
242 
243     public String getWrapperLogFile()
244     {
245         return wrapperLogFile;
246     }
247 
248     public void setWrapperLogFile( String wrapperLogFile )
249     {
250         this.wrapperLogFile = wrapperLogFile;
251     }
252 
253 }