All Packages  This Package  Class Hierarchy  Class Search  Index

Class edu.utah.janos.ants.ants.Console
java.lang.Object
   |
   +----edu.utah.janos.ants.ants.Console

  Summary

class  Console
     extends java.lang.Object
     implements java.lang.Runnable
{
          // Fields 7
     private static final int MAX_SOCKET_BACKLOG;
     private boolean done;
     private LineNumberReader in;
     private final Node node;
     private PrintWriter out;
     private final ServerSocket socket;
     private static final Status status;

          // Constructors 1
     Console(Node, int) throws IOException;

          // Methods 10
     void accept();
     private void banner();
     private final void dumpStrings(String[]);
     private String[] getCommand() throws IOException;
     int getPort();
     private void handleClient() throws IOException;
     public void run();
     private void runCommand(String[]);
     public String toString();
     private void usage();
}




  Fields

· MAX_SOCKET_BACKLOG

Summary  |  Top

   private static final int MAX_SOCKET_BACKLOG


· status

Summary  |  Top
   private static final Status status


· socket

Summary  |  Top
   private final ServerSocket socket

The socket this console listens on.


· node

Summary  |  Top
   private final Node node


· out

Summary  |  Top
   private PrintWriter out


· in

Summary  |  Top
   private LineNumberReader in


· done

Summary  |  Top
   private boolean done


  Constructors

· Console

Summary  |  Top

   Console(Node node, 
           int port)  throws IOException

Create a Console listener on the given port. Blows up if the port is already in use, throwing an IOException.

Connections will not be handled until the accept() method is executed. You'd best supply a new thread to handle them, too.

Parameter Description
port the port to use; zero for any free port.

Throws: IOException
throws whatever errors ServerSocket might toss your way.

See Also: accept



  Methods

· getPort

Summary  |  Top
   int getPort() 

Return the port this console server listens on



· toString

Summary  |  Top
   public String toString() 
Overrides:
toString in class Object


· run

Summary  |  Top
   public void run() 
Implements:
run in interface Runnable


· accept

Summary  |  Top
   void accept() 

Accept and handle connections on this Console.

This call never returns.



· handleClient

Summary  |  Top
   private void handleClient()  throws IOException


· banner

Summary  |  Top
   private void banner() 


· getCommand

Summary  |  Top
   private String[] getCommand()  throws IOException


· usage

Summary  |  Top
   private void usage() 


· dumpStrings

Summary  |  Top
   private final void dumpStrings(String[] s) 


· runCommand

Summary  |  Top
   private void runCommand(String[] args) 


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7