edu.ou.mlfw.ladder
Class LadderServer

java.lang.Object
  extended by edu.ou.mlfw.ladder.LadderServer

public class LadderServer
extends java.lang.Object


Nested Class Summary
static class LadderServer.Arguments
          A throwaway class that encapsulates the command line arguments for World.
 
Field Summary
static java.lang.String DEFAULT_CONFIG
           
static int DEFAULT_PORT
           
 
Constructor Summary
LadderServer(LadderConfig ladderconfig, int serverPort)
           
 
Method Summary
static void exit(java.lang.String exitMessage)
          Exits the program with usage instructions.
static java.lang.Object fromXML(com.thoughtworks.xstream.XStream xstream, java.io.File location)
          Given a configuration's File location and its Class, instantiate an instance of that configuration from the xml file.
static void main(java.lang.String[] args)
           
static LadderServer.Arguments parseArgs(java.lang.String[] args)
          Handle the command-line arguments passed to an invocation of World.
 void run()
           
 void writeHTML()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CONFIG

public static final java.lang.String DEFAULT_CONFIG
See Also:
Constant Field Values

DEFAULT_PORT

public static final int DEFAULT_PORT
See Also:
Constant Field Values
Constructor Detail

LadderServer

public LadderServer(LadderConfig ladderconfig,
                    int serverPort)
Method Detail

run

public void run()

writeHTML

public void writeHTML()

main

public static void main(java.lang.String[] args)

parseArgs

public static LadderServer.Arguments parseArgs(java.lang.String[] args)
Handle the command-line arguments passed to an invocation of World. Generates an Arguments object, which is a simple encapsulation of the relevant command-line options and values into an object.

Parameters:
args - The arguments string.
Returns:
An instance of Arguments encapsulating the relevant args.

fromXML

public static java.lang.Object fromXML(com.thoughtworks.xstream.XStream xstream,
                                       java.io.File location)
                                throws java.lang.ClassNotFoundException,
                                       java.lang.NullPointerException,
                                       java.io.IOException,
                                       java.io.FileNotFoundException
Given a configuration's File location and its Class, instantiate an instance of that configuration from the xml file. This method assumes that the configuration class's simple name is the name that is used in the serialized xml.

Type Parameters:
T - The target class
Parameters:
loc - The location of the serialized xml config files.
klass - The target class
Returns:
An instance of the target class from the serialized xml.
Throws:
java.lang.ClassNotFoundException
java.lang.NullPointerException
java.io.IOException
java.io.FileNotFoundException

exit

public static void exit(java.lang.String exitMessage)
Exits the program with usage instructions.