[Idrs-commit] CVS: Idrs/dev/src/net/sourceforge/idrs/core/servlet IteratorEnumeration.java,NONE,1.1
Brought to you by:
bigman921
|
From: Marc B. <big...@us...> - 2002-08-22 20:07:08
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet
In directory usw-pr-cvs1:/tmp/cvs-serv21727/dev/src/net/sourceforge/idrs/core/servlet
Modified Files:
IDRSServlet.java Init.java ReportStore.java
Added Files:
IteratorEnumeration.java
Log Message:
Synced development
--- NEW FILE: IteratorEnumeration.java ---
/*
* IteratorEnumeration.java
*
* Created on February 27, 2002, 3:36 PM
*/
package net.sourceforge.idrs.core.servlet;
import java.util.*;
/**
*
* @author mlb
* @version
*/
public class IteratorEnumeration implements java.util.Enumeration {
Iterator it;
/** Creates new IteratorEnumeration */
public IteratorEnumeration(Iterator it) {
this.it = it;
}
public boolean hasMoreElements() {
return it.hasNext();
}
public java.lang.Object nextElement() {
return it.next();
}
}
Index: IDRSServlet.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet/IDRSServlet.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** IDRSServlet.java 14 Apr 2002 14:10:37 -0000 1.11
--- IDRSServlet.java 22 Aug 2002 20:06:33 -0000 1.12
***************
*** 2,14 ****
IDRSServlet.java
Copyright (C) 2001 Marc Boorshtein
!
! The contents of this file are subject to the Mozilla Public License Version 1.0 (the License);
! you may not use this file except in compliance with the License. You may obtain a copy of the
License at http://www.mozilla.org/MPL/
!
! Software distributed under the License is distributed on an "AS IS" basis,
! WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific
language governing rights and limitations under the License.
[...1248 lines suppressed...]
! */
! public void errorPage(HttpServletRequest req, HttpServletResponse resp,Exception e)
! throws Exception {
!
! //forward to access denied page specified in the web.xml file
! //resp.setContentType("text/html");
! req.setAttribute("doc_Exception",e);
! req.getRequestDispatcher(init.getErrorPage()).forward(req, resp);
! }
}
+
class PoolInfo implements Cloneable {
! IDRSScriptLanguage idrss;
! IDRSRep rep;
! IDRSSecurity secure;
! HashMap conns;
! String docName;
!
}
Index: Init.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet/Init.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Init.java 14 Apr 2002 14:10:37 -0000 1.7
--- Init.java 22 Aug 2002 20:06:34 -0000 1.8
***************
*** 2,10 ****
Init.java
Copyright (C) 2001 Marc Boorshtein
!
The contents of this file are subject to the Mozilla Public License Version 1.0 (the License);
you may not use this file except in compliance with the License. You may obtain a copy of the
License at http://www.mozilla.org/MPL/
!
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific
--- 2,10 ----
Init.java
Copyright (C) 2001 Marc Boorshtein
!
The contents of this file are subject to the Mozilla Public License Version 1.0 (the License);
you may not use this file except in compliance with the License. You may obtain a copy of the
License at http://www.mozilla.org/MPL/
!
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific
***************
*** 29,32 ****
--- 29,34 ----
import java.text.*;
import net.sourceforge.idrs.utils.pool.PooledObject;
+ import net.sourceforge.idrs.pool.*;
+ import net.sourceforge.idrs.exceptions.*;
***************
*** 35,117 ****
*/
public class Init {
SimpleDateFormat formatter;
PrintStream log;
PrintStream errorLog;
ServletConfig svg;
! JDBCInfo appDB;
boolean toLower;
HashMap docsID, docsName, dbs;
Application app;
! ScriptPool scriptPool;
! JDBCPool appDBs;
! JDBCPool docDBs;
String useDocDB = null;
! ScriptPool scripts;
String idrslogPath;
String deniedPage;
String digestType;
boolean digestPass;
!
public HashMap getDocsIDMap() {
return this.docsID;
}
!
public HashMap getDocsNameMap() {
return this.docsName;
}
!
public ServletConfig getServletConfig() {
return this.svg;
}
!
! /**
! * Retrieves Application object retrieved from web.xml file
! */
! public Application getApplication() {
! return this.app;
! }
!
! /**
! * Retrieves location of page used for access denied
! */
! public String getDeniedPage() {
! return this.deniedPage;
! }
!
/**
! * Retrieves the system database connection
*/
! public PooledObject getSysCon() throws Exception {
! return appDBs.getConnection();
! }
!
/**
! * Returns a system connection to it's pool
*/
! public void returnSysCon(int con) throws Exception {
! appDBs.freeConnection(con);
! }
/**
! * Retrieves the information for the AppDB
*/
public JDBCInfo getAppDBInfo() {
! return appDB;
! }
!
/**
! * Returns wether or not the docdb and the appdb were the same
*/
! public boolean useDocDB() {
! return (useDocDB != null);
}
!
/**
! * Retrieves the name ofthe app db
*/
! public String getAppDBName() {
! return useDocDB;
}
!
/**
* Wether fields should be lowercase
--- 37,114 ----
*/
public class Init {
+ static final String DEFAULT_DB_POOL="net.sourceforge.idrs.pool.JDBCPool";
+ static final String DEFAULT_REPORT_POOL="net.sourceforge.idrs.pool.IDRSRepPool";
+ static final String DEFAULT_SCRIPT_POOL="net.sourceforge.idrs.pool.ScriptContextPool";
+
SimpleDateFormat formatter;
PrintStream log;
PrintStream errorLog;
ServletConfig svg;
! //JDBCInfo appDB;
boolean toLower;
HashMap docsID, docsName, dbs;
Application app;
! net.sourceforge.idrs.pool.ScriptPool scriptPool;
! net.sourceforge.idrs.pool.JDBCPool appDBs;
! net.sourceforge.idrs.pool.JDBCPool docDBs;
! String docsDB;
! String authDB;
!
String useDocDB = null;
! ScriptContextPool scripts;
String idrslogPath;
String deniedPage;
String digestType;
+ String errorPage;
boolean digestPass;
!
public HashMap getDocsIDMap() {
return this.docsID;
}
!
public HashMap getDocsNameMap() {
return this.docsName;
}
!
public ServletConfig getServletConfig() {
return this.svg;
}
!
/**
! * Retrieves the name of the doc db
*/
! public String getDocDbName() {
! return docsDB;
! }
!
/**
! * Retrieves the name of the authentication db
*/
! public String getAuthDbName() {
! return authDB;
! }
/**
! * Retrieves the information of the authentication db
*/
public JDBCInfo getAppDBInfo() {
! return (JDBCInfo) dbs.get(authDB);
! }
!
/**
! * Retrieves Application object retrieved from web.xml file
*/
! public Application getApplication() {
! return this.app;
}
!
/**
! * Retrieves location of page used for access denied
*/
! public String getDeniedPage() {
! return this.deniedPage;
}
!
!
/**
* Wether fields should be lowercase
***************
*** 120,124 ****
return toLower;
}
!
/**
*Determines if passwords are run through a digest
--- 117,121 ----
return toLower;
}
!
/**
*Determines if passwords are run through a digest
***************
*** 127,131 ****
return this.digestPass;
}
!
/**
*Retrieves digest type
--- 124,128 ----
return this.digestPass;
}
!
/**
*Retrieves digest type
***************
*** 134,196 ****
return this.digestType;
}
!
/**
* Retrives a report from it's pool
* @param name Name of page
*/
! public IDRSPool getReport(String name) {
return ((ReportStore) docsName.get(name)).pool;
}
!
/**
* Retrives a report from it's pool
* @param id ID of page
*/
! public IDRSPool getReport(int id) {
return ((ReportStore) docsName.get(Integer.toString(id))).pool;
}
!
/**
* Retrives a report's info from it's pool
* @param name Name of page
*/
! public DocInfo getDocInfo(String name) {
! return ((ReportStore) docsName.get(name)).info;
}
!
!
/**
* Retrives a report's info from it's pool
* @param id ID of page
*/
! public DocInfo getDocInfo(int id) {
! return ((ReportStore) docsName.get(Integer.toString(id))).info;
}
!
!
/**
* Retrives a connection pool
* @param name Name of pool
*/
! public JDBCPool getDBPool(String name) {
! return (JDBCPool) dbs.get(name);
}
!
/**
* Retrives a connection pool
* @param id ID of pool
*/
! public PooledObject getScriptContext() throws Exception {
! return scripts.checkOut(1);
}
!
/**
* Returns a script context
* @param contextID Index of context in it's pool
*/
! public void returnScriptContext(int contextID) throws Exception {
! scripts.checkIn(contextID);
}
!
/**
* Retrieves information on a set of connections
--- 131,198 ----
return this.digestType;
}
!
/**
* Retrives a report from it's pool
* @param name Name of page
*/
! public RepPool getReport(String name) {
return ((ReportStore) docsName.get(name)).pool;
}
!
/**
* Retrives a report from it's pool
* @param id ID of page
*/
! public RepPool getReport(int id) {
return ((ReportStore) docsName.get(Integer.toString(id))).pool;
}
!
/**
* Retrives a report's info from it's pool
* @param name Name of page
*/
! public DocInfo getDocInfo(String name) throws PageNotFoundException {
! ReportStore rep = (ReportStore) docsName.get(name);
! if (rep == null) throw new PageNotFoundException(name);
!
! return rep.info;
}
!
!
/**
* Retrives a report's info from it's pool
* @param id ID of page
*/
! public DocInfo getDocInfo(int id) throws PageNotFoundException {
! ReportStore rep = (ReportStore) this.docsID.get(new Integer(id));
! if (rep == null) throw new PageNotFoundException(id);
! return rep.info;
}
!
!
/**
* Retrives a connection pool
* @param name Name of pool
*/
! public DbPool getDBPool(String name) {
! return (DbPool) dbs.get(name);
}
!
/**
* Retrives a connection pool
* @param id ID of pool
*/
! public IDRSScriptLanguage getScriptContext() throws Exception {
! return scriptPool.getContext();
}
!
/**
* Returns a script context
* @param contextID Index of context in it's pool
*/
! public void returnScriptContext(IDRSScriptLanguage script) throws Exception {
! scriptPool.returnContext(script);
}
!
/**
* Retrieves information on a set of connections
***************
*** 203,224 ****
while (tok.hasMoreTokens()) {
key = tok.nextToken();
! tmp.put(key,((JDBCPool) dbs.get(key)).getInfo());
}
!
return tmp;
}
!
!
/**
* Builds script contexts
*/
protected void buildScriptContexts() throws Exception {
log.println("Building ScriptContextPools");
try {
String scriptClass = svg.getInitParameter("scriptClass");
int poolmin = Integer.parseInt(svg.getInitParameter("minReports"));
int poolmax = Integer.parseInt(svg.getInitParameter("maxReports"));
int idrsDaysOpen = Integer.parseInt(svg.getInitParameter("daysReportsOpen"));
! scripts = new ScriptPool(poolmin,poolmax,scriptClass,2000,idrslogPath + "/contexts.log",10);
}
catch (Exception e) {
--- 205,230 ----
while (tok.hasMoreTokens()) {
key = tok.nextToken();
! tmp.put(key,((DbPool) dbs.get(key)).getInfo());
}
!
return tmp;
}
!
!
/**
* Builds script contexts
*/
protected void buildScriptContexts() throws Exception {
+ String scriptPooler = svg.getInitParameter("scriptPool");
+ scriptPooler = scriptPooler != null ? scriptPooler : DEFAULT_SCRIPT_POOL;
+
log.println("Building ScriptContextPools");
try {
+ scriptPool = (net.sourceforge.idrs.pool.ScriptPool) Class.forName(scriptPooler).newInstance();
String scriptClass = svg.getInitParameter("scriptClass");
int poolmin = Integer.parseInt(svg.getInitParameter("minReports"));
int poolmax = Integer.parseInt(svg.getInitParameter("maxReports"));
int idrsDaysOpen = Integer.parseInt(svg.getInitParameter("daysReportsOpen"));
! scriptPool.build(poolmin,poolmax,scriptClass,2000,idrslogPath + "/contexts.log",10);
}
catch (Exception e) {
***************
*** 226,230 ****
}
}
!
/**
* Main routine used to initialize the IDRS
--- 232,236 ----
}
}
!
/**
* Main routine used to initialize the IDRS
***************
*** 235,259 ****
log = new PrintStream(new FileOutputStream(new File(idrslogPath + "/startup.log")));
this.svg = svg;
!
log.println("Starting idrs");
log.println("Date : " + (new java.sql.Date(System.currentTimeMillis())).toString());
log.println("-------------------------------------------------------");
!
log.println("Starting Error Log");
buildLog();
!
//build app
app = buildApplication();
!
log.println("-------------------------------------------------------");
getAppDB();
!
!
log.println("-------------------------------------------------------");
!
retrieveDocDBs();
!
log.println("-------------------------------------------------------");
!
//first load appDB info
//now get toLower
--- 241,265 ----
log = new PrintStream(new FileOutputStream(new File(idrslogPath + "/startup.log")));
this.svg = svg;
!
log.println("Starting idrs");
log.println("Date : " + (new java.sql.Date(System.currentTimeMillis())).toString());
log.println("-------------------------------------------------------");
!
log.println("Starting Error Log");
buildLog();
!
//build app
app = buildApplication();
!
log.println("-------------------------------------------------------");
getAppDB();
!
!
log.println("-------------------------------------------------------");
!
retrieveDocDBs();
!
log.println("-------------------------------------------------------");
!
//first load appDB info
//now get toLower
***************
*** 263,289 ****
else
toLower = lower.equalsIgnoreCase("true");
!
//access denied re-direct page
this.deniedPage=svg.getInitParameter("accessDeniedPage");
if (this.deniedPage == null) this.deniedPage="/";
- System.out.println("Access Denied Page:" + this.deniedPage);
//now load all of the docs
loadDocs();
log.println("-------------------------------------------------------");
!
log.println("-------------------------------------------------------");
//build script contexts
buildScriptContexts();
log.println("-------------------------------------------------------");
!
this.digestType = svg.getInitParameter("digestType");
digestPass = digestType != null && ! digestType.equalsIgnoreCase("none");
log.close();
!
!
}
!
/**
* Builds the basis of the Application object from the web.xml file
--- 269,297 ----
else
toLower = lower.equalsIgnoreCase("true");
!
//access denied re-direct page
this.deniedPage=svg.getInitParameter("accessDeniedPage");
if (this.deniedPage == null) this.deniedPage="/";
+
+ this.errorPage = svg.getInitParameter("errorPage");
+
//now load all of the docs
loadDocs();
log.println("-------------------------------------------------------");
!
log.println("-------------------------------------------------------");
//build script contexts
buildScriptContexts();
log.println("-------------------------------------------------------");
!
this.digestType = svg.getInitParameter("digestType");
digestPass = digestType != null && ! digestType.equalsIgnoreCase("none");
log.close();
!
!
}
!
/**
* Builds the basis of the Application object from the web.xml file
***************
*** 303,309 ****
log.println("Adding Var : " + varName + " -- " + varVal);
tmpApp.put(varName,varVal);
!
}
!
app = new Application(tmpApp);
tmpApp = null;
--- 311,317 ----
log.println("Adding Var : " + varName + " -- " + varVal);
tmpApp.put(varName,varVal);
!
}
!
app = new Application(tmpApp);
tmpApp = null;
***************
*** 312,331 ****
te.printStackTrace(log);
}
!
return app;
}
!
/**
* Creates the system db pool
*/
protected void getAppDB() throws Exception {
!
log.println("Createing IDRS app db pool");
String usedb = svg.getInitParameter("dbAlias");
if (usedb != null) {
useDocDB = usedb;
!
}
!
String dbUser = svg.getInitParameter("dbUser");
if (dbUser == null)
--- 320,340 ----
te.printStackTrace(log);
}
!
return app;
}
!
/**
* Creates the system db pool
*/
+ //Needs to be eliminated in favor of simply retrieving a name for the docs db and the authentication db
protected void getAppDB() throws Exception {
! /*
log.println("Createing IDRS app db pool");
String usedb = svg.getInitParameter("dbAlias");
if (usedb != null) {
useDocDB = usedb;
!
}
!
String dbUser = svg.getInitParameter("dbUser");
if (dbUser == null)
***************
*** 334,341 ****
if (dbPass == null)
dbPass = "";
!
appDB = new JDBCInfo("AppDB",svg.getInitParameter("dbDriver"),svg.getInitParameter("dbName"),dbUser,dbPass);
!
!
String contextPath = svg.getInitParameter("contextPath");
int minConns = Integer.parseInt(svg.getInitParameter("minConns"));
--- 343,350 ----
if (dbPass == null)
dbPass = "";
!
appDB = new JDBCInfo("AppDB",svg.getInitParameter("dbDriver"),svg.getInitParameter("dbName"),dbUser,dbPass);
!
!
String contextPath = svg.getInitParameter("contextPath");
int minConns = Integer.parseInt(svg.getInitParameter("minConns"));
***************
*** 348,371 ****
catch (Exception e) {
try {
!
e.printStackTrace(log);
}
catch (Exception e2) {}
! }
!
!
}
!
/**
* Loads all of the documents into their pools
*/
protected void loadDocs() throws Exception {
! IDRSPool pool;
log.println("Loading Docs");
String name="";
try {
! Class.forName(appDB.getDrivername()).newInstance();
! Connection con = DriverManager.getConnection(appDB.getUrl(),appDB.getUsername(),appDB.getPassword());
!
String sql = "SELECT * FROM tblDoc";
if (toLower) sql = sql.toLowerCase();
--- 357,390 ----
catch (Exception e) {
try {
!
e.printStackTrace(log);
}
catch (Exception e2) {}
! }*/
!
! docsDB = svg.getInitParameter("docDB");
! authDB = svg.getInitParameter("authDB");
!
!
!
!
!
}
!
/**
* Loads all of the documents into their pools
*/
protected void loadDocs() throws Exception {
! net.sourceforge.idrs.pool.RepPool pool;
log.println("Loading Docs");
String name="";
+ //String reportPool;
+
+ //reportPool = svg.getInitParameter("reportPool");
+ //reportPool = (reportPool != null) ? reportPool : DEFAULT_REPORT_POOL;
try {
!
! Connection con = ((net.sourceforge.idrs.pool.DbPool) dbs.get(docsDB)) .getInfo().build();
!
String sql = "SELECT * FROM tblDoc";
if (toLower) sql = sql.toLowerCase();
***************
*** 387,391 ****
DocInfo info;
ReportStore repstr;
!
if (toLower) {
docid=docid.toLowerCase();
--- 406,410 ----
DocInfo info;
ReportStore repstr;
!
if (toLower) {
docid=docid.toLowerCase();
***************
*** 398,411 ****
docparams = docparams.toLowerCase();
}
!
while (rs.next()) {
try {
name=rs.getString(docname);
rep = (IDRSRep) (new ObjectInputStream(rs.getBinaryStream(docsrc))).readObject();
! pool = new IDRSPool(rs.getInt(docmin),rs.getInt(docmax),rep,2000,(idrslogPath + "/" + rs.getString(docname) + ".log"),10);
info = new DocInfo(rs.getInt(docid),rs.getString(docname),rs.getString(docgroups),rs.getString(docparams),rs.getString(docconns));
repstr = new ReportStore(pool,info);
!
!
docsName.put(rs.getString(docname),repstr);
docsID.put(rs.getString(docid),repstr);
--- 417,431 ----
docparams = docparams.toLowerCase();
}
!
while (rs.next()) {
try {
name=rs.getString(docname);
rep = (IDRSRep) (new ObjectInputStream(rs.getBinaryStream(docsrc))).readObject();
! pool = createReportPool();
! pool.build(rs.getInt(docmin),rs.getInt(docmax),rep,2000L,(idrslogPath + "/" + rs.getString(docname) + ".log"),10);
info = new DocInfo(rs.getInt(docid),rs.getString(docname),rs.getString(docgroups),rs.getString(docparams),rs.getString(docconns));
repstr = new ReportStore(pool,info);
!
!
docsName.put(rs.getString(docname),repstr);
docsID.put(rs.getString(docid),repstr);
***************
*** 425,429 ****
}
}
!
/**
* Retrieves the connections defined in the web.xml file
--- 445,449 ----
}
}
!
/**
* Retrieves the connections defined in the web.xml file
***************
*** 431,441 ****
public void retrieveDocDBs() throws Exception {
log.println("Retrieving Doc Dbs");
int i;
int numDBs;
if (svg.getInitParameter("numDBs") == null)
numDBs = 0;
else
numDBs = Integer.parseInt(svg.getInitParameter("numDBs"));
!
String tmpUser,
tmpPass,
--- 451,465 ----
public void retrieveDocDBs() throws Exception {
log.println("Retrieving Doc Dbs");
+ String dbPool;
int i;
int numDBs;
+
+ dbPool = svg.getInitParameter("dbPool") != null ? svg.getInitParameter("dbPool") : DEFAULT_DB_POOL;
+
if (svg.getInitParameter("numDBs") == null)
numDBs = 0;
else
numDBs = Integer.parseInt(svg.getInitParameter("numDBs"));
!
String tmpUser,
tmpPass,
***************
*** 444,470 ****
tmpLog,
tmpAlias;
!
long tmpDaysOpen;
int tmpMin,
tmpMax;
!
dbs = new HashMap();
! JDBCPool tmpDB;
for (i = 1;i <= numDBs; i++) {
//An alias will be used to make deployment MUCH easier
tmpAlias = svg.getInitParameter("dbAlias" + Integer.toString(i));
!
tmpDriver = svg.getInitParameter("dbDriver" + Integer.toString(i));
!
tmpName = svg.getInitParameter("dbName" + Integer.toString(i));
!
//if no alias was supplied, then then driver will be used
if (tmpAlias == null)
tmpAlias = tmpName;
!
!
tmpUser = svg.getInitParameter("dbUser" + Integer.toString(i));
!
!
if (tmpUser == null)
tmpUser = "";
--- 468,494 ----
tmpLog,
tmpAlias;
!
long tmpDaysOpen;
int tmpMin,
tmpMax;
!
dbs = new HashMap();
! net.sourceforge.idrs.pool.DbPool tmpDB;
for (i = 1;i <= numDBs; i++) {
//An alias will be used to make deployment MUCH easier
tmpAlias = svg.getInitParameter("dbAlias" + Integer.toString(i));
!
tmpDriver = svg.getInitParameter("dbDriver" + Integer.toString(i));
!
tmpName = svg.getInitParameter("dbName" + Integer.toString(i));
!
//if no alias was supplied, then then driver will be used
if (tmpAlias == null)
tmpAlias = tmpName;
!
!
tmpUser = svg.getInitParameter("dbUser" + Integer.toString(i));
!
!
if (tmpUser == null)
tmpUser = "";
***************
*** 472,497 ****
if (tmpPass == null)
tmpPass = "";
!
tmpMin = Integer.parseInt(svg.getInitParameter("minConns" + Integer.toString(i)));
tmpMax = Integer.parseInt(svg.getInitParameter("maxConns" + Integer.toString(i)));
tmpDaysOpen = Long.parseLong(svg.getInitParameter("daysOpen" + Integer.toString(i)));
tmpLog = svg.getInitParameter("logPath" + Integer.toString(i));
!
try {
! tmpDB = new JDBCPool(tmpDriver,tmpDriver,tmpName,tmpUser,tmpPass,tmpMin,tmpMax,tmpDaysOpen,2000,tmpLog,10);
dbs.put(tmpAlias,tmpDB);
}
catch (Exception e) {
!
e.printStackTrace(log);
}
!
tmpAlias = null;
!
!
}
!
}
!
protected void buildLog() throws Exception {
formatter = new SimpleDateFormat("yyyy.MMMMM.dd hh::mm aaaa");
--- 496,523 ----
if (tmpPass == null)
tmpPass = "";
!
tmpMin = Integer.parseInt(svg.getInitParameter("minConns" + Integer.toString(i)));
tmpMax = Integer.parseInt(svg.getInitParameter("maxConns" + Integer.toString(i)));
tmpDaysOpen = Long.parseLong(svg.getInitParameter("daysOpen" + Integer.toString(i)));
tmpLog = svg.getInitParameter("logPath" + Integer.toString(i));
!
try {
! tmpDB = (DbPool) Class.forName(dbPool).newInstance();
! tmpDB.build(tmpDriver,tmpDriver,tmpName,tmpUser,tmpPass,tmpMin,tmpMax,tmpDaysOpen,2000L,tmpLog);
! System.out.println("Adding " + tmpName);
dbs.put(tmpAlias,tmpDB);
}
catch (Exception e) {
! e.printStackTrace(System.out);
e.printStackTrace(log);
}
!
tmpAlias = null;
!
!
}
!
}
!
protected void buildLog() throws Exception {
formatter = new SimpleDateFormat("yyyy.MMMMM.dd hh::mm aaaa");
***************
*** 500,504 ****
errorLog.println("[Log Begining " + now + "]");
}
!
public void logEvent(String type, Exception mess) throws Exception {
String now = formatter.format(new java.util.Date(System.currentTimeMillis()));
--- 526,530 ----
errorLog.println("[Log Begining " + now + "]");
}
!
public void logEvent(String type, Exception mess) throws Exception {
String now = formatter.format(new java.util.Date(System.currentTimeMillis()));
***************
*** 507,519 ****
errorLog.println("[End Event " + type + " " + now + "]");
}
!
public void close() throws Exception {
errorLog.close();
}
!
!
!
!
}
--- 533,554 ----
errorLog.println("[End Event " + type + " " + now + "]");
}
!
public void close() throws Exception {
errorLog.close();
}
+
+ public String getErrorPage() {
+ return errorPage;
+ }
! public RepPool createReportPool() throws Exception {
! String reportPool = svg.getInitParameter("reportPool");
! reportPool = (reportPool != null) ? reportPool : DEFAULT_REPORT_POOL;
! return (RepPool) Class.forName(reportPool).newInstance();
! }
!
!
!
!
}
Index: ReportStore.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet/ReportStore.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ReportStore.java 25 Dec 2001 06:44:00 -0000 1.1
--- ReportStore.java 22 Aug 2002 20:06:34 -0000 1.2
***************
*** 1,10 ****
package net.sourceforge.idrs.core.servlet;
import net.sourceforge.idrs.core.*;
public final class ReportStore {
! IDRSPool pool;
DocInfo info;
! public ReportStore(IDRSPool pool, DocInfo info) {
this.pool = pool;
this.info = info;
--- 1,12 ----
package net.sourceforge.idrs.core.servlet;
+
import net.sourceforge.idrs.core.*;
+ import net.sourceforge.idrs.pool.*;
public final class ReportStore {
! RepPool pool;
DocInfo info;
! public ReportStore(RepPool pool, DocInfo info) {
this.pool = pool;
this.info = info;
|