com.sibvisions.rad.ui
Class ApplicationUtil

java.lang.Object
  extended by com.sibvisions.rad.ui.ApplicationUtil

public final class ApplicationUtil
extends Object

The ApplicationUtil is a utility for application launchers.


Method Summary
static IApplication createApplication(ILauncher pLauncher, ClassLoader pClassLoader, String pClassName)
          Creates an instance of an IApplication.
static IApplication createApplication(ILauncher pLauncher, String pClassName)
          Creates an instance of an IApplication.
static XmlNode getConfig(ILauncher pLauncher, String pName)
          Gets the parsed xml configuration.
static String getRegistryApplicationName(ILauncher pLauncher)
          Gets the application name out of the launcher.
static String getRegistryKey(String pApplication, String pKey)
          Gets the value for an application specific registry key.
static String replaceParameter(String pValue, ILauncher pLauncher)
          Replaces a parameter placeholder with the desired parameter.
static void setRegistryKey(String pApplication, String pKey, String pValue)
          Sets the value for an application specific registry key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createApplication

public static IApplication createApplication(ILauncher pLauncher,
                                             String pClassName)
                                      throws Throwable
Creates an instance of an IApplication.

Parameters:
pLauncher - the launch configuration
pClassName - the full qualified class name of the desired class
Returns:
a new IApplication instance
Throws:
Throwable - if the instance can not be created

createApplication

public static IApplication createApplication(ILauncher pLauncher,
                                             ClassLoader pClassLoader,
                                             String pClassName)
                                      throws Throwable
Creates an instance of an IApplication.

Parameters:
pLauncher - the launch configuration
pClassLoader - the class loader
pClassName - the full qualified class name of the desired class
Returns:
a new IApplication instance
Throws:
Throwable - if the instance can not be created

getConfig

public static XmlNode getConfig(ILauncher pLauncher,
                                String pName)
                         throws Exception
Gets the parsed xml configuration.

Parameters:
pLauncher - the launch configuration
pName - the configuration name or path
Returns:
the parsed configuration, or null if the config was not found
Throws:
Exception - xml parse error

replaceParameter

public static String replaceParameter(String pValue,
                                      ILauncher pLauncher)
Replaces a parameter placeholder with the desired parameter. The placeholder looks like the following: [SERVER] The placeholder will be replaced with the value of the SERVER parameter.

Parameters:
pValue - the value of an application parameter
pLauncher - the launcher
Returns:
the value with replaced placeholder(s)

setRegistryKey

public static void setRegistryKey(String pApplication,
                                  String pKey,
                                  String pValue)
Sets the value for an application specific registry key.

Parameters:
pApplication - the application name
pKey - the key to set
pValue - the value to set
Throws:
SecurityException - if a SecurityManager is present and denies the registry access
RuntimeException - if it's not possible to save the registry key

getRegistryKey

public static String getRegistryKey(String pApplication,
                                    String pKey)
Gets the value for an application specific registry key.

Parameters:
pApplication - the application name
pKey - the key to get
Returns:
the value for the pKey or null if the application or key is not visible
Throws:
SecurityException - if a SecurityManager is present and denies the registry access

getRegistryApplicationName

public static String getRegistryApplicationName(ILauncher pLauncher)
Gets the application name out of the launcher. If the serverbase param is configured, then the value of this parameter will be the prefix for the application.

Parameters:
pLauncher - the launcher with properties for the application
Returns:
the application name prefixed with the serverbase


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.