01: /* tjws - Main.java
02: * Copyright (C) 1999-2007 Dmitriy Rogatkin. All rights reserved.
03: * Redistribution and use in source and binary forms, with or without
04: * modification, are permitted provided that the following conditions
05: * are met:
06: * 1. Redistributions of source code must retain the above copyright
07: * notice, this list of conditions and the following disclaimer.
08: * 2. Redistributions in binary form must reproduce the above copyright
09: * notice, this list of conditions and the following disclaimer in the
10: * documentation and/or other materials provided with the distribution.
11: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
12: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
13: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
14: * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
15: * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
16: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
17: * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
18: * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
19: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
20: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
21: * SUCH DAMAGE.
22: *
23: * Visit http://tjws.sourceforge.net to get the latest infromation
24: * about Rogatkin's products.
25: * $Id: Main.java,v 1.2 2007/04/19 05:38:06 rogatkin Exp $
26: * Created on Mar 27, 2007
27: * @author Dmitriy
28: */
29: package rogatkin.app;
30:
31: import javax.naming.Context;
32:
33: public class Main {
34:
35: /**
36: * @param args
37: */
38: public static void main(String[] args) {
39: if (System.getProperty(Context.INITIAL_CONTEXT_FACTORY) == null)
40: System.getProperties().setProperty(
41: Context.INITIAL_CONTEXT_FACTORY,
42: "rogatkin.app.SimpleJndi");
43: if (args.length == 0)
44: args = Acme.Serve.Main.readArguments(System.getProperty(
45: "user.dir", "."), Acme.Serve.Main.CLI_FILENAME);
46: for (int i = 0; i < args.length; i++) {
47: if ("-dataSource".equals(args[i])) {
48: new SimpleDataSource(args[++i]);
49: }
50: }
51: Acme.Serve.Main.main(args);
52: }
53: }
|