Open SiteSearch 4.1.1
Final

ORG.oclc.jassi
Class JaSSI

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--ORG.oclc.util.CancellableThread
              |
              +--ORG.oclc.jassi.JaSSI

public class JaSSI
extends CancellableThread
implements timedObject

The JaSSI class is responsible for starting and running the JaSSI Server.

JaSSI performs server initialization by reading ini configuration files, executing classes to load during startup, and creating the User Hashtable, Thread Hashtable, Mime types Hashtable, and Global objects Hashtable maintained and used by this server.

JaSSI operates by communicating with the Standard HTTPD server, OpServe server, ZBase servers, Access server and other applications.

JaSSI creates a server socket which reads and writes HTTP messages to the standard HTTPD Server. It also maintains the static User Hashtable which contains the stateful information generated during user sessions.

JaSSI is also responsible for setting up user and server logging, statistics, and for controlling multi-transaction processing in a multi-threaded environment.

See Also:
JaSSIUsers, HttpMessage, RequestManager, UserStateObject

Field Summary
static boolean verbose
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
JaSSI()
          Constructs a JaSSI object.
 
Method Summary
static String addThreadInfo(HttpMessage httpObj, RequestManager rMngr)
           
static void batchUpdateTxnTime()
           
static void deleteAllJaSSIUsers()
          Deletes all the Users currently held by the JaSSI.
static void endSession(String sessionid)
           
static Enumeration getAllSessionID()
           
static String getCGIRoot()
          Returns the CGI root directory defined by the JaSSI Server ini file.
static String getDocumentRoot()
          Returns the document root directory defined by the JaSSI Server ini file.
static String getFailurePage()
          Returns the JaSSI failure page defined by the JaSSI Server ini file.
static Hashtable getGlobalObjects()
          Returns the JaSSIGlobalObjects Hashtable.
static String getHost()
          Returns the hostname on which JaSSI is running.
static IniFile getJaSSIIniFile()
          Returns the Inifile Object for the JaSSI Server ini file.
static Hashtable getMimeTable()
          Returns the JaSSI MimeTable Hashtable.
static String getNameSpace()
          Returns the JaSSI namespace defined by the JaSSI Server ini file.
static String[] getPkgs()
          Returns the String array holding the packaged order as defined by the JaSSI Server ini file.
static int getPort()
          Returns the JaSSI Server port where JaSSI is running.
static RequestManager getRequestManager(String threadId)
          Retreives the current RequestManager object for a particular transaction given the input parameter threadid.
static String getTimeoutPage()
          Returns the JaSSI idle session timeout page defined by the JaSSI Server ini file.
static Object getUser(String user)
          Performs a lookup for a user in the UserTable Hashtable.
static void housekeeping()
          Reports housekeeping information to the JaSSI Server log at intervals defined by the JaSSI Server ini file.
static void initIni(String fileString)
           
static void main(String[] args)
          Starts the JaSSI Server and reads in ini configuration files.
static OpsClient opsClient()
          Retrieves the OpsClient object associated with the JaSSI.
 void run()
          Runs the JaSSI Server by starting a new thread for each HTTP request sent to JaSSI.
static void setTraceLevelAllUsers(int traceLevel)
          Sets the trace level for all current users to the input trace level value.
static void stopGracefully()
          Sets a flag allowing the JaSSI Server to shutdown once all active sessions have logged off.
 void timerExpired()
          Sleeps the specified JaSSI ini file housekeeping interval, wakes to call the housekeeping method and then repeats the same process.
static void updateLastTxnTime(String sessid, RequestManager rMngr)
           
 
Methods inherited from class ORG.oclc.util.CancellableThread
cancel, cancelled, isCancelled, terminate
 
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

verbose

public static boolean verbose
Constructor Detail

JaSSI

public JaSSI()
Constructs a JaSSI object.
Method Detail

main

public static void main(String[] args)
                 throws Exception
Starts the JaSSI Server and reads in ini configuration files.
Parameters:
args[0] - the name of a JaSSI Server ini file.
Throws:
Exception -  

run

public void run()
Runs the JaSSI Server by starting a new thread for each HTTP request sent to JaSSI.
Overrides:
run in class Thread

addThreadInfo

public static String addThreadInfo(HttpMessage httpObj,
                                   RequestManager rMngr)

getAllSessionID

public static final Enumeration getAllSessionID()

endSession

public static void endSession(String sessionid)

getUser

public static final Object getUser(String user)
Performs a lookup for a user in the UserTable Hashtable.
Parameters:
user - the user's sessionid.
Returns:
a user object from the UserTable Hashtable or null if not found.

deleteAllJaSSIUsers

public static final void deleteAllJaSSIUsers()
Deletes all the Users currently held by the JaSSI.

setTraceLevelAllUsers

public static void setTraceLevelAllUsers(int traceLevel)
Sets the trace level for all current users to the input trace level value.
Parameters:
traceLevel - the trace level value.
See Also:
Log

getGlobalObjects

public static final Hashtable getGlobalObjects()
Returns the JaSSIGlobalObjects Hashtable.
Returns:
the JaSSIGlobalObjects Hashtable.

getMimeTable

public static final Hashtable getMimeTable()
Returns the JaSSI MimeTable Hashtable.
Returns:
the JaSSI MimeTable Hashtable.

getHost

public static final String getHost()
Returns the hostname on which JaSSI is running.
Returns:
the hostname on which JaSSI is running.

getDocumentRoot

public static final String getDocumentRoot()
Returns the document root directory defined by the JaSSI Server ini file.
Returns:
the document root directory defined by the JaSSI Server ini file.

getPort

public static final int getPort()
Returns the JaSSI Server port where JaSSI is running.
Returns:
the server port where JaSSI is running.

getNameSpace

public static final String getNameSpace()
Returns the JaSSI namespace defined by the JaSSI Server ini file.
Returns:
the namespace for this JaSSI Server.

getCGIRoot

public static final String getCGIRoot()
Returns the CGI root directory defined by the JaSSI Server ini file.
Returns:
the CGI root directory defined by the JaSSI Server ini file.

getJaSSIIniFile

public static final IniFile getJaSSIIniFile()
Returns the Inifile Object for the JaSSI Server ini file.
Returns:
the IniFile Object for the JaSSI Server ini file.

getTimeoutPage

public static final String getTimeoutPage()
Returns the JaSSI idle session timeout page defined by the JaSSI Server ini file.
Returns:
the filename of the JaSSI idle session timeout page.

getPkgs

public static final String[] getPkgs()
Returns the String array holding the packaged order as defined by the JaSSI Server ini file.
Returns:
the array containing the package loading order.

getFailurePage

public static final String getFailurePage()
Returns the JaSSI failure page defined by the JaSSI Server ini file.
Returns:
the filename of the JaSSI failure page.

opsClient

public static final OpsClient opsClient()
Retrieves the OpsClient object associated with the JaSSI.
Returns:
OpsClient

getRequestManager

public static final RequestManager getRequestManager(String threadId)
Retreives the current RequestManager object for a particular transaction given the input parameter threadid.
Parameters:
threadId - the thread name.
Returns:
a reference to the RequestManager object for this threadid.

timerExpired

public void timerExpired()
Sleeps the specified JaSSI ini file housekeeping interval, wakes to call the housekeeping method and then repeats the same process.
Specified by:
timerExpired in interface timedObject

housekeeping

public static final void housekeeping()
Reports housekeeping information to the JaSSI Server log at intervals defined by the JaSSI Server ini file.

Housekeeping cleans up runaway threads and checks for rolling server and statistic log files.

Reports the following information:
Number of active user sessions
Number of active users connected
Number of active threads
Total Memory available
Total Free Memory available


batchUpdateTxnTime

public static void batchUpdateTxnTime()

updateLastTxnTime

public static void updateLastTxnTime(String sessid,
                                     RequestManager rMngr)

stopGracefully

public static final void stopGracefully()
Sets a flag allowing the JaSSI Server to shutdown once all active sessions have logged off.

initIni

public static void initIni(String fileString)

Open SiteSearch 4.1.1
Final