edu.vt.marian.uip
Class client_uip

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

public class client_uip
extends java.lang.Thread

class name: client_uip class description: this class is responsible to send and receive rpc functions from the server. uses the services of class(es): debug, rpc_function, uip_log_manager, call_back_processor, uip_server client_uip_thread designer(s): Jianxin Zhao (jxzhao@csgrad.cs.vt.edu) implementator(s): Xuelei Sun (xusun@csgrad.cs.vt.edu) finished time: December 8, 1998 known bugs: JDK version: 1.1.5 side effects:


Field Summary
static int CREATE_OUTBOUND_STREAM_FAILED
           
static int ERROR_CREAT_LISTEN_SOCKET
           
static int ERROR_CREATE_OUTBOUND_SOCKET
           
static int ERROR_READ_FUNCTION_FROM_SERVER
           
static int ERROR_SET_SOCKET_TIME_OUT
           
static int ERROR_WRITE_ACK
           
static int EXIT
           
static int INVALID_FUNCTION
           
static int INVALID_VERSION
           
static int LISTEN_FAILED
           
static int LISTEN_TIME_OUT
           
static int NEW_SESSION_NOT_SENT
           
static int NULL_FUNCTION
           
static int NULL_PARAMETER
           
static int OK
           
static int PROCESS_CALL_BACK_FAILED
           
static int PROCESS_CALL_BACK_INVALID_FUNCTION
           
static int PROCESS_CALL_BACK_NULL_FUNCTION
           
static int RECEIVE_ACK_ERROR
           
static int REPLY_NOT_ACK
           
static int RPC_CALL_INVALID_FUNCTION
           
static int RPC_CALL_NOT_SUCCESSFUL
           
static int RPC_CALL_NULL_FUNCTION
           
static int RPC_CALL_STATUS_NOT_OK
           
static int SEND_FUNCTION_FAILED
           
static int SERVER_DISCONNECT
           
static int TIME_OUT_WAITING_ACK
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
client_uip(java.lang.String dr, call_back_processor cbp, edu.vt.marian.common.Debug debug)
          method description: this constructor will create a client_uip object based on the information contained in the directory it assumes call back processor can process functions it receives from the server uses the services of class(es): Debug, call_back_processor, uip_log_manager, uip_server, client_uip_thread input parameter(s): String dr, the directory name call_back_processor cbp, the call back processor Debug debug, debug object output parameter(s): none return value: none synchronization consideration: none
client_uip(uip_server us, int version, call_back_processor cbp, edu.vt.marian.common.Debug debug)
          method description: this constructor will create a client_uip object based on the uip server, version, call back processor that passed as parameter uses the services of class(es): Debug, call_back_processor, uip_log_manager, uip_server, client_uip_thread input parameter(s): uip_server us, the uip server contains the server information int version, the version number, 1 is hardcoded, 2 is flexible call_back_processor cbp, call back processor handling the call back process Debug debug, debug object output parameter(s): none return value: none synchronization consideration: none
 
Method Summary
 int exit(java.lang.String condition)
          method description: this method provide smooth exit for the client connection uses the services of class(es): Debug, uip_log_manager, client_uip_thread input parameter(s): String condition, condition to call the exit output parameter(s): none return value: OK: exit successfully synchronization consideration: none
 uip_server get_server()
          method description: this method return the uip server description uses the services of class(es): uip_server input parameter(s): none output parameter(s): none return value: uip_server the copy of member variable us synchronization consideration: none
 int get_status()
          method description: this method return the status of the client uip thread uses the services of class(es): client_uip_thread input parameter(s): none output parameter(s): none return value: int status of client uip thread synchronization consideration: none
 int process_call_back_from_client_uip_thread(rpc_function rf)
          method description: this method pass the call back process to the call back processor uses the services of class(es): Debug, uip_log_manager, client_uip_call_back_thread, call_back_processor, input parameter(s): rpc_function rf the function to pass output parameter(s): none return value: int PROCESS_CALL_BACK_NULL_FUNCTION: null rpc function PROCESS_CALL_BACK_INVALID_FUNCTION: invalid rpc function PROCESS_CALL_BACK_FAILED: call_back_processor process call back failed OK successfully synchronization consideration: none
 int rpc_call(rpc_function rf)
          method description: this method pass rpc function to client uip thread to pass it through net uses the services of class(es): Debug, uip_log_manager, client_uip_thread input parameter(s): rpc_function rf, rpc function to pass output parameter(s): none return value: int OK: call successfully RPC_CALL_NULL_FUNCTION: null rpc function RPC_CALL_INVALID_FUNCTION: invalid rpc function RPC_CALL_STATUS_NOT_OK: client uip thread status not ok RPC_CALL_NOT_SUCCESSFUL: client uip thread pass function failed synchronization consideration: none
 void run()
          method description: this method will check the status of the client_uip_thread from time to time, and reconnect to server if necessary input parameter(s): none output parameter(s): none return value: none synchronization consideration: none
 
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

RPC_CALL_NULL_FUNCTION

public static final int RPC_CALL_NULL_FUNCTION

RPC_CALL_INVALID_FUNCTION

public static final int RPC_CALL_INVALID_FUNCTION

RPC_CALL_STATUS_NOT_OK

public static final int RPC_CALL_STATUS_NOT_OK

RPC_CALL_NOT_SUCCESSFUL

public static final int RPC_CALL_NOT_SUCCESSFUL

PROCESS_CALL_BACK_NULL_FUNCTION

public static final int PROCESS_CALL_BACK_NULL_FUNCTION

PROCESS_CALL_BACK_INVALID_FUNCTION

public static final int PROCESS_CALL_BACK_INVALID_FUNCTION

PROCESS_CALL_BACK_FAILED

public static final int PROCESS_CALL_BACK_FAILED

NULL_PARAMETER

public static final int NULL_PARAMETER

INVALID_VERSION

public static final int INVALID_VERSION

ERROR_CREAT_LISTEN_SOCKET

public static final int ERROR_CREAT_LISTEN_SOCKET

ERROR_SET_SOCKET_TIME_OUT

public static final int ERROR_SET_SOCKET_TIME_OUT

ERROR_CREATE_OUTBOUND_SOCKET

public static final int ERROR_CREATE_OUTBOUND_SOCKET

NEW_SESSION_NOT_SENT

public static final int NEW_SESSION_NOT_SENT

LISTEN_TIME_OUT

public static final int LISTEN_TIME_OUT

LISTEN_FAILED

public static final int LISTEN_FAILED

CREATE_OUTBOUND_STREAM_FAILED

public static final int CREATE_OUTBOUND_STREAM_FAILED

SEND_FUNCTION_FAILED

public static final int SEND_FUNCTION_FAILED

REPLY_NOT_ACK

public static final int REPLY_NOT_ACK

RECEIVE_ACK_ERROR

public static final int RECEIVE_ACK_ERROR

TIME_OUT_WAITING_ACK

public static final int TIME_OUT_WAITING_ACK

ERROR_READ_FUNCTION_FROM_SERVER

public static final int ERROR_READ_FUNCTION_FROM_SERVER

SERVER_DISCONNECT

public static final int SERVER_DISCONNECT

EXIT

public static final int EXIT

NULL_FUNCTION

public static final int NULL_FUNCTION

INVALID_FUNCTION

public static final int INVALID_FUNCTION

ERROR_WRITE_ACK

public static final int ERROR_WRITE_ACK
Constructor Detail

client_uip

public client_uip(java.lang.String dr,
                  call_back_processor cbp,
                  edu.vt.marian.common.Debug debug)
method description: this constructor will create a client_uip object based on the information contained in the directory it assumes call back processor can process functions it receives from the server uses the services of class(es): Debug, call_back_processor, uip_log_manager, uip_server, client_uip_thread input parameter(s): String dr, the directory name call_back_processor cbp, the call back processor Debug debug, debug object output parameter(s): none return value: none synchronization consideration: none

client_uip

public client_uip(uip_server us,
                  int version,
                  call_back_processor cbp,
                  edu.vt.marian.common.Debug debug)
method description: this constructor will create a client_uip object based on the uip server, version, call back processor that passed as parameter uses the services of class(es): Debug, call_back_processor, uip_log_manager, uip_server, client_uip_thread input parameter(s): uip_server us, the uip server contains the server information int version, the version number, 1 is hardcoded, 2 is flexible call_back_processor cbp, call back processor handling the call back process Debug debug, debug object output parameter(s): none return value: none synchronization consideration: none
Method Detail

exit

public int exit(java.lang.String condition)
method description: this method provide smooth exit for the client connection uses the services of class(es): Debug, uip_log_manager, client_uip_thread input parameter(s): String condition, condition to call the exit output parameter(s): none return value: OK: exit successfully synchronization consideration: none

run

public void run()
method description: this method will check the status of the client_uip_thread from time to time, and reconnect to server if necessary input parameter(s): none output parameter(s): none return value: none synchronization consideration: none
Overrides:
run in class java.lang.Thread

get_status

public int get_status()
method description: this method return the status of the client uip thread uses the services of class(es): client_uip_thread input parameter(s): none output parameter(s): none return value: int status of client uip thread synchronization consideration: none

rpc_call

public int rpc_call(rpc_function rf)
method description: this method pass rpc function to client uip thread to pass it through net uses the services of class(es): Debug, uip_log_manager, client_uip_thread input parameter(s): rpc_function rf, rpc function to pass output parameter(s): none return value: int OK: call successfully RPC_CALL_NULL_FUNCTION: null rpc function RPC_CALL_INVALID_FUNCTION: invalid rpc function RPC_CALL_STATUS_NOT_OK: client uip thread status not ok RPC_CALL_NOT_SUCCESSFUL: client uip thread pass function failed synchronization consideration: none

get_server

public uip_server get_server()
method description: this method return the uip server description uses the services of class(es): uip_server input parameter(s): none output parameter(s): none return value: uip_server the copy of member variable us synchronization consideration: none

process_call_back_from_client_uip_thread

public int process_call_back_from_client_uip_thread(rpc_function rf)
method description: this method pass the call back process to the call back processor uses the services of class(es): Debug, uip_log_manager, client_uip_call_back_thread, call_back_processor, input parameter(s): rpc_function rf the function to pass output parameter(s): none return value: int PROCESS_CALL_BACK_NULL_FUNCTION: null rpc function PROCESS_CALL_BACK_INVALID_FUNCTION: invalid rpc function PROCESS_CALL_BACK_FAILED: call_back_processor process call back failed OK successfully synchronization consideration: none