PageBoxLib
Class Reinstall

java.lang.Object
  extended byjava.lang.Thread
      extended byPageBoxLib.Reinstall
All Implemented Interfaces:
java.lang.Runnable

public class Reinstall
extends java.lang.Thread

Reinstall the archives on startup. Called by Update. Motivation; init cannot call this Application server instance.

Changes:

alexis.grandemange@pagebox.net

Copyright (c) 2002-2004 Alexis Grandemange

This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public License
 as published by the Free Software Foundation; version 2.1 of the
 License.
 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 GNU Lesser General Public License for more details.
 A copy of the GNU Lesser General Public License lesser.txt should be
 included in the distribution.

Version:
0, 1, 0
Author:
Alexis Grandemange

Field Summary
(package private)  java.util.TreeMap archives
          Archives currently installed Key: archive name Value: Archive object
(package private)  ASInstallIF ASInstaller
          Application Server Installation object
(package private)  ServletContext ctx
          Unique to the Web application
(package private)  DynDns dd
          DynDns instance
(package private)  InstallHelper ih
          Object used to run the database creation script and the Install class
(package private)  Log log
          Logging object
(package private)  RuleHandler.Rule rule
          Memory representation of rules.xml
(package private)  java.lang.String subUrl
          URL of the DeployIF web service of this PageBox
(package private)  java.lang.String target
          Actual target from rule.target
(package private)  java.lang.String workDir
          Directory where XML and log files are defined
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Reinstall(ServletContext ctx, java.lang.String workDir, Log log, DynDns dd)
          Creates the thread.
 
Method Summary
private  java.lang.String restorePbArchs()
          Parse PbArchives.xml and set the archives HashMap.
private  void retry(boolean isStartup)
          Called by the run method (Reinstall thread) and by the retry method above.
 void retry(java.lang.String subUrl)
          Called by Update.doPost when the user clicks on the retry button.
 void run()
          Main method of the Retry thread.
private  java.lang.String savePbArchs()
          Save the archives HashMap in PbArchives.xml.
 void setUrl(java.lang.String subUrl)
          Called by Update to store the PageBox URL in PbArchives.xml.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, 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

ctx

ServletContext ctx
Unique to the Web application


workDir

java.lang.String workDir
Directory where XML and log files are defined


target

java.lang.String target
Actual target from rule.target


log

Log log
Logging object


archives

java.util.TreeMap archives
Archives currently installed


ASInstaller

ASInstallIF ASInstaller
Application Server Installation object


ih

InstallHelper ih
Object used to run the database creation script and the Install class


subUrl

java.lang.String subUrl
URL of the DeployIF web service of this PageBox


rule

RuleHandler.Rule rule
Memory representation of rules.xml


dd

DynDns dd
DynDns instance

Constructor Detail

Reinstall

public Reinstall(ServletContext ctx,
                 java.lang.String workDir,
                 Log log,
                 DynDns dd)
Creates the thread.

Parameters:
log - log instance
Method Detail

restorePbArchs

private java.lang.String restorePbArchs()
Parse PbArchives.xml and set the archives HashMap.

Returns:
status.

savePbArchs

private java.lang.String savePbArchs()
Save the archives HashMap in PbArchives.xml.


run

public void run()
Main method of the Retry thread.


retry

public void retry(java.lang.String subUrl)
Called by Update.doPost when the user clicks on the retry button. Reinstall on the application server and reinstall of archives in "setting pb" state.

Parameters:
subUrl - URL of the DeployIF web service of this PageBox

setUrl

public void setUrl(java.lang.String subUrl)
Called by Update to store the PageBox URL in PbArchives.xml.

Parameters:
subUrl - URL of the DeployIF web service of this PageBox

retry

private void retry(boolean isStartup)
Called by the run method (Reinstall thread) and by the retry method above. Reinstall on the application server and reinstall of archives in "setting pb" state

Parameters:
isStartup - true if called by thread (at startup)