edu.vt.marian.uip
Class server_uip_thread

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--edu.vt.marian.uip.server_uip_thread

public class server_uip_thread
extends java.lang.Thread

class name: server_uip_thread class description: this class is responsible to pass rpc_functions to and receive rpc_functions from a number of client_uips, it use the service of server_uip_receiver_table to implement these functionsm it's also responsible for informing the server_uip_receiver_table to add a new receiver when a client connection is detected

uses the services of class(es): designer(s): Jianxin Zhao (jxzhao@csgrad.cs.vt.edu) implementator(s): finished time: known bugs: JDK version: 1.1.5 side effects:


Field Summary
static int CONNECTION_ERROR
           
static int EXIT
           
static int OK
          here are the possible status of this object
static int PASSING_FUNCTION_FAILED
          possible method return values
static int PROCESS_CALL_BACK_FAILED
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
server_uip_thread(server_uip su, int version, int port_number, int max_client_number, edu.vt.marian.common.Debug debug)
          method description: this constructor will create a client uip object based on the information contained in the file/directory, it assume the parameter call back processor can process functions it received from server.
 
Method Summary
 int exit(java.lang.String condition)
          method description: this method will send the function to the server this object corresponds to uses the services of class(es): rpc_function input parameter(s): function --- the function which need to be sent to the server output parameter(s): none return value: 0 -- the function has been passed to the server correctly other --
 int get_status()
          method description: this method will return the current status of this object uses the services of class(es): none input parameter(s): none output parameter(s): none return value: 0 -- everything is fine and the server has been connected corrected other -- this value specify the reasons why can not connect to server.
 int log_data_from_server_uip_receiver_table(java.lang.String message)
          method description: this method will process the log data sent from the server_uip_receiver_table uses the services of class(es): input parameter(s): message -- the message sent from the server_uip_receiver_table output parameter(s): none return value: 0 -- the message has been processed successfully other -- synchronization consideration: none
 int process_call_back_from_server_uip_receiver_table(int client_id, java.lang.String client_desc, rpc_function function)
          method description: this method will send the function to the server this object corresponds to uses the services of class(es): rpc_function input parameter(s): function --- the function which need to be sent to the server output parameter(s): none return value: 0 -- the function has been passed to the server correctly other --
 int rpc_call(int client_id, rpc_function function)
          method description: this method will send the function to the server this object corresponds to uses the services of class(es): rpc_function input parameter(s): function --- the function which need to be sent to the server output parameter(s): none return value: 0 -- the function has been passed to the server correctly other --
 void run()
          method description: this method will let the object exit smoothly, release all the resources it occupied and kill all the threads it created.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OK

public static final int OK
here are the possible status of this object

EXIT

public static final int EXIT

CONNECTION_ERROR

public static final int CONNECTION_ERROR

PASSING_FUNCTION_FAILED

public static final int PASSING_FUNCTION_FAILED
possible method return values

PROCESS_CALL_BACK_FAILED

public static final int PROCESS_CALL_BACK_FAILED
Constructor Detail

server_uip_thread

public server_uip_thread(server_uip su,
                         int version,
                         int port_number,
                         int max_client_number,
                         edu.vt.marian.common.Debug debug)
method description: this constructor will create a client uip object based on the information contained in the file/directory, it assume the parameter call back processor can process functions it received from server. uses the services of class(es): input parameter(s): file_name --- the name of the file/directory which contain the configuration information cbp --- this parameter is supposed to be able to process the functions received from server using the method process_call_back(client_uip cu, rpc_function, rf) debug -- used for debugging output parameter(s): none return value: none
Method Detail

run

public void run()
method description: this method will let the object exit smoothly, release all the resources it occupied and kill all the threads it created. uses the services of class(es): client_uip_reciever input parameter(s): condition --- under what condition is this method called, not used currently output parameter(s): none return value: 0 -- every thing is fine other --
Overrides:
run in class java.lang.Thread

get_status

public int get_status()
method description: this method will return the current status of this object uses the services of class(es): none input parameter(s): none output parameter(s): none return value: 0 -- everything is fine and the server has been connected corrected other -- this value specify the reasons why can not connect to server.

rpc_call

public int rpc_call(int client_id,
                    rpc_function function)
method description: this method will send the function to the server this object corresponds to uses the services of class(es): rpc_function input parameter(s): function --- the function which need to be sent to the server output parameter(s): none return value: 0 -- the function has been passed to the server correctly other --

exit

public int exit(java.lang.String condition)
method description: this method will send the function to the server this object corresponds to uses the services of class(es): rpc_function input parameter(s): function --- the function which need to be sent to the server output parameter(s): none return value: 0 -- the function has been passed to the server correctly other --

process_call_back_from_server_uip_receiver_table

public int process_call_back_from_server_uip_receiver_table(int client_id,
                                                            java.lang.String client_desc,
                                                            rpc_function function)
method description: this method will send the function to the server this object corresponds to uses the services of class(es): rpc_function input parameter(s): function --- the function which need to be sent to the server output parameter(s): none return value: 0 -- the function has been passed to the server correctly other --

log_data_from_server_uip_receiver_table

public int log_data_from_server_uip_receiver_table(java.lang.String message)
method description: this method will process the log data sent from the server_uip_receiver_table

uses the services of class(es): input parameter(s): message -- the message sent from the server_uip_receiver_table output parameter(s): none return value: 0 -- the message has been processed successfully other -- synchronization consideration: none