at.spardat.xma.boot.comp
Class AppLoader

java.lang.Object
  extended byat.spardat.xma.boot.comp.AppLoaderBase
      extended byat.spardat.xma.boot.comp.AppLoader

public class AppLoader
extends AppLoaderBase

AppLoader is responsible for loading, updating and preparation of application information. It loads the xma-app.xml and the plugin-extenstions from the server. It also checks for updates, if the resources are expired.


Field Summary
 
Fields inherited from class at.spardat.xma.boot.comp.AppLoaderBase
log_, parseLog_, props
 
Constructor Summary
AppLoader(java.util.Properties pnew)
          constructor
 
Method Summary
static void checkIntegrity(XMAApp app)
          checks the application descriptor whether it is complete or not.
static java.util.ArrayList checkPluginSpecImpl(XMAApp app)
          this method checks wheather plugin-specīs can be found also as plugin-implīs and returns a list of missing plugin implementations.
static void checkResourceIntegrity(XMAApp app)
          checks the application descriptor whether it is complete or not.
 IComponentHelper getCompHelper()
          Returns the ComponentHelper used for SWT-dependent methods.
 IFileCache getFileCache()
          Gets the file cache used by this AppLoader
 CCLoader getSwtClassLoader()
          Returns the classloader used for loading SWT classes.
 AppContainer initAppComponent(XMA_URI uri, XMAApp appIn, VersionNumber serverVers)
          initializes the application container.
 AppContainer loadApplication(XMA_URI input, byte[] hash, VersionNumber serverVers)
          loads application/descriptor and underlying resources
 AppContainer loadApplicationWithBusyIndicator(XMA_URI input, byte[] hash, VersionNumber serverVers)
          loads application/descriptor and underlying resources and shows a window with a progrss bar while loading.
 void loadResources(XMA_URI uri, java.util.HashMap cmp, VersionNumber serverVers)
          loads resources and stores the reference in the XMAResource for later use.
 void markApplicationUsed(XMA_URI uriapp)
          Marks the given application as started with a timestamp.
protected static void urlLocalToArray(XMAResource xres, java.util.List list, java.lang.String type)
          If the type of xres matches 'type': The FileCache Url of 'xres' is added to 'list'.
 
Methods inherited from class at.spardat.xma.boot.comp.AppLoaderBase
createApplicationHash, mergeInto
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppLoader

public AppLoader(java.util.Properties pnew)
constructor

Method Detail

loadApplication

public AppContainer loadApplication(XMA_URI input,
                                    byte[] hash,
                                    VersionNumber serverVers)
                             throws java.lang.Exception
loads application/descriptor and underlying resources

Parameters:
input - the requested application/component URI as got from outside
hash - over xma-app.xml and plugin.xml
serverVers - version number of the xma-runtime on the server
Returns:
AppContainer the loaded application container.
Throws:
java.lang.RuntimeException - xml parse error, resource errors and server-errors
java.lang.Exception

loadApplicationWithBusyIndicator

public AppContainer loadApplicationWithBusyIndicator(XMA_URI input,
                                                     byte[] hash,
                                                     VersionNumber serverVers)
                                              throws java.lang.Exception
loads application/descriptor and underlying resources and shows a window with a progrss bar while loading.

Parameters:
input - the requested application/component URI as got from outside
hash - over xma-app.xml and plugin.xml
serverVers - version number of the xma-runtime on the server
Returns:
the loaded application container
Throws:
java.lang.Exception - xml parse error, resource errors and server-errors

initAppComponent

public AppContainer initAppComponent(XMA_URI uri,
                                     XMAApp appIn,
                                     VersionNumber serverVers)
                              throws java.io.IOException
initializes the application container. loads all required resources from disk creates and fills the class loader

Parameters:
uri - the requested application
appIn - parsed application descriptor
serverVers - version number of the xma-runtime on the server
Throws:
java.io.IOException - containing the filename on resource loading errors

urlLocalToArray

protected static void urlLocalToArray(XMAResource xres,
                                      java.util.List list,
                                      java.lang.String type)
If the type of xres matches 'type': The FileCache Url of 'xres' is added to 'list'. If xres is shared then the APPLICATION_STARTED Property with the current time is set.

Parameters:
xres - the resource
list - - stores the FileCache Url of xres
type -
Since:
1.3.0

checkIntegrity

public static void checkIntegrity(XMAApp app)
checks the application descriptor whether it is complete or not. that is:

Parameters:
app - model to check

checkResourceIntegrity

public static void checkResourceIntegrity(XMAApp app)
checks the application descriptor whether it is complete or not. that is:

Parameters:
app - model to check

checkPluginSpecImpl

public static java.util.ArrayList checkPluginSpecImpl(XMAApp app)
this method checks wheather plugin-specīs can be found also as plugin-implīs and returns a list of missing plugin implementations.

Parameters:
app - xma application descriptor
Returns:
array of missing implementations

loadResources

public void loadResources(XMA_URI uri,
                          java.util.HashMap cmp,
                          VersionNumber serverVers)
                   throws java.io.IOException
loads resources and stores the reference in the XMAResource for later use. this will either load it from file or try to load the resource from the server, if it is not already cached.

Parameters:
uri - application uri
cmp - hashmap that contains resources to be loaded.
serverVers - version number of the xma-runtime on the server
Throws:
java.io.IOException - containing the filename on resource loading errors

markApplicationUsed

public void markApplicationUsed(XMA_URI uriapp)
Marks the given application as started with a timestamp. This timestamp is used by the cache cleanup to remove unused old applications.

Parameters:
uriapp - indentifieing the application to mark

getFileCache

public IFileCache getFileCache()
Gets the file cache used by this AppLoader

Returns:
the used file cache object

getSwtClassLoader

public CCLoader getSwtClassLoader()
Returns the classloader used for loading SWT classes.

Returns:
the swtClassloader or null if no swtClassloader allready exists.

getCompHelper

public IComponentHelper getCompHelper()
Returns the ComponentHelper used for SWT-dependent methods.

Returns:
the ComponentHelper or null if no ComponentHelper allready exists.