edu.rice.cs.drjava
Class RemoteControlServer

java.lang.Object
  extended by edu.rice.cs.drjava.RemoteControlServer

public final class RemoteControlServer
extends Object

This class contains a server that monitors incoming datagrams on port 4444 (default; can be changed in OptionConstants.REMOTE_CONTROL_PORT). These datagrams can contain commands to open additional files. A client can query whether a server is running by sending QUERY_PREFIX. If a server is running, it will respond with RESPONSE_PREFIX. A client can tell a server to open a file by sending QUERY_PREFIX + " " + absoluteFileName. The server will respond with RESPONSE_PREFIX, or RESPONSE_PREFIX + " " + error if an error occurred. A client can tell a server to open a file and jump to a certain line number by sending QUERY_PREFIX + " " + absoluteFileName + File.pathSeparator + lineNumber. The server will respond with RESPONSE_PREFIX, or RESPONSE_PREFIX+" "+error if an error occurred. This class is declared final because it cannot be robustly subclassed because the constructor starts a thread.


Nested Class Summary
static class RemoteControlServer.RCServerThread
          Thread class for the server.
 
Field Summary
static String QUERY_PREFIX
          Prefix of a legitimate query by a client.
static String RESPONSE_PREFIX
          Prefix of a legitimate response by this server.
static String RESPONSE_PREFIX_WITH_USER
          Prefix of a legitimate response by this server, including the user name.
 
Constructor Summary
RemoteControlServer(MainFrame frame)
          Create a new remote control server, running in its own daemon thread.
 
Method Summary
static void main(String[] args)
          Main method for test purposes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUERY_PREFIX

public static final String QUERY_PREFIX
Prefix of a legitimate query by a client.

See Also:
Constant Field Values

RESPONSE_PREFIX

public static final String RESPONSE_PREFIX
Prefix of a legitimate response by this server.

See Also:
Constant Field Values

RESPONSE_PREFIX_WITH_USER

public static final String RESPONSE_PREFIX_WITH_USER
Prefix of a legitimate response by this server, including the user name.

Constructor Detail

RemoteControlServer

public RemoteControlServer(MainFrame frame)
                    throws IOException
Create a new remote control server, running in its own daemon thread.

Parameters:
frame - main frame
Throws:
IOException
Method Detail

main

public static void main(String[] args)
Main method for test purposes.