Class FileUpdateAgent
- java.lang.Object
-
- jadex.platform.service.autoupdate.UpdateAgent
-
- jadex.platform.service.autoupdate.FileUpdateAgent
-
- All Implemented Interfaces:
IUpdateService
public class FileUpdateAgent extends UpdateAgent
The file update agent is based on a scan directory in which new versions are detected. If a new version was found the agent will initiate a platform restart.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
excludedirs
The dir exclude pattern.protected java.lang.String
includefiles
The file include pattern.protected java.lang.String
libdir
protected long
newestversion
The newest version date (either current version or newest detected file).protected java.lang.String
rootdir
protected long
safetydelay
The safety delay.protected java.lang.String
scandir
-
Fields inherited from class jadex.platform.service.autoupdate.UpdateAgent
account, agent, errorfile, forbiddenvmargs, interval, outputfile, receivers, separatevm
-
-
Constructor Summary
Constructors Constructor Description FileUpdateAgent()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected IFuture<UpdateInfo>
checkForUpdate()
Check if an update is available.protected void
findDistDirs(java.io.File dir, java.util.TreeSet<java.io.File> results)
Recursively scan dirs to find those with a jadex distribution contained.protected IFuture<StartOptions>
generateStartOptions(UpdateInfo ui)
Generate the start options.protected IFuture<java.lang.Long>
getLastVersion()
Get the last version (current or from last update check).protected java.util.Map<java.lang.String,java.lang.Object>
getUpdateArguments()
Convert the root dir to absolute to avoid nesting dist dirs in dist dirs.static void
main(java.lang.String[] args)
Main for testing.-
Methods inherited from class jadex.platform.service.autoupdate.UpdateAgent
body, flattenStrings, getLocalVersionInfo, getVersionInfo, notifyUpdateResult, performUpdate, startPlatformInSameVM, startPlatformInSeparateVM
-
-
-
-
Field Detail
-
rootdir
protected java.lang.String rootdir
-
scandir
protected java.lang.String scandir
-
libdir
protected java.lang.String libdir
-
newestversion
protected long newestversion
The newest version date (either current version or newest detected file).
-
includefiles
protected java.lang.String includefiles
The file include pattern.
-
excludedirs
protected java.lang.String excludedirs
The dir exclude pattern.
-
safetydelay
protected long safetydelay
The safety delay.
-
-
Method Detail
-
generateStartOptions
protected IFuture<StartOptions> generateStartOptions(UpdateInfo ui)
Generate the start options. - classpath: sets it to all jars of the newest found jadex distribution dir.- Overrides:
generateStartOptions
in classUpdateAgent
-
checkForUpdate
protected IFuture<UpdateInfo> checkForUpdate()
Check if an update is available.- Overrides:
checkForUpdate
in classUpdateAgent
-
findDistDirs
protected void findDistDirs(java.io.File dir, java.util.TreeSet<java.io.File> results)
Recursively scan dirs to find those with a jadex distribution contained. Sorts the found entries according to their date.
-
getLastVersion
protected IFuture<java.lang.Long> getLastVersion()
Get the last version (current or from last update check). Uses the timestamp of a jadex jar in the used classpath.
-
getUpdateArguments
protected java.util.Map<java.lang.String,java.lang.Object> getUpdateArguments()
Convert the root dir to absolute to avoid nesting dist dirs in dist dirs.- Overrides:
getUpdateArguments
in classUpdateAgent
-
main
public static void main(java.lang.String[] args)
Main for testing.
-
-