edu.vt.marian.server
Class session_manage

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--edu.vt.marian.server.session_manage

public class session_manage
extends java.lang.Thread

class name: session_manage class description: this thread is responsible for check session "database" from time to time and inform corresponding session manager object to delete old sessions. uses the services of class(es): designer(s): Jianxin Zhao (jxzhao@csgrad.cs.vt.edu) implementator(s): Ning Chai (nchai@csgrad.cs.vt.edu) finished time: Nov 26th, 1998 known bugs: JDK version: 1.1.5 side effects:


Field Summary
static int INVALID_PROTOCOL
           
static int INVALID_TIME
           
static int NULL_PROTOCOL
           
static int OK
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
session_manage(java.lang.String file_name, session_table st, edu.vt.marian.common.Debug debug)
          method description: this constructor will create a session manage thread, the directory/file contains all the configuration information about this object, this object is created by the specified session table object.
 
Method Summary
 long get_check_interval()
          method description: this method will return the time interval under which this thread check session "database".
 long get_delete_interval()
          method description: this method will return the time value used to judge whether or not a session is old.
 java.lang.String get_protocol()
          method description: this method will return the protocol this thread currently use to manage the session "database" checking and session deleting uses the services of class(es): none input parameter(s): none output parameter(s): none return value: the protocol currently used by this object as a string synchronization: none
 void run()
          method description: this method is responsible for check session "database" and inform session manager to delete old sessions from time to time.
 int set_check_interval(long time)
          method description: this method will set the time interval under which this thread will check session "database".
 int set_delete_interval(long time)
          method description: this method will set the time value to delete a session, a session will be considered old if it has no activity longer than the specified time.
 int set_protocol(java.lang.String protocol)
          method description: this method will set the protocol the thread will use to manage the session "database" checking and session deleting uses the services of class(es): none input parameter(s): protocol -- this will become the new protocol output parameter(s): none return value: OK -- the new protocol has been set correctly INVALID_PROTOCOL -- the new protocol is not supported currently NULL_PROTOCOL -- the protocol is null synchronization: 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

INVALID_TIME

public static final int INVALID_TIME

NULL_PROTOCOL

public static final int NULL_PROTOCOL

INVALID_PROTOCOL

public static final int INVALID_PROTOCOL
Constructor Detail

session_manage

public session_manage(java.lang.String file_name,
                      session_table st,
                      edu.vt.marian.common.Debug debug)
method description: this constructor will create a session manage thread, the directory/file contains all the configuration information about this object, this object is created by the specified session table object. 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 manage st --- the session table which created this object debug -- used for debugging output parameter(s): none return value: none synchronization: none
Method Detail

run

public void run()
method description: this method is responsible for check session "database" and inform session manager to delete old sessions from time to time. uses the services of class(es): session_table input parameter(s): none output parameter(s): none return value: none synchronization: none
Overrides:
run in class java.lang.Thread

set_check_interval

public int set_check_interval(long time)
method description: this method will set the time interval under which this thread will check session "database". uses the services of class(es): none input parameter(s): time -- this will become the new interval, the unit is ms output parameter(s): none return value: OK -- the value has been set correctly INVALID_TIME -- the value is negative and doesn't make sense other -- synchronization: none

set_delete_interval

public int set_delete_interval(long time)
method description: this method will set the time value to delete a session, a session will be considered old if it has no activity longer than the specified time. uses the services of class(es): none input parameter(s): time -- this will become the new interval output parameter(s): none return value: OK -- the value has been set correctly INVALID_TIME -- the value is negative and doesn't make sense other -- synchronization: none

get_check_interval

public long get_check_interval()
method description: this method will return the time interval under which this thread check session "database". uses the services of class(es): none input parameter(s): none output parameter(s): none return value: the interval as a long integer, the unit is ms synchronization: none

get_delete_interval

public long get_delete_interval()
method description: this method will return the time value used to judge whether or not a session is old. uses the services of class(es): none input parameter(s): none output parameter(s): none return value: the interval as a long integer, the unit is ms synchronization: none

set_protocol

public int set_protocol(java.lang.String protocol)
method description: this method will set the protocol the thread will use to manage the session "database" checking and session deleting uses the services of class(es): none input parameter(s): protocol -- this will become the new protocol output parameter(s): none return value: OK -- the new protocol has been set correctly INVALID_PROTOCOL -- the new protocol is not supported currently NULL_PROTOCOL -- the protocol is null synchronization: none

get_protocol

public java.lang.String get_protocol()
method description: this method will return the protocol this thread currently use to manage the session "database" checking and session deleting uses the services of class(es): none input parameter(s): none output parameter(s): none return value: the protocol currently used by this object as a string synchronization: none