|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.ou.mlfw.config.ClientInitializer
public class ClientInitializer
A ClientInitializer is the means by which a World finds, loads, and initializes a Client. From the point of view of a Client developer, the ClientInitializer is a minimal set of configuration necessary for specifying the Client implementation class (which must be available on the classpath), the file that the client may use for configuration purposes, and the file the client may use for data loading purposes. A ClientInitializer also allows the developer to specify the name that should be associated with the Client for display purposes (on the ladder, for instance). A ClientInitializer will normally be created by deserializing from an xml file (see the fromXMLFile method), the location of which is given as part of a ClientMapping in a WorldConfig.
Constructor Summary | |
---|---|
ClientInitializer(java.lang.Class<? extends Client> clientClass,
java.io.File configuration,
java.io.File data,
java.lang.String displayName)
Constructor for a ClientInitializer. |
Method Summary | |
---|---|
static ClientInitializer |
fromXMLFile(java.io.File f)
Factory method to generate a ClientInitializer from the given file. |
java.lang.Class<? extends Client> |
getClientClass()
Each client will be an instance of a class submitted by students. |
java.io.File |
getConfiguration()
Each client can be configured independently, using any format the client wishes to use. |
java.io.File |
getData()
Each client can specify the location of any data that should be loaded when the simulator starts up. |
java.lang.String |
getDisplayName()
Each client can specify the name that should be associated with that client for display purposes. |
static com.thoughtworks.xstream.XStream |
getXStream()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClientInitializer(java.lang.Class<? extends Client> clientClass, java.io.File configuration, java.io.File data, java.lang.String displayName)
clientClass
- The client classconfiguration
- The file location of the client's configuration.data
- The file location of the client's data.displayName
- The name that should be displayed for the client.Method Detail |
---|
public java.lang.Class<? extends Client> getClientClass()
public java.io.File getConfiguration()
public java.io.File getData()
public java.lang.String getDisplayName()
public static com.thoughtworks.xstream.XStream getXStream()
public static ClientInitializer fromXMLFile(java.io.File f) throws java.io.IOException
f
- The file to deserialize.
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |