public class AppCacheManager extends AbstractInitializableObject<ApplicationContext>
EspritAppStarter
will be installed and started on the client using the
standard java-webstart mechanism. It's first action will be to mirror the remote
repository structure to a local cache directory by downloading the according
description files.EspritAppStarter
downloads and extracts the desired software from an
remote zip-archive file. Then it uses the information provided by the
AppDescriptor
to actually launch the software.
The main advantage of the AppCacheManager
is, that you have full control over
every launching detail - i.e. which java version should be used for launching, how much
memory should be used etc. Furthermore the downloaded software is not restricted to be
pure java. It's jar-files need not to be signed and it also may contain platform
specific libraries. Because it executes under the control of the
EspritAppStarterLaunch
it is also restartable.
The remote software repository is structured as follows:
App
s.ndf fileAppVersion
s.ndf fileAppDescriptor
.ndf file and the software
itself is provided by a zip-file which is referred in the app-appDescrEspritAppStarter
Constructor and Description |
---|
AppCacheManager(ApplicationContext ctx,
AppCacheUpdater updater) |
AppCacheManager(ApplicationContext ctx,
java.io.File appCacheRoot,
java.net.URL appStoreUrl) |
AppCacheManager(ApplicationContext ctx,
LogChannel logCh,
java.io.File appCacheRoot,
java.net.URL appStoreUrl) |
Modifier and Type | Method and Description |
---|---|
AbstractAsyncTask |
buildInstallationTask(AppDescriptor descr) |
WorkflowTask |
buildInstallationWFT(AbstractWorkflow workflow,
AppDescriptor descr) |
WorkflowTask |
buildJavaAppStartWFT(AbstractWorkflow workflow,
JavaAppDescriptor descr,
JavaVersion javaVersion,
java.util.List<java.lang.String> vmArgList,
java.util.List<java.lang.String> commandLineArgList) |
JavaCommandTask |
buildStartJavaAppTask(JavaAppDescriptor descr,
JavaVersion javaVersion,
java.util.List<java.lang.String> vmArgList,
java.util.List<java.lang.String> commandLineArgList) |
WorkflowTask |
buildStartJavaAppWFT(AbstractWorkflow workflow,
JavaAppDescriptor descr) |
void |
checkIsSoftwareInstalled(AppDescriptor appDescr) |
void |
checkSoftwareInstallation(AppDescriptor appDescr) |
void |
clearAppCache() |
void |
clearAppLogs() |
protected AppDescriptorHandler |
createAppDescriptorHandler(AppVersion appVersion) |
static void |
deleteAppLaunchPrefsTryFile(java.io.File launchDir) |
AppDescriptor |
findApp(java.lang.String appName)
Finds the
AppDescriptor for the given appName. |
AppDescriptor |
findApp(java.lang.String appName,
java.lang.String versionName)
Finds the
AppDescriptor that matches the given appName and versionName. |
java.io.File |
getAppCacheDir() |
java.io.File |
getAppCacheRoot() |
java.util.List<AppDescriptor> |
getAppDescriptors() |
java.io.File |
getAppLogDir() |
java.util.List<App> |
getApps() |
java.util.List<AppVersion> |
getAppVersions() |
java.util.List<JavaAppDescriptor> |
getJavaAppDescriptors() |
java.io.File |
getLaunchDir(AppDescriptor appDescr) |
java.io.File |
getLaunchDir(AppVersion appVersion) |
static boolean |
hasAppLaunchPrefsTryFile(java.io.File launchDir) |
void |
init()
Performs the initialization of this class.
|
boolean |
isSoftwareInstalled(AppDescriptor appDescr) |
void |
loadAppTree() |
static AppLaunchPrefs |
readAppLaunchPrefs(ApplicationContext ctx,
java.io.File launchDir)
Reads the
AppLaunchPrefs from the given launchDir. |
void |
setLogChannel(LogChannel logCh) |
void |
setUpdater(AppCacheUpdater updater) |
void |
setUpdaterEnabled(boolean isEnabled) |
AppLaunchTask |
startApp(AppDescriptor appDescr,
java.io.File appWorkingDir,
LogChannel logCh)
Returns a launch-task which is not yet submitted!
|
AppLaunchTask |
startApp(java.lang.String appName,
java.io.File appWorkingDir) |
AppLaunchTask |
startApp(java.lang.String appName,
java.lang.String versionName,
java.io.File appWorkingDir) |
AppLaunchTask |
startApp(java.lang.String appName,
java.lang.String versionName,
java.io.File appWorkingDir,
LogChannel logCh) |
static void |
storeAppLaunchPrefs(ApplicationContext ctx,
java.io.File launchDir,
AppLaunchPrefs launchPrefs) |
checkInitialized, isInitialized, setInitialized
getApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning
configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toString, toString
public AppCacheManager(ApplicationContext ctx, java.io.File appCacheRoot, java.net.URL appStoreUrl)
public AppCacheManager(ApplicationContext ctx, LogChannel logCh, java.io.File appCacheRoot, java.net.URL appStoreUrl)
public AppCacheManager(ApplicationContext ctx, AppCacheUpdater updater)
public void init() throws java.lang.Exception
Initializable
init
in interface Initializable
init
in class AbstractInitializableObject<ApplicationContext>
java.lang.Exception
public void setUpdaterEnabled(boolean isEnabled)
public final void setUpdater(AppCacheUpdater updater)
public final void setLogChannel(LogChannel logCh)
setLogChannel
in interface SimpleLogSupport
setLogChannel
in class AbstractApplicationObject<ApplicationContext>
public final java.io.File getAppCacheRoot()
public final java.io.File getAppCacheDir()
public final java.io.File getAppLogDir()
public final java.io.File getLaunchDir(AppVersion appVersion)
public final java.io.File getLaunchDir(AppDescriptor appDescr)
public final void loadAppTree() throws java.lang.Exception
java.lang.Exception
public final void clearAppCache()
public final void clearAppLogs()
public final java.util.List<App> getApps()
public final java.util.List<AppVersion> getAppVersions()
public final java.util.List<AppDescriptor> getAppDescriptors()
public final java.util.List<JavaAppDescriptor> getJavaAppDescriptors()
public final AppDescriptor findApp(java.lang.String appName)
AppDescriptor
for the given appName. Note that you will get the
version marked as the current one.public final AppDescriptor findApp(java.lang.String appName, java.lang.String versionName)
AppDescriptor
that matches the given appName and versionName.public final AppLaunchTask startApp(java.lang.String appName, java.io.File appWorkingDir) throws java.lang.Exception
java.lang.Exception
public final AppLaunchTask startApp(java.lang.String appName, java.lang.String versionName, java.io.File appWorkingDir) throws java.lang.Exception
java.lang.Exception
public final AppLaunchTask startApp(java.lang.String appName, java.lang.String versionName, java.io.File appWorkingDir, LogChannel logCh) throws java.lang.Exception
java.lang.Exception
public final AppLaunchTask startApp(AppDescriptor appDescr, java.io.File appWorkingDir, LogChannel logCh) throws java.lang.Exception
java.lang.Exception
protected AppDescriptorHandler createAppDescriptorHandler(AppVersion appVersion)
public final AbstractAsyncTask buildInstallationTask(AppDescriptor descr)
public final WorkflowTask buildInstallationWFT(AbstractWorkflow workflow, AppDescriptor descr)
public final JavaCommandTask buildStartJavaAppTask(JavaAppDescriptor descr, JavaVersion javaVersion, java.util.List<java.lang.String> vmArgList, java.util.List<java.lang.String> commandLineArgList)
public final WorkflowTask buildStartJavaAppWFT(AbstractWorkflow workflow, JavaAppDescriptor descr)
public final WorkflowTask buildJavaAppStartWFT(AbstractWorkflow workflow, JavaAppDescriptor descr, JavaVersion javaVersion, java.util.List<java.lang.String> vmArgList, java.util.List<java.lang.String> commandLineArgList)
public static void storeAppLaunchPrefs(ApplicationContext ctx, java.io.File launchDir, AppLaunchPrefs launchPrefs) throws java.lang.Exception
java.lang.Exception
public static boolean hasAppLaunchPrefsTryFile(java.io.File launchDir)
public static void deleteAppLaunchPrefsTryFile(java.io.File launchDir) throws java.lang.Exception
java.lang.Exception
public static AppLaunchPrefs readAppLaunchPrefs(ApplicationContext ctx, java.io.File launchDir) throws java.lang.Exception
AppLaunchPrefs
from the given launchDir. This is happens in three
steps:
AppLaunchPrefs
are read from the AppDescriptor
java.lang.Exception
public final boolean isSoftwareInstalled(AppDescriptor appDescr)
public final void checkIsSoftwareInstalled(AppDescriptor appDescr) throws java.lang.Exception
java.lang.Exception
public final void checkSoftwareInstallation(AppDescriptor appDescr) throws java.lang.Exception
java.lang.Exception
Copyright © 2014 EsprIT-Systems. All Rights Reserved.