com.izforge.izpack.event
Class BSFInstallerListener

java.lang.Object
  extended by com.izforge.izpack.event.SimpleInstallerListener
      extended by com.izforge.izpack.event.BSFInstallerListener
All Implemented Interfaces:
InstallerListener

public class BSFInstallerListener
extends SimpleInstallerListener


Field Summary
private  java.util.HashMap<java.lang.String,java.util.ArrayList<BSFAction>> actions
           
private  java.lang.String currentPack
           
private  AutomatedInstallData installdata
           
static java.lang.String SPEC_FILE_NAME
           
private  java.util.ArrayList<BSFAction> uninstActions
           
 
Fields inherited from class com.izforge.izpack.event.SimpleInstallerListener
doInformProgressBar, LANG_FILE_NAME, langpack
 
Fields inherited from interface com.izforge.izpack.event.InstallerListener
AFTER_DIR, AFTER_FILE, AFTER_PACK, AFTER_PACKS, BEFORE_DIR, BEFORE_FILE, BEFORE_PACK, BEFORE_PACKS
 
Constructor Summary
BSFInstallerListener()
           
 
Method Summary
 void afterDir(java.io.File file, PackFile pack)
          This method will be called from the unpacker after one directory was created.
 void afterFile(java.io.File file, PackFile pack)
          This method will be called from the unpacker after one file was installed.
 void afterPack(Pack pack, java.lang.Integer i, AbstractUIProgressHandler handler)
          This method will be called from the unpacker after the installation of one pack was performed.
 void afterPacks(AutomatedInstallData idata, AbstractUIProgressHandler handler)
          This method will be called from the unpacker after the installation of all packs was performed.
 void beforeDir(java.io.File file, PackFile pack)
          This method will be called from the unpacker before one directory should be created.
 void beforeFile(java.io.File file, PackFile pack)
          This method will be called from the unpacker before one file should be installed.
 void beforePack(Pack pack, java.lang.Integer i, AbstractUIProgressHandler handler)
          This method will be called from the unpacker before the installation of one pack will be performed.
 void beforePacks(AutomatedInstallData idata, java.lang.Integer npacks, AbstractUIProgressHandler handler)
          This method will be called from the unpacker before the installation of all packs will be performed.
private  int getActionCount(AutomatedInstallData idata)
           
protected  java.util.ArrayList<BSFAction> getActions(java.lang.String packName)
           
 boolean isFileListener()
          Returns true if this listener would be informed at every file and directory installation, else false.
private  void performAllActions(java.lang.String packName, java.lang.String order, AbstractUIProgressHandler handler, java.lang.Object[] callParams)
           
private  BSFAction readAction(IXMLElement element, AutomatedInstallData idata)
           
 
Methods inherited from class com.izforge.izpack.event.SimpleInstallerListener
afterInstallerInitialization, getInstalldata, getMsg, getProgressBarCallerCount, getProgressBarCallerId, getSpecHelper, informProgressBar, setInstalldata, setProgressBarCaller, setSpecHelper
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPEC_FILE_NAME

public static final java.lang.String SPEC_FILE_NAME
See Also:
Constant Field Values

actions

private java.util.HashMap<java.lang.String,java.util.ArrayList<BSFAction>> actions

uninstActions

private java.util.ArrayList<BSFAction> uninstActions

currentPack

private java.lang.String currentPack

installdata

private AutomatedInstallData installdata
Constructor Detail

BSFInstallerListener

public BSFInstallerListener()
Method Detail

beforePacks

public void beforePacks(AutomatedInstallData idata,
                        java.lang.Integer npacks,
                        AbstractUIProgressHandler handler)
                 throws java.lang.Exception
Description copied from interface: InstallerListener
This method will be called from the unpacker before the installation of all packs will be performed.

Specified by:
beforePacks in interface InstallerListener
Overrides:
beforePacks in class SimpleInstallerListener
Parameters:
idata - object containing the current installation data
npacks - number of packs which are defined for this installation
handler - a handler to the current used UIProgressHandler
Throws:
java.lang.Exception

afterPack

public void afterPack(Pack pack,
                      java.lang.Integer i,
                      AbstractUIProgressHandler handler)
               throws java.lang.Exception
Description copied from interface: InstallerListener
This method will be called from the unpacker after the installation of one pack was performed.

Specified by:
afterPack in interface InstallerListener
Overrides:
afterPack in class SimpleInstallerListener
Parameters:
pack - current pack object
i - current pack number
handler - a handler to the current used UIProgressHandler
Throws:
java.lang.Exception

afterPacks

public void afterPacks(AutomatedInstallData idata,
                       AbstractUIProgressHandler handler)
                throws java.lang.Exception
Description copied from interface: InstallerListener
This method will be called from the unpacker after the installation of all packs was performed.

Specified by:
afterPacks in interface InstallerListener
Overrides:
afterPacks in class SimpleInstallerListener
Parameters:
idata - object containing the current installation data
handler - a handler to the current used UIProgressHandler
Throws:
java.lang.Exception

beforePack

public void beforePack(Pack pack,
                       java.lang.Integer i,
                       AbstractUIProgressHandler handler)
                throws java.lang.Exception
Description copied from interface: InstallerListener
This method will be called from the unpacker before the installation of one pack will be performed.

Specified by:
beforePack in interface InstallerListener
Overrides:
beforePack in class SimpleInstallerListener
Parameters:
pack - current pack object
i - current pack number
handler - a handler to the current used UIProgressHandler
Throws:
java.lang.Exception

afterDir

public void afterDir(java.io.File file,
                     PackFile pack)
              throws java.lang.Exception
Description copied from interface: InstallerListener
This method will be called from the unpacker after one directory was created. If parent directories should be created, this method will be called for every directory beginning with the base.

Specified by:
afterDir in interface InstallerListener
Overrides:
afterDir in class SimpleInstallerListener
Parameters:
file - current File object of the just created directory
pack - corresponding PackFile object
Throws:
java.lang.Exception

afterFile

public void afterFile(java.io.File file,
                      PackFile pack)
               throws java.lang.Exception
Description copied from interface: InstallerListener
This method will be called from the unpacker after one file was installed.

Specified by:
afterFile in interface InstallerListener
Overrides:
afterFile in class SimpleInstallerListener
Parameters:
file - current File object of the just installed file
pack - corresponding PackFile object
Throws:
java.lang.Exception

beforeDir

public void beforeDir(java.io.File file,
                      PackFile pack)
               throws java.lang.Exception
Description copied from interface: InstallerListener
This method will be called from the unpacker before one directory should be created. If parent directories should be created also, this method will be called for every directory beginning with the base.

Specified by:
beforeDir in interface InstallerListener
Overrides:
beforeDir in class SimpleInstallerListener
Parameters:
file - current File object of the just directory which should be created
pack - corresponding PackFile object
Throws:
java.lang.Exception

beforeFile

public void beforeFile(java.io.File file,
                       PackFile pack)
                throws java.lang.Exception
Description copied from interface: InstallerListener
This method will be called from the unpacker before one file should be installed.

Specified by:
beforeFile in interface InstallerListener
Overrides:
beforeFile in class SimpleInstallerListener
Parameters:
file - current File object of the file which should be installed
pack - corresponding PackFile object
Throws:
java.lang.Exception

isFileListener

public boolean isFileListener()
Description copied from interface: InstallerListener
Returns true if this listener would be informed at every file and directory installation, else false. If it is true, the listener will be called two times (before and after) for every action. Handle carefully, else performance problems are possible.

Specified by:
isFileListener in interface InstallerListener
Overrides:
isFileListener in class SimpleInstallerListener
Returns:
true if this listener would be informed at every file and directory installation, else false

getActions

protected java.util.ArrayList<BSFAction> getActions(java.lang.String packName)

getActionCount

private int getActionCount(AutomatedInstallData idata)

performAllActions

private void performAllActions(java.lang.String packName,
                               java.lang.String order,
                               AbstractUIProgressHandler handler,
                               java.lang.Object[] callParams)
                        throws InstallerException
Throws:
InstallerException

readAction

private BSFAction readAction(IXMLElement element,
                             AutomatedInstallData idata)
                      throws InstallerException
Throws:
InstallerException