Class MonoServ

  extended by com.monoserv.MonoServ

public class MonoServ
extends java.lang.Object

A single instance of the MonoServ software. This will handle and facailitate all the threads for a single "server" running on a single port. Lots of things are hard-coded at the moment, and will be changed in the near future.

Constructor Summary
MonoServ(java.lang.String xmlFile)
          Constructor with a XML file as the starting point for the server.
Method Summary
 void Init()
          Initializes the server settings and enables the "server_active" field.
 void ServerCleanup()
          Just closes the ServerSocket at the moment.
 void ServerLoop()
          The main server loop.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public MonoServ(java.lang.String xmlFile)
Constructor with a XML file as the starting point for the server. Also calls Init() to setup variables.

xmlFile - A string representation of the XML config file to load.
See Also:
Method Detail


public void Init()
          throws java.lang.Exception
Initializes the server settings and enables the "server_active" field.

java.lang.Exception - If something bad goes wrong during setup.


public void ServerLoop()
                throws java.lang.RuntimeException,
The main server loop. This is a blocking function that runs an infinite loop based on "server_active" field or until an Exception is thrown. Inside the loop is the ServerSocket.accept() call which waits for a connection. Other messages are printed to the STDERR. This will be changed to eventually throw exceptions instead of just printing message. It currently also prints messages before and after the while loop indicating starting and stopping of the server. Will eventually be passed through a logging mechanisms.

java.lang.RuntimeException - If the server has not been properly initialized - If something goes wrong in the network communication.


public void ServerCleanup()
Just closes the ServerSocket at the moment.

Throws: - Based on the close() method in ServerSocket
See Also: