net.sourceforge.addam.ddlrun
Class ServletContainerUpgrader

java.lang.Object
  extended by net.sourceforge.addam.ddlrun.ServletContainerUpgrader
All Implemented Interfaces:
EventListener, ServletContextListener, RunLogger

public class ServletContainerUpgrader
extends Object
implements ServletContextListener, RunLogger

Since:
Mar 25, 2005
Author:
TIM3

Nested Class Summary
(package private) static class ServletContainerUpgrader.PropertiesMessageFormat
           
 
Field Summary
protected  String dbversion
           
(package private)  FileWriter errorLog
           
private  int scriptsExecuted
           
(package private)  ServletContext sCtx
           
 
Constructor Summary
ServletContainerUpgrader()
           
 
Method Summary
 void contextDestroyed(ServletContextEvent event)
          does nothing; required for ServletContextListener implementation
 void contextInitialized(ServletContextEvent event)
          kicks off an UpgradeRunner - requires a configured DataSource and a configured upgrade folder and upgrade script
private  FileWriter getErrorLogFileWriter(ServletContext sCtx)
           
private  void log(ServletContext sCtx, String message, FileWriter errorLog, Exception e)
           
 void logRunComplete(String group, long time)
           
 void logRunFailure(String group, String script, Exception e)
           
 void logRunScript(String script, long time)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sCtx

ServletContext sCtx

errorLog

FileWriter errorLog

scriptsExecuted

private int scriptsExecuted

dbversion

protected String dbversion
Constructor Detail

ServletContainerUpgrader

public ServletContainerUpgrader()
Method Detail

contextInitialized

public void contextInitialized(ServletContextEvent event)
kicks off an UpgradeRunner - requires a configured DataSource and a configured upgrade folder and upgrade script

Specified by:
contextInitialized in interface ServletContextListener

logRunScript

public void logRunScript(String script,
                         long time)
                  throws Exception
Specified by:
logRunScript in interface RunLogger
Throws:
Exception

logRunComplete

public void logRunComplete(String group,
                           long time)
                    throws Exception
Specified by:
logRunComplete in interface RunLogger
Throws:
Exception

logRunFailure

public void logRunFailure(String group,
                          String script,
                          Exception e)
                   throws Exception
Specified by:
logRunFailure in interface RunLogger
Throws:
Exception

log

private void log(ServletContext sCtx,
                 String message,
                 FileWriter errorLog,
                 Exception e)
          throws IOException
Throws:
IOException

getErrorLogFileWriter

private FileWriter getErrorLogFileWriter(ServletContext sCtx)
Parameters:
sCtx -
Returns:
To Do:
defer creation of file until actual writing error

contextDestroyed

public void contextDestroyed(ServletContextEvent event)
does nothing; required for ServletContextListener implementation

Specified by:
contextDestroyed in interface ServletContextListener


Copyright © 2005-2006 ADDAM Project Team. All Rights Reserved.