com.izforge.izpack.event
Class AntActionInstallerListener

java.lang.Object
  extended bycom.izforge.izpack.event.SimpleInstallerListener
      extended bycom.izforge.izpack.event.AntActionInstallerListener
All Implemented Interfaces:
InstallerListener

public class AntActionInstallerListener
extends SimpleInstallerListener

Installer listener for performing ANT actions. The definition what should be done will be made in a specification file which is referenced by the resource id "AntActionsSpec.xml". There should be an entry in the install.xml file in the sub ELEMENT "res" of ELEMENT "resources" which references it. The specification of the xml file is done in the DTD antaction.dtd. The xml file specifies, for what pack what ant call should be performed at what time of installation.

Author:
Thomas Guenter, Klaus Bartz

Field Summary
private  java.util.HashMap actions
           
static java.lang.String SPEC_FILE_NAME
          Name of the specification file
private  java.util.ArrayList 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
AntActionInstallerListener()
          Default constructor
 
Method Summary
 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 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, java.lang.String order)
           
 java.util.HashMap getActions()
          Returns the actions map.
protected  java.util.ArrayList getActions(java.lang.String packName, java.lang.String order)
          Returns the defined actions for the given pack in the requested order.
private  void performAllActions(java.lang.String packName, java.lang.String order, AbstractUIProgressHandler handler)
          Performs all actions which are defined for the given pack and order.
private  AntAction readAntCall(XMLElement el)
          Returns an ant call which is defined in the given XML element.
 
Methods inherited from class com.izforge.izpack.event.SimpleInstallerListener
afterDir, afterFile, beforeDir, beforeFile, getInstalldata, getMsg, getProgressBarCallerCount, getProgressBarCallerId, getSpecHelper, informProgressBar, isFileListener, 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
Name of the specification file

See Also:
Constant Field Values

actions

private java.util.HashMap actions

uninstActions

private java.util.ArrayList uninstActions
Constructor Detail

AntActionInstallerListener

public AntActionInstallerListener()
Default constructor

Method Detail

getActions

public java.util.HashMap getActions()
Returns the actions map.

Returns:
the actions map

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
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
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
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
Throws:
java.lang.Exception

getActionCount

private int getActionCount(AutomatedInstallData idata,
                           java.lang.String order)

getActions

protected java.util.ArrayList getActions(java.lang.String packName,
                                         java.lang.String order)
Returns the defined actions for the given pack in the requested order.

Parameters:
packName - name of the pack for which the actions should be returned
order - order to be used; valid are beforepack and afterpack
Returns:
a list which contains all defined actions for the given pack and order

performAllActions

private void performAllActions(java.lang.String packName,
                               java.lang.String order,
                               AbstractUIProgressHandler handler)
                        throws InstallerException
Performs all actions which are defined for the given pack and order.

Parameters:
packName - name of the pack for which the actions should be performed
order - order to be used; valid are beforepack and afterpack
Throws:
InstallerException

readAntCall

private AntAction readAntCall(XMLElement el)
                       throws InstallerException
Returns an ant call which is defined in the given XML element.

Parameters:
el - XML element which contains the description of an ant call
Returns:
an ant call which is defined in the given XML element
Throws:
InstallerException