edu.vt.marian.server
Class session_manager

java.lang.Object
  |
  +--edu.vt.marian.server.session_manager

public class session_manager
extends java.lang.Object
implements edu.vt.marian.uip.call_back_processor

class name: session_manager class description: this class is mainly a wrapper of the class session_table but it knows client uip and server uip through which it communicate with client(s) and C/C++ server, it also pass system resource manager to session table.

uses the services of class(es): session_table, client_uip, server_uip 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_PARAMETER
           
static int NULL_FUNCTION
          possible methods return values
static int NULL_FUNCTION_NAME
           
static int NULL_PARAMETER
           
static int PROCESS_CALL_FROM_CLIENT_UIP_FAILED
           
static int PROCESS_CALL_FROM_SERVER_UIP_FAILED
           
static int PROCESS_CALL_FROM_SESSION_TABLE_TO_C_FAILED
           
static int PROCESS_CALL_FROM_SESSION_TABLE_TO_CLIENT_FAILED
           
 
Constructor Summary
session_manager(java.lang.String file_name, resource_manager rm, edu.vt.marian.common.Debug debug)
          method description: this constructor will create a session manager object from the dpecified directory, the directory/file contains all the configuration information about this object, this object will use the server uip object to communicate with webgate(s), use the client uip object to communicate with C/C++ marian server, resource manager object will be passed to the session table created by it.
 
Method Summary
 int exit(java.lang.String condition)
          method description: this method will let this object exit smoothly, release all the resources it occupies and kill all the threads it created uses the services of class(es): sesssion_table input parameter(s): condition -- specify the condition under which this method is called output parameter(s): none return value: 0 -- the exit is smooth other --
 int log_data_from_session_table(int log_level, java.lang.String message)
          method description: this method will log he message sent from the session_table of this class uses the services of class(es): none input parameter(s): log_level -- the depth of the message generator relative to the session_table, 1 means it's the session_table itself message -- the message the session_table want the session_manager to log output parameter(s): none return value: 0 -- the message has been loged correctly
 int process_call_back(edu.vt.marian.uip.client_uip cu, edu.vt.marian.uip.rpc_function rf)
          method description: this method will process the function sent from the C/C++ MARIAN server.
 int process_call_back(int client_id, edu.vt.marian.uip.rpc_function rf)
          method description: this method will process the function recieved from webgate, the parameter client_id specified which webgate sent this function uses the services of class(es): session_table input parameter(s): client_id --- used to identify which client_uip sent the function, currently each client_uip represent a webgate rf -- the function sent to this object by the client_uip output parameter(s): none return value: 0 -- the function has been processed successfully 1 -- error happens when the session table process the function
 int process_call_from_session_table_to_c(edu.vt.marian.uip.rpc_function rf)
          method description: this method will process the function sent from it's session table to C/C++ marian server uses the services of class(es): client_uip input parameter(s): rf -- the rpc function need to be sent output parameter(s): none return value: 0 -- the function has been processed correctly 1 -- error happens when client uip send the function
 int process_call_from_session_table_to_client(int client_id, edu.vt.marian.uip.rpc_function rf)
          method description: this method will process the function sent from it's session table to client (currently webgate) uses the services of class(es): server_uip input parameter(s): client_id -- specifies which client (webgate) to send this function rf -- the function which need to be sent output parameter(s): none return value: 0 -- the function has been processed correctly 1 -- error happens when server uip send the function other --
 int set_communication_classes(edu.vt.marian.uip.client_uip cu, edu.vt.marian.uip.server_uip su)
          method description: this method will inform the session_manager of the communication classes it will use to communicate with webgate(s) and C/C++ marian server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL_FUNCTION

public static final int NULL_FUNCTION
possible methods return values

PROCESS_CALL_FROM_SERVER_UIP_FAILED

public static final int PROCESS_CALL_FROM_SERVER_UIP_FAILED

PROCESS_CALL_FROM_CLIENT_UIP_FAILED

public static final int PROCESS_CALL_FROM_CLIENT_UIP_FAILED

NULL_FUNCTION_NAME

public static final int NULL_FUNCTION_NAME

INVALID_PARAMETER

public static final int INVALID_PARAMETER

PROCESS_CALL_FROM_SESSION_TABLE_TO_CLIENT_FAILED

