public class Server
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
m_hostname |
Constructor and Description |
---|
Server() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getArg(java.lang.String arg)
Returns the value of the specified argument as a string.
|
static boolean |
getArg(java.lang.String arg,
boolean defaultValue)
Returns the value of the specified argument as a boolean.
|
static double |
getArg(java.lang.String arg,
double defaultValue)
Returns the value of the specified argument as a double.
|
static int |
getArg(java.lang.String arg,
int defaultValue)
Returns the value of the specified argument as a integer.
|
static java.lang.String |
getArg(java.lang.String arg,
java.lang.String defaultValue)
Returns the value of the specified argument as a string.
|
static java.lang.String |
getLog() |
static int |
getPort() |
static boolean |
isLogLevelFine() |
static boolean |
isLogLevelFiner() |
static boolean |
isLogLevelFinest()
Use these methods to test if the specified level will actually log anything.
|
static boolean |
isLogLevelInfo() |
static boolean |
isLogLevelSevere() |
static boolean |
isLogLevelWarning() |
static void |
logArgs()
This method sends all the arguments to the log.
|
static java.util.logging.Logger |
logger() |
static void |
logStackTrace(java.lang.Exception exception) |
static void |
logStackTrace(java.util.logging.Level level,
java.lang.Exception exception) |
static void |
logStackTrace(java.util.logging.Level level,
java.lang.String message,
java.lang.Exception exception)
This method should be used to log the entire stack trace to the log file.
|
static void |
logStackTrace(java.util.logging.Level level,
java.lang.String message,
java.lang.StackTraceElement[] trace) |
static void |
logStackTrace(java.util.logging.Level level,
java.lang.String message,
java.lang.Throwable throwable)
This method should be used to log the entire stack trace to the log file.
|
static void |
main(java.lang.String[] args) |
static void |
parseArgs(java.lang.String[] args)
This routine will parse for all args an put them in a map to be recalled from anywhere via any of the getArg()s methods.
|
static void |
setLog(java.lang.String logname) |
public static java.lang.String getLog()
public static void setLog(java.lang.String logname)
public static java.util.logging.Logger logger()
public static void logStackTrace(java.util.logging.Level level, java.lang.String message, java.lang.StackTraceElement[] trace)
level
- The Level to log. Defaults to SEVERE.message
- A message you provide to be logged with the trace.trace
- An array to the stack trace.public static void logStackTrace(java.util.logging.Level level, java.lang.String message, java.lang.Exception exception)
level
- (optional) The Level to log. Defaults to SEVERE.message
- (optional) A message you provide to be logged with the trace.exception
- The exception to get the trace from.public static void logStackTrace(java.util.logging.Level level, java.lang.String message, java.lang.Throwable throwable)
level
- (optional) The Level to log. Defaults to SEVERE.message
- (optional) A message you provide to be logged with the trace.throwable
- The throwable obtained from an exception.public static void logStackTrace(java.util.logging.Level level, java.lang.Exception exception)
public static void logStackTrace(java.lang.Exception exception)
public static boolean isLogLevelFinest()
public static boolean isLogLevelFiner()
public static boolean isLogLevelFine()
public static boolean isLogLevelInfo()
public static boolean isLogLevelWarning()
public static boolean isLogLevelSevere()
public static int getPort()
public static java.lang.String getArg(java.lang.String arg)
arg
- The argument namepublic static java.lang.String getArg(java.lang.String arg, java.lang.String defaultValue)
arg
- The argument namedefaultValue
- The value to use if argument not foundpublic static boolean getArg(java.lang.String arg, boolean defaultValue)
arg
- The argument namedefaultValue
- The value to use if argument not foundpublic static int getArg(java.lang.String arg, int defaultValue)
arg
- The argument namedefaultValue
- The value to use if argument not foundpublic static double getArg(java.lang.String arg, double defaultValue)
arg
- The argument namedefaultValue
- The value to use if argument not foundpublic static void logArgs()
public static void parseArgs(java.lang.String[] args)
The following arguments are used immediately to enable some features:
-level {logLevel}, where logLevel is SEVERE,WARNING,INFO,FINE,FINER,FINEST. Defaults to INFO.
-log {filename}, creates a log file using the -level option in the -userpath directory.
-settings {settingsFilename} The name of the settings file to use. Defaults to settings.txt.
-userpath {userPath}, A path where where users can add their own widgets and apps. It can be a list of directories separated by a semi-colon, just like the PATH environment variable. All paths must be absolute paths, Defaults to "%USERPROFILE%\Documents\SIMRacingApps".
-sendkeysdelay {milliseconds}, changes the delay sendkeys uses. Default is 32ms
-ip {IpAddress}, When users are connected to more than one network, this option forces the server to bind to the specified address instead of the first one.
args
- command line argumentspublic static void main(java.lang.String[] args)