001: /*
002: * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
003: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
004: */
005: package com.sun.portal.subscriptions.profiler.cli;
006:
007: import java.util.Map;
008: import java.util.TreeMap;
009: import java.util.Set;
010: import java.util.ResourceBundle;
011: import java.util.PropertyResourceBundle;
012: import java.util.Locale;
013: import java.util.Iterator;
014: import java.util.logging.Level;
015: import java.util.logging.Logger;
016:
017: import java.io.BufferedReader;
018: import java.io.StringReader;
019: import java.io.InputStreamReader;
020: import java.io.File;
021: import java.io.FileReader;
022: import java.io.IOException;
023:
024: import com.sun.portal.desktop.dp.cli.CLIPParser;
025:
026: import com.sun.portal.subscriptions.profiler.ProfilerException;
027: import com.sun.portal.log.common.PortalLogger;
028:
029: /**
030: * Description of the Class
031: *
032: * @author pm95875
033: * @created August 29, 2003
034: */
035: class Profiler {
036:
037: /**
038: * Description of the Field
039: */
040: public final static String COMMANDNAME = "Profiler";
041: /**
042: * Description of the Field
043: */
044: public final static String COMMANDVERSION = "1.0";
045: /**
046: * Description of the Field
047: */
048: public final static String LOG_FILENAME = "profiler.debug";
049: /**
050: * Description of the Field
051: */
052: public final static String DSAME_CACHEON = "com.iplanet.am.sdk.caching.enabled";
053:
054: private static Logger logger = PortalLogger
055: .getLogger(Profiler.class);
056:
057: /**
058: *Constructor for the Profiler object
059: *
060: * @param args Description of the Parameter
061: */
062: Profiler(String[] args) {
063: }
064:
065: /**
066: * The main program for the Profiler class
067: *
068: * @param args The command line arguments
069: */
070: public static void main(String[] args) {
071:
072: Profiler profiler = new Profiler(args);
073:
074: CLIPParser clipp = null;
075: try {
076: ProfilerCmd pc = new ProfilerCmd();
077: clipp = pc.getCLIPParser();
078: ProfilerCmd cmd = new ProfilerCmd(clipp, args);
079: cmd.run();
080: System.exit(0);
081: } catch (ProfilerException pex) {
082: if (profiler.getLogger().isLoggable(Level.SEVERE))
083: profiler.getLogger().log(Level.SEVERE,
084: "PSSS_CSPPC0001", pex.getMessage());
085:
086: System.exit(1);
087: } catch (Exception ex) {
088: // output exception message
089: if (profiler.getLogger().isLoggable(Level.SEVERE))
090: profiler.getLogger().log(Level.SEVERE,
091: "PSSS_CSPPC0001", ex.getMessage());
092: System.exit(1);
093: }
094: }
095:
096: public Logger getLogger() {
097: return logger;
098: }
099:
100: public void setLogger(Logger logger) {
101: this.logger = logger;
102: }
103: }
|