|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.izforge.izpack.installer.UnpackerBase
public abstract class UnpackerBase
Abstract base class for all unpacker implementations.
Field Summary | |
---|---|
protected java.io.File |
absolute_installpath
The absolute path of the installation. |
static java.lang.String |
ALIVE
|
protected static boolean |
discardInterrupt
Do not perform a interrupt call. |
protected AbstractUIProgressHandler |
handler
The installer listener. |
protected AutomatedInstallData |
idata
The installdata. |
protected static java.util.HashMap<java.lang.Object,java.lang.String> |
instances
The instances of the unpacker objects. |
static java.lang.String |
INTERRUPT
|
protected static boolean |
interruptDesired
Interrupt flag if global interrupt is desired. |
static java.lang.String |
INTERRUPTED
|
protected static java.lang.String |
LANG_FILE_NAME
The name of the XML file that specifies the panel langpack |
protected LocaleDatabase |
langpack
The packs locale database. |
protected boolean |
result
The result of the operation. |
protected RulesEngine |
rules
|
protected UninstallData |
udata
The uninstallation data. |
protected VariableSubstitutor |
vs
The variables substitutor. |
Constructor Summary | |
---|---|
UnpackerBase(AutomatedInstallData idata,
AbstractUIProgressHandler handler)
The constructor. |
Method Summary | |
---|---|
protected void |
addToInstances()
Adds this to the map of all existent instances of Unpacker. |
private boolean |
fileMatchesOnePattern(java.lang.String filename,
java.util.ArrayList<org.apache.regexp.RE> patterns)
|
protected java.util.List[] |
getCustomActions()
Returns the defined custom actions split into types including a constructed type for the file related installer listeners. |
boolean |
getResult()
Return the state of the operation. |
static java.util.HashMap |
getRunningInstances()
Returns a copy of the active unpacker instances. |
protected void |
handleAdditionalUninstallData(UninstallData udata,
java.util.List[] customData)
Adds additional unistall data to the uninstall data object. |
protected void |
informListeners(java.util.List[] customActions,
int action,
java.lang.Object firstParam,
java.lang.Object secondParam,
java.lang.Object thirdParam)
Informs all listeners which would be informed at the given action type. |
static boolean |
interruptAll(long waitTime)
Initiate interrupt of all alive Unpacker and waits until all Unpacker are interrupted or the wait time has arrived. |
static boolean |
isDiscardInterrupt()
Returns whether an interrupt request should be discarded or not. |
static boolean |
isInterruptDesired()
Returns the interrupt desired state. |
private static boolean |
isInterruptReady()
|
protected boolean |
mkDirsWithEnhancement(java.io.File dest,
PackFile pf,
java.util.List[] customActions)
Creates the given directory recursive and calls the method "afterDir" of each listener with the current file object and the pack file object. |
protected boolean |
performInterrupted()
Sets the interrupt flag for this Unpacker to INTERRUPTED if the previos state was INTERRUPT or INTERRUPTED and returns whether interrupt was initiate or not. |
protected void |
performUpdateChecks(java.util.ArrayList<UpdateCheck> updatechecks)
|
private java.util.List<org.apache.regexp.RE> |
preparePatterns(java.util.ArrayList<java.lang.String> list,
org.apache.regexp.RECompiler recompiler)
|
protected void |
putUninstaller()
Puts the uninstaller. |
protected void |
removeFromInstances()
Removes this from the map of all existent instances of Unpacker. |
abstract void |
run()
|
static void |
setDiscardInterrupt(boolean di)
Sets the discard interrupt flag. |
private static void |
setInterruptAll()
Initiate interrupt of all alive Unpacker. |
private static void |
setInterruptDesired(boolean interruptDesired)
|
void |
setRules(RulesEngine rules)
Called by the InstallerFrame to set a reference to the RulesEngine, which will be used to check conditions. |
private boolean |
shouldInterrupt()
Returns whether interrupt was initiate or not for this Unpacker. |
void |
writeInstallationInformation()
Writes information about the installed packs and the variables at installation time. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected AutomatedInstallData idata
protected AbstractUIProgressHandler handler
protected UninstallData udata
protected VariableSubstitutor vs
protected java.io.File absolute_installpath
protected LocaleDatabase langpack
protected boolean result
protected static java.util.HashMap<java.lang.Object,java.lang.String> instances
protected static boolean interruptDesired
protected static boolean discardInterrupt
protected static final java.lang.String LANG_FILE_NAME
public static final java.lang.String ALIVE
public static final java.lang.String INTERRUPT
public static final java.lang.String INTERRUPTED
protected RulesEngine rules
Constructor Detail |
---|
public UnpackerBase(AutomatedInstallData idata, AbstractUIProgressHandler handler)
idata
- The installation data.handler
- The installation progress handler.Method Detail |
---|
public void setRules(RulesEngine rules)
IUnpacker
setRules
in interface IUnpacker
rules
- - an instantiated RulesEnginepublic static java.util.HashMap getRunningInstances()
protected void addToInstances()
protected void removeFromInstances()
private static void setInterruptAll()
public static boolean interruptAll(long waitTime)
waitTime
- wait time in millisecounds
private static boolean isInterruptReady()
protected boolean performInterrupted()
private boolean shouldInterrupt()
public boolean getResult()
getResult
in interface IUnpacker
private boolean fileMatchesOnePattern(java.lang.String filename, java.util.ArrayList<org.apache.regexp.RE> patterns)
filename
- patterns
-
private java.util.List<org.apache.regexp.RE> preparePatterns(java.util.ArrayList<java.lang.String> list, org.apache.regexp.RECompiler recompiler)
list
- A list of file name patterns (in ant fileset syntax)recompiler
- The regular expression compiler (used to speed up RE compiling).
protected void informListeners(java.util.List[] customActions, int action, java.lang.Object firstParam, java.lang.Object secondParam, java.lang.Object thirdParam) throws java.lang.Exception
customActions
- array of lists with the custom action objectsaction
- identifier for which callback should be calledfirstParam
- first parameter for the callsecondParam
- second parameter for the callthirdParam
- third parameter for the call
java.lang.Exception
protected java.util.List[] getCustomActions()
protected boolean mkDirsWithEnhancement(java.io.File dest, PackFile pf, java.util.List[] customActions) throws java.lang.Exception
dest
- the directory which should be createdpf
- current pack file objectcustomActions
- all defined custom actions
java.lang.Exception
public static boolean isDiscardInterrupt()
public static void setDiscardInterrupt(boolean di)
di
- the discard interrupt flag to setpublic static boolean isInterruptDesired()
private static void setInterruptDesired(boolean interruptDesired)
interruptDesired
- The interrupt desired flag to setprotected void putUninstaller() throws java.lang.Exception
java.lang.Exception
- Description of the Exceptionprotected void handleAdditionalUninstallData(UninstallData udata, java.util.List[] customData)
udata
- unistall datacustomData
- array of lists of custom action data like uninstaller listenerspublic abstract void run()
run
in interface java.lang.Runnable
protected void performUpdateChecks(java.util.ArrayList<UpdateCheck> updatechecks)
updatechecks
- public void writeInstallationInformation() throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |