edu.upenn.crimson
Class CrimsonMain

java.lang.Object
  extended by edu.upenn.crimson.CrimsonMain

public class CrimsonMain
extends java.lang.Object

CrimsonMain program.

Version:
$Id: CrimsonMain.java,v 1.57 2009/07/25 01:05:46 fisher Exp $

Field Summary
static org.python.util.InteractiveConsole console
           
private static java.sql.Connection dbConnection
          This is a reference to the actual database connection.
static boolean ISBATCH
          Batch mode.
static boolean ISDOS
          Dos interpreter.
static boolean NOX
          No X11 or similar windowing environment.
static java.lang.Runtime runtime
           
static java.util.prefs.Preferences userDefaults
          User established properties.
static boolean WALRUS
          Connect to Walrus.
 
Constructor Summary
CrimsonMain()
           
 
Method Summary
static void _runGC()
           
static java.lang.String createString(int length)
           
static boolean exec(java.lang.String cmd)
          On Windows machines, exec() requires "cmd /c" to envoke the command prompt.
static boolean exec(java.lang.String cmd, boolean printOutput)
           
static boolean execFull(java.lang.String cmd, boolean wait)
          On Windows machines, exec() requires "cmd /c" to envoke the command prompt.
static void exit(int code)
           
static java.lang.String getExec(java.lang.String cmd)
           
static java.lang.String getExec(java.lang.String cmd, boolean incError)
           
static java.lang.String getSystemProperty(java.lang.String property)
           
static void main(java.lang.String[] args)
           
static void runGC()
           
static void setConnection(java.sql.Connection conn)
          Set the DBConnection.
static void setSystemProperty(java.lang.String property, java.lang.String value)
           
static void sizeOf()
          A simple class to experiment with your JVM's garbage collector and memory sizes for various data types.
static void testConn(java.lang.String dbType, java.lang.String server, java.lang.String port, java.lang.String database, java.lang.String user, java.lang.String passwd)
          This method can be used to test encryption and checksum connection schemes.
static void testProxy(java.lang.String server, java.lang.String database, java.lang.String user, java.lang.String passwd, java.lang.String sql)
           
static long usedMemory()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

console

public static final org.python.util.InteractiveConsole console

runtime

public static final java.lang.Runtime runtime

ISDOS

public static boolean ISDOS
Dos interpreter.


ISBATCH

public static boolean ISBATCH
Batch mode.


WALRUS

public static boolean WALRUS
Connect to Walrus.


NOX

public static boolean NOX
No X11 or similar windowing environment.


dbConnection

private static java.sql.Connection dbConnection
This is a reference to the actual database connection.


userDefaults

public static java.util.prefs.Preferences userDefaults
User established properties.

Constructor Detail

CrimsonMain

public CrimsonMain()
Method Detail

main

public static void main(java.lang.String[] args)
                 throws org.python.core.PyException
Parameters:
args - Command line arguments.
Throws:
org.python.core.PyException

setConnection

public static void setConnection(java.sql.Connection conn)
Set the DBConnection.


exit

public static void exit(int code)

testProxy

public static void testProxy(java.lang.String server,
                             java.lang.String database,
                             java.lang.String user,
                             java.lang.String passwd,
                             java.lang.String sql)

testConn

public static void testConn(java.lang.String dbType,
                            java.lang.String server,
                            java.lang.String port,
                            java.lang.String database,
                            java.lang.String user,
                            java.lang.String passwd)
This method can be used to test encryption and checksum connection schemes.


exec

public static boolean exec(java.lang.String cmd)
On Windows machines, exec() requires "cmd /c" to envoke the command prompt. The boolean ISDOS is defaulted to false but can be set manually or via the command line. This returns true if the command ran successfully and false if the command returned a non 0 exit code or any exceptions occurred.

Notes:
BufferedInputStream.available() should say if there is data in the stream but it doesn't seem to work correctly. It seems that in many conditions you must first read from the stream which is not useful., ISDOS should be a parameter., Linux used to require "sh -c" but doesn't anymore. Not sure why.

exec

public static boolean exec(java.lang.String cmd,
                           boolean printOutput)

getExec

public static java.lang.String getExec(java.lang.String cmd)

getExec

public static java.lang.String getExec(java.lang.String cmd,
                                       boolean incError)

execFull

public static boolean execFull(java.lang.String cmd,
                               boolean wait)
On Windows machines, exec() requires "cmd /c" to envoke the command prompt. The boolean ISDOS is defaulted to false but can be set manually or via the command line. This returns true if the command ran successfully and false if the command returned a non 0 exit code or any exceptions occurred.

Notes:
ISDOS should be a parameter.

getSystemProperty

public static java.lang.String getSystemProperty(java.lang.String property)

setSystemProperty

public static void setSystemProperty(java.lang.String property,
                                     java.lang.String value)

sizeOf

public static void sizeOf()
A simple class to experiment with your JVM's garbage collector and memory sizes for various data types.


createString

public static java.lang.String createString(int length)

runGC

public static void runGC()

_runGC

public static void _runGC()

usedMemory

public static long usedMemory()



Copyright 2006 Stephen Fisher, Susan Davidson, and Junhyong Kim, University of Pennsylvania.