edu.vt.marian.uip
Class server_uip

java.lang.Object
  |
  +--edu.vt.marian.uip.server_uip

public class server_uip
extends java.lang.Object

class name: server_uip class description: this class is responsible to communicate with a number of client_uips, send rpc_functions to and receive rpc_functions from them

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 INVALID_FUNCTION
           
static int NULL_FUNCTION
           
static int OBJECT_NOT_VALID
           
static int OK
          those are the possible return values of methods
static int PASSING_FUNCTION_FAILED
           
static int PROCESS_CALL_BACK_FAILED
           
static int STATUS_IS_EXIT
           
 
Constructor Summary
server_uip(java.lang.String dir, call_back_processor cbp, edu.vt.marian.common.Debug debug)
          method description: this constructor will create a server_uip object based on the information in th specified directory, when it receives a rpc_function from one of it's corresponding client_uips it will pass the function to the parameter cbp to process uses the services of class(es): input parameter(s): dir --- this directory contains the configuration information of the server_uip object cbp --- this parameter is supposed to be able to process the functions received from one of the client_uips using the method process_call_back(client_uip cu, rpc_function, rf) debug -- used for debugging output parameter(s): none return value: none synchronization consideration: none
 
Method Summary
 int exit(java.lang.String condition)
          method description: this method will let this object exit smoothly uses the services of class(es): input parameter(s): condition -- specifies under which situation this method is called output parameter(s): none return value: 0 -- the object exited smoothly other -- synchronization consideration: none
 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 other -- synchronization consideration: none
 boolean is_valid()
          method description: this method will tell whether or not the constructor of this object has been executed successfully uses the services of class(es): input parameter(s): none output parameter(s): none return value: true -- the constructor has been executed successfully false -- something bad happened in constructor synchronization consideration: none
 int log_data_from_server_uip_thread(java.lang.String message)
          method description: this method will log the data send from it's server_uip_thread uses the services of class(es): input parameter(s): message -- the message sent by server_uip_thread for logging output parameter(s): none return value: 0 -- the message has been logged successfully other -- synchronization consideration: none
 int process_call_back_from_server_uip_thread(int client_id, java.lang.String client_desc, rpc_function function)
          method description: this method will process the function received by it's server_uip_thread from one of it's corresponding client_uips uses the services of class(es): input parameter(s): client_id -- specifies which client_uip this functiuon come from client_desc -- a description of the client_uip rpc_function -- the function sent by the client_uip output parameter(s): none return value: 0 -- the function has been processed successfully other -- synchronization consideration: none
 int rpc_call(int client_id, rpc_function function)
          method description: this method will send the function to the specified client_uip uses the services of class(es): rpc_function input parameter(s): function -- the function which need to be sent to the client_uip client_id -- specifies which client_uip to send the function output parameter(s): none return value: 0 -- the function has been passed to the server correctly other -- synchronization consideration: none
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OK

public static final int OK
those are the possible return values of methods

NULL_FUNCTION

public static final int NULL_FUNCTION

INVALID_FUNCTION

public static final int INVALID_FUNCTION

STATUS_IS_EXIT

public static final int STATUS_IS_EXIT

PASSING_FUNCTION_FAILED

public static final int PASSING_FUNCTION_FAILED

PROCESS_CALL_BACK_FAILED

public static final int PROCESS_CALL_BACK_FAILED

OBJECT_NOT_VALID

public static final int OBJECT_NOT_VALID
Constructor Detail

server_uip

public server_uip(java.lang.String dir,
                  call_back_processor cbp,
                  edu.vt.marian.common.Debug debug)
method description: this constructor will create a server_uip object based on the information in th specified directory, when it receives a rpc_function from one of it's corresponding client_uips it will pass the function to the parameter cbp to process

uses the services of class(es): input parameter(s): dir --- this directory contains the configuration information of the server_uip object cbp --- this parameter is supposed to be able to process the functions received from one of the client_uips using the method process_call_back(client_uip cu, rpc_function, rf) debug -- used for debugging output parameter(s): none return value: none synchronization consideration: none

Method Detail

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 other -- synchronization consideration: none

rpc_call

public int rpc_call(int client_id,
                    rpc_function function)
method description: this method will send the function to the specified client_uip

uses the services of class(es): rpc_function input parameter(s): function -- the function which need to be sent to the client_uip client_id -- specifies which client_uip to send the function output parameter(s): none return value: 0 -- the function has been passed to the server correctly other -- synchronization consideration: none


exit

public int exit(java.lang.String condition)
method description: this method will let this object exit smoothly

uses the services of class(es): input parameter(s): condition -- specifies under which situation this method is called output parameter(s): none return value: 0 -- the object exited smoothly other -- synchronization consideration: none


process_call_back_from_server_uip_thread

public int process_call_back_from_server_uip_thread(int client_id,
                                                    java.lang.String client_desc,
                                                    rpc_function function)
method description: this method will process the function received by it's server_uip_thread from one of it's corresponding client_uips

uses the services of class(es): input parameter(s): client_id -- specifies which client_uip this functiuon come from client_desc -- a description of the client_uip rpc_function -- the function sent by the client_uip output parameter(s): none return value: 0 -- the function has been processed successfully other -- synchronization consideration: none


log_data_from_server_uip_thread

public int log_data_from_server_uip_thread(java.lang.String message)
method description: this method will log the data send from it's server_uip_thread

uses the services of class(es): input parameter(s): message -- the message sent by server_uip_thread for logging output parameter(s): none return value: 0 -- the message has been logged successfully other -- synchronization consideration: none


is_valid

public boolean is_valid()
method description: this method will tell whether or not the constructor of this object has been executed successfully

uses the services of class(es): input parameter(s): none output parameter(s): none return value: true -- the constructor has been executed successfully false -- something bad happened in constructor synchronization consideration: none