public static final int PROCESS_CALL_FROM_SESSION_TABLE_TO_CLIENT_FAILED

PROCESS_CALL_FROM_SESSION_TABLE_TO_C_FAILED

public static final int PROCESS_CALL_FROM_SESSION_TABLE_TO_C_FAILED

NULL_PARAMETER

public static final int NULL_PARAMETER
Constructor Detail

session_manager

public session_manager(java.lang.String file_name,
                       resource_manager rm,
                       edu.vt.marian.common.Debug debug)
method description: this constructor will create a session manager object from the dpecified directory, the directory/file contains all the configuration information about this object, this object will use the server uip object to communicate with webgate(s), use the client uip object to communicate with C/C++ marian server, resource manager object will be passed to the session table created by it.

uses the services of class(es): input parameter(s): file_name --- the name of the file/directory which contain the configuration information about the session manager su --- the session manager communicate with webgate through this object cu -- the session manager communicate with C/C++ server through this object rm -- this object contain all the resource of the system, pack them all together into one object will make adding and deleting one or several of them easier in the future debug -- used for debugging output parameter(s): none return value: none

Method Detail

process_call_back

public int process_call_back(int client_id,
                             edu.vt.marian.uip.rpc_function rf)
method description: this method will process the function recieved from webgate, the parameter client_id specified which webgate sent this function

uses the services of class(es): session_table input parameter(s): client_id --- used to identify which client_uip sent the function, currently each client_uip represent a webgate rf -- the function sent to this object by the client_uip output parameter(s): none return value: 0 -- the function has been processed successfully 1 -- error happens when the session table process the function

Specified by:
process_call_back in interface edu.vt.marian.uip.call_back_processor

process_call_back

public int process_call_back(edu.vt.marian.uip.client_uip cu,
                             edu.vt.marian.uip.rpc_function rf)
method description: this method will process the function sent from the C/C++ MARIAN server.

uses the services of class(es): session_table input parameter(s): cu --- this is the client uip object which sent the function rf --- the function sent by the C/C++ MARIAN server output parameter(s): none return value: 0 -- the function has been processed correctly 1 -- error happens when the session table process the function

Specified by:
process_call_back in interface edu.vt.marian.uip.call_back_processor

process_call_from_session_table_to_client

public int process_call_from_session_table_to_client(int client_id,
                                                     edu.vt.marian.uip.rpc_function rf)
method description: this method will process the function sent from it's session table to client (currently webgate)

uses the services of class(es): server_uip input parameter(s): client_id -- specifies which client (webgate) to send this function rf -- the function which need to be sent output parameter(s): none return value: 0 -- the function has been processed correctly 1 -- error happens when server uip send the function other --


process_call_from_session_table_to_c

public int process_call_from_session_table_to_c(edu.vt.marian.uip.rpc_function rf)
method description: this method will process the function sent from it's session table to C/C++ marian server

uses the services of class(es): client_uip input parameter(s): rf -- the rpc function need to be sent output parameter(s): none return value: 0 -- the function has been processed correctly 1 -- error happens when client uip send the function


exit

public int exit(java.lang.String condition)
method description: this method will let this object exit smoothly, release all the resources it occupies and kill all the threads it created

uses the services of class(es): sesssion_table input parameter(s): condition -- specify the condition under which this method is called output parameter(s): none return value: 0 -- the exit is smooth other --


set_communication_classes

public int set_communication_classes(edu.vt.marian.uip.client_uip cu,
                                     edu.vt.marian.uip.server_uip su)
method description: this method will inform the session_manager of the communication classes it will use to communicate with webgate(s) and C/C++ marian server.

uses the services of class(es): none input parameter(s): cu -- this will be used by the session_manager to communicate with the C/C++ marian server su -- this will be used by the session_manager to communicate with webgate(s) output parameter(s): none return value: 0 -- the communication classes has been set correctly other --


log_data_from_session_table

public int log_data_from_session_table(int log_level,
                                       java.lang.String message)
method description: this method will log he message sent from the session_table of this class

uses the services of class(es): none input parameter(s): log_level -- the depth of the message generator relative to the session_table, 1 means it's the session_table itself message -- the message the session_table want the session_manager to log output parameter(s): none return value: 0 -- the message has been loged correctly