01: /*
02: Copyright (C) 2004 David Bucciarelli (davibu@interfree.it)
03:
04: This program is free software; you can redistribute it and/or
05: modify it under the terms of the GNU General Public License
06: as published by the Free Software Foundation; either version 2
07: of the License, or (at your option) any later version.
08:
09: This program 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
12: GNU General Public License for more details.
13:
14: You should have received a copy of the GNU General Public License
15: along with this program; if not, write to the Free Software
16: Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17: */
18:
19: package org.homedns.dade.jcgrid.cmd.povray;
20:
21: import java.io.*;
22: import java.util.*;
23:
24: import org.apache.log4j.*;
25: import org.apache.commons.cli.*;
26:
27: import org.homedns.dade.jcgrid.*;
28: import org.homedns.dade.jcgrid.cmd.*;
29: import org.homedns.dade.jcgrid.server.*;
30:
31: public class JCGridServer {
32: private final static String className = JCGridServer.class
33: .getName();
34: private static Logger log = Logger.getLogger(className);
35: private static Logger logDetail = Logger.getLogger("DETAIL."
36: + className);
37:
38: public static void main(String[] args) {
39: try {
40: // Setup log4j
41:
42: MainCmd.setUpLog4J("server", true);
43:
44: // Setup GridServer
45:
46: log.warn("-----------------------------------------------");
47: log.warn("-- JCGridServer POVRay v" + Version.RELEASE);
48: log.warn("-----------------------------------------------");
49:
50: GridServer gs = new GridServer();
51:
52: // Parse command line options
53:
54: Options options = new Options();
55: try {
56: CommandLine cmd = MainCmd.parseCommonOptions(options,
57: gs.getNodeConfig(), args);
58:
59: if (cmd.getArgs().length > 0)
60: throw new Exception("Unknown command line option");
61: } catch (Exception ex) {
62: log.warn("Error while parsing command line", ex);
63:
64: HelpFormatter formatter = new HelpFormatter();
65: formatter.printHelp("JCGridServer", options);
66:
67: System.exit(0);
68: }
69:
70: // Start Server
71:
72: gs.start();
73:
74: log.warn("Running...");
75: } catch (Exception ex) {
76: log.warn("Error", ex);
77: System.exit(0);
78: }
79: }
80: }
|