Reality Interface Classes

com.northgateis.realweb
Class RealWeb

java.lang.Object
 |
 +--java.util.Observable
 |
 +--com.northgateis.reality.rsc.RSCConnection
              |
 +--com.northgateis.realweb.RealWeb

public class RealWeb
extends RSCConnection
implements java.lang.Runnable

This class is used by a servlet to cache RSC connections to Reality databases.

Connections can be cached in one of two ways. Pooled connections are usually short lived. These are added to a pool when finnished with and are then available for any browser to use.

Persistent connections usually have a longer life. A browser can access a persistent connection repeatedly from a sequence of web pages. This enables the server to maintain context information about the sequence; for example,  item locks, transactions and DataBasic common variables.

In addition persistent connections may be secure. ie a user must logon with a userID, password and optionally account and password before he can access the database.

Connections are destroyed when they time out. The DataBasic subroutine may modify the timeout via an API call. When a persistant server has finished a task it can set the timeout to zero to force disconnection.

To get a RealWeb connection to a database use:

connection = RealWeb.getConnection(req, res);

This will either return a current connection, or create a new one.


Field Summary
static char AM
           
static java.lang.String NL
           
static char VM
           
 
Method Summary
static java.lang.StringAMtoNL(java.lang.String s)
          Convert all attribute marks in the given string to HTML break tags
static booleandebugOn()
          Return true if RealWeb debugging enabled
static RealWebgetConnection(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Get a RealWeb connection (current or new )
static RealWebgetConnection(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, RealWebUrl URL)
          Get a RealWeb connection (current or new )
static RealWebgetConnection(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, java.lang.String section)
          Get a RealWeb connection (current or new )
static voidinit()
          Start a thread to timeout our connections
 voidrun()
          Background thread used to timeout connections
 voidsetAvailable()
          Clear the busy flag
 voidsetTimeout(javax.servlet.http.HttpServletResponse res, int tmo)
          Sets the connections timeout value (in seconds) and updates the connections end time
 java.lang.StringtoString()
           
 
Methods inherited from class com.northgateis.reality.rsc.RSCConnection
connect, disconnect, doItAll, execute, getParam, prepare, release, releaseData, releaseSubroutine, sendParam, setServer
 
Methods inherited from class java.util.Observable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

AM

public static final char AM

VM

public static final char VM

NL

public static final java.lang.String NL
Method Detail

init

public static void init()
Start a thread to timeout our connections

run

public void run()
Background thread used to timeout connections
Specified by:
run in interface java.lang.Runnable

getConnection

public static RealWebgetConnection(javax.servlet.http.HttpServletRequest req,
 javax.servlet.http.HttpServletResponse res)
 throws RealWebException,
 java.io.IOException
Get a RealWeb connection (current or new )

getConnection

public static RealWebgetConnection(javax.servlet.http.HttpServletRequest req,
 javax.servlet.http.HttpServletResponse res,
                                    RealWebUrl URL)
 throws RealWebException,
 java.io.IOException
Get a RealWeb connection (current or new )

getConnection

public static RealWebgetConnection(javax.servlet.http.HttpServletRequest req,
 javax.servlet.http.HttpServletResponse res,
 java.lang.String section)
 throws RealWebException,
 java.io.IOException
Get a RealWeb connection (current or new )

setTimeout

public void setTimeout(javax.servlet.http.HttpServletResponse res,
 int tmo)
Sets the connections timeout value (in seconds) and updates the connections end time

AMtoNL

public static java.lang.String AMtoNL(java.lang.String s)
Convert all attribute marks in the given string to HTML break tags

setAvailable

public void setAvailable()
Clear the busy flag

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

debugOn

public static boolean debugOn()
Return true if RealWeb debugging enabled

Reality Interface Classes

Copyright (c) 2000 NEC Software Services (UK) Limited