Class UpdateAgent
- java.lang.Object
-
- jadex.platform.service.autoupdate.UpdateAgent
-
- All Implemented Interfaces:
IUpdateService
- Direct Known Subclasses:
FileUpdateAgent
,MavenUpdateAgent
public class UpdateAgent extends java.lang.Object implements IUpdateService
The update agent can be used to restart the platform with a newer version.
-
-
Field Summary
Fields Modifier and Type Field Description protected EmailAccount
account
The email account.protected IInternalAccess
agent
The agent.protected java.lang.String
errorfile
The error file (if any).protected java.lang.String[]
forbiddenvmargs
The vmargs that should not be used.protected long
interval
The check for update interval.protected java.lang.String
outputfile
The output file (if any).protected java.lang.String[]
receivers
The email receivers.protected boolean
separatevm
Flag if new vm should be used.
-
Constructor Summary
Constructors Constructor Description UpdateAgent()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
body()
The agent body.protected IFuture<UpdateInfo>
checkForUpdate()
Check if an update is available.java.lang.String
flattenStrings(java.util.Iterator<java.lang.String> it, java.lang.String delim)
Flatten strings to one string.protected IFuture<StartOptions>
generateStartOptions(UpdateInfo ui)
Generate the vm start options.protected static java.lang.String
getLocalVersionInfo()
Create a string for the local Jadex version.protected java.util.Map<java.lang.String,java.lang.Object>
getUpdateArguments()
Get the arguments to use for the update agent.protected IFuture<java.lang.String>
getVersionInfo(IComponentIdentifier newcid)
Get the version info for a new platform.protected IFuture<java.lang.Void>
notifyUpdateResult(java.lang.String text)
Notify administrators that platform update has been tried.IFuture<IComponentIdentifier>
performUpdate(UpdateInfo ui)
Perform the update.IFuture<IComponentIdentifier>
startPlatformInSameVM()
Start a new platform in the same vm.IFuture<IComponentIdentifier>
startPlatformInSeparateVM(StartOptions so)
Start a new platform in a separate vm.
-
-
-
Field Detail
-
interval
protected long interval
The check for update interval.
-
separatevm
protected boolean separatevm
Flag if new vm should be used.
-
agent
protected IInternalAccess agent
The agent.
-
forbiddenvmargs
protected java.lang.String[] forbiddenvmargs
The vmargs that should not be used.
-
account
protected EmailAccount account
The email account.
-
receivers
protected java.lang.String[] receivers
The email receivers.
-
outputfile
protected java.lang.String outputfile
The output file (if any).
-
errorfile
protected java.lang.String errorfile
The error file (if any).
-
-
Method Detail
-
body
public void body()
The agent body.
-
getVersionInfo
protected IFuture<java.lang.String> getVersionInfo(IComponentIdentifier newcid)
Get the version info for a new platform.
-
getLocalVersionInfo
protected static java.lang.String getLocalVersionInfo()
Create a string for the local Jadex version.
-
notifyUpdateResult
protected IFuture<java.lang.Void> notifyUpdateResult(java.lang.String text)
Notify administrators that platform update has been tried.
-
performUpdate
public IFuture<IComponentIdentifier> performUpdate(UpdateInfo ui)
Perform the update.- Specified by:
performUpdate
in interfaceIUpdateService
- Parameters:
ui
- The update info.
-
startPlatformInSameVM
public IFuture<IComponentIdentifier> startPlatformInSameVM()
Start a new platform in the same vm.
-
startPlatformInSeparateVM
public IFuture<IComponentIdentifier> startPlatformInSeparateVM(StartOptions so)
Start a new platform in a separate vm.
-
generateStartOptions
protected IFuture<StartOptions> generateStartOptions(UpdateInfo ui)
Generate the vm start options. - main class: jadex.base.Starter - vmargs: old vmargs (without debug option) - program args: old program args (with updated argument for update agent to allow handshake)
-
flattenStrings
public java.lang.String flattenStrings(java.util.Iterator<java.lang.String> it, java.lang.String delim)
Flatten strings to one string.- Parameters:
it
- The iterator of strings.delim
- The delimiter used to connect the entries.
-
checkForUpdate
protected IFuture<UpdateInfo> checkForUpdate()
Check if an update is available.
-
getUpdateArguments
protected java.util.Map<java.lang.String,java.lang.Object> getUpdateArguments()
Get the arguments to use for the update agent.
-
-