package edu.vt.marian.uip; import java.io.*; import java.net.*; import java.util.*; import edu.vt.marian.common.*; /** class name: server_uip_call_back_thread class description: this thread will pass the rpc_function to the call_back_processor to process, using thread can avoid possible deadlock caused by reader_writer_mutex when a thread is killed while it's executing a reader or writer method, this can also avoid the corresponding server_uip_receiver be blocked when it takes long time for the call_back_processor to process a function

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: */ public class server_uip_call_back_thread extends Thread { /** this is just used for debugging */ Debug debug; /** this is the client_id this thread will use when pass the function to call back processor to process */ private int client_id; /** this is the function which will be passed to the call back processor to process */ private rpc_function rf; /** this is the call beck processor to process the function recieved */ private call_back_processor cbp; /** method description: this constructor will create a server_uip_call_back _thread object based on the information specifies in the parameters

uses the services of class(es): input parameter(s): client_uip -- specifies from which client_uip this function is received rf -- the function received from that client_uip cbp -- this object will be able to process the function debug -- used for debugging output parameter(s): none return value: none synchronization consideration: none */ public server_uip_call_back_thread(int client_id, rpc_function rf, call_back_processor cbp, Debug debug) { this.debug = debug; // implementation required this.client_id = client_id; this.rf = rf; this.cbp = cbp; } /** method description: this method of this thread will pass the rpc_function to the call_back_processor to process

uses the services of class(es): input parameter(s): none output parameter(s): none return value: none synchronization consideration: none */ public void run() { // implementation required if ((rf == null) || (cbp == null)) { // null parameter debug.dumpTrace("server_uip_call_back_thread.run(): function or call back processor is null"); return; } cbp.process_call_back(client_id, rf); } }