/**
 * Protocols test
 * Copyright (C) 2007 Bull S.A.S.
 * Contact: jonas-team@objectweb.org
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 * --------------------------------------------------------------------------
 * $Id$
 * --------------------------------------------------------------------------
 */

package org.ow2.jonas.protocols.test.client;

public class AnyClient {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		int client = 0;
		if (args.length > 0) {
			if ("-help".equalsIgnoreCase(args[0])) {
				printUsage();
				System.exit(0);
			}
			// a bit of serialization
			if ("multi".equalsIgnoreCase(args[0])) client = 0;
			 // a lot of serialization
			if ("multiserial".equalsIgnoreCase(args[0])) client = 1;
			if (args.length > 1 ) {
				nargs = new String[args.length - 1];
				for (int i = 0; i < nargs.length; i++) nargs[i] = args[i + 1];
			}
		}

		switch (client) {
		case 0:
			MyClient.main(nargs);
			break;
		case 1:
			MyClient01.main(nargs);
			break;
		}

	}

	private static void printUsage() {
		System.out.println ("OPTIONS:");
		System.out.println ("- multi/multiserial");
		System.out.println ("- multi clients iterations thinktime");
		System.out.println ("- multiserial clients iterations thinktime [ Remote | CreateRemote | LookupCreateRemote ]");
	}

	private static String[] nargs = new String[] { };
}
