|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.servlet.GenericServlet | +--javax.servlet.http.HttpServlet | +--com.faa.flyfaa.FlyFAAPoolServlet
FlyFAAPoolServlet is the start-up servlet for the flyFAA Java application. The
init
method reads configuration properties from a properties file and calls
the createConnectionPool
method and the createCacheImpl
method to
create a pool of pooled-connections. The service
method accesses the ois_program
table and displays all the active Ground Delay Programs. A small enhancement to the
service
method added a call to the getServletInfo
method.
Field Summary | |
private java.lang.String |
dbDriver
The type of drivers to be used (thin or thick). |
static java.lang.String |
DOCTYPE
A String specifying which level of HTML a document purports to be written in |
private static java.util.Properties |
flyProps
The properties file for the flyfaa java application. |
private static java.lang.String |
jdbcLogFile
Contains the name of the base log file from the properties file. |
private oracle.jdbc.pool.OracleConnectionPoolDataSource |
l_ocpds
The source of the database connection pool. |
protected static javax.sql.PooledConnection |
m_connectionPool
The pool of connections |
(package private) boolean |
MadeLog
Flag to let me know whether the log file has been created. |
private static oracle.jdbc.pool.OracleConnectionCacheImpl |
ocacheimpl
The pool of Pooled Connections |
private oracle.jdbc.pool.OracleConnectionEventListener |
ocel
An object that registers to receive events generated by a PooledConnection |
private java.io.PrintWriter |
out
A printWriter for the log. |
private java.util.Timer |
t
A Timer object to hold a reference to the Timer used to schedule the DatabaseUpdater |
Fields inherited from class javax.servlet.http.HttpServlet |
HEADER_IFMODSINCE, HEADER_LASTMOD, LSTRING_FILE, lStrings, METHOD_DELETE, METHOD_GET, METHOD_HEAD, METHOD_OPTIONS, METHOD_POST, METHOD_PUT, METHOD_TRACE |
Fields inherited from class javax.servlet.GenericServlet |
config |
Constructor Summary | |
FlyFAAPoolServlet()
|
Method Summary | |
private void |
createCacheImpl()
|
private void |
createConnectionPool()
Creates a Database Connection Pool (Also called Pooled Connection) using JDBC 2.0 API. |
private java.lang.String |
CreateLog()
Creates a new PrintWriter , constructing the filename
from the flyfaalogfile property and a date/time string of the form yyyy_MMMddHHmm,
for writing log messages. |
void |
destroy()
Destroys the servlet. |
java.lang.String |
getServletInfo()
Overrides the getServletInfo() method which is supposed to return basic information about the Servlet. |
static java.lang.String |
headWithTitle(java.lang.String title)
Returns an HTML string containing a document title suitable for use at the beginning of a webpage. |
void |
init(javax.servlet.ServletConfig config)
Initializes the servlet. |
private void |
logging(java.lang.String msg)
Writes a message to the log file prefixed by a date/timestamp. |
private void |
logging(java.lang.Throwable t,
java.lang.String msg)
Writes a message to the log file including an exception. |
void |
service(javax.servlet.http.HttpServletRequest p_req,
javax.servlet.http.HttpServletResponse p_res)
This method is called whenever this servlet is invoked. |
Methods inherited from class javax.servlet.http.HttpServlet |
|
Methods inherited from class javax.servlet.GenericServlet |
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
Field Detail |
protected static javax.sql.PooledConnection m_connectionPool
private java.io.PrintWriter out
private static java.lang.String jdbcLogFile
boolean MadeLog
private oracle.jdbc.pool.OracleConnectionPoolDataSource l_ocpds
private static oracle.jdbc.pool.OracleConnectionCacheImpl ocacheimpl
private oracle.jdbc.pool.OracleConnectionEventListener ocel
private static java.util.Properties flyProps
private java.lang.String dbDriver
private java.util.Timer t
public static final java.lang.String DOCTYPE
Constructor Detail |
public FlyFAAPoolServlet()
Method Detail |
public static java.lang.String headWithTitle(java.lang.String title)
title
- The string to be used as the document's titlepublic void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
init
in class javax.servlet.GenericServlet
config
- The ServletConfig object passed from the Servlet containerjavax.servlet.ServletException
- If the properties file cannot be found or read,
or if the connection pool cache cannot be createdprivate java.lang.String CreateLog() throws java.lang.NullPointerException
PrintWriter
, constructing the filename
from the flyfaalogfile property and a date/time string of the form yyyy_MMMddHHmm,
for writing log messages. If the file cannot be opened, standard error is opened instead.java.lang.NullPointerException
- if the flyfaalogfile property does not contain a periodpublic void service(javax.servlet.http.HttpServletRequest p_req, javax.servlet.http.HttpServletResponse p_res) throws javax.servlet.ServletException, java.io.IOException
service
in class javax.servlet.http.HttpServlet
p_req
- The HttpServletRequest object representing the user's request.p_res
- The HttpServletResponse object representing the object being used
to assist this servlet in sending an HTTP response to the client.javax.servlet.ServletException
- if a database access error occurs executing the queryjava.io.IOException
- because that's what a good service method should doprivate void createConnectionPool() throws java.sql.SQLException, java.lang.NullPointerException
java.sql.SQLException
- If any of the properties file database connection properties
consist solely of white space, that is, the trim
method returns a string
which is of zero length.java.lang.NullPointerException
- If any of the properties file database connection
properties are null, that is, trying to call the trim
method on a null
string.private void createCacheImpl() throws java.sql.SQLException, java.lang.NumberFormatException
private void logging(java.lang.String msg)
msg
- The message to be written to the log file.private void logging(java.lang.Throwable t, java.lang.String msg)
t
- An exception (in general, anything of type Throwable) for which
the stack trace will be written to the log file.msg
- A text string to be written to the log file.public java.lang.String getServletInfo()
getServletInfo
in class javax.servlet.GenericServlet
String
- HTML containing some database connection pool cache statistics.public void destroy()
m_connectionPool.removeConnectionEventListener(ocel);
destroy
in class javax.servlet.GenericServlet
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |