org.ow2.clif.util
Class ExecutionContext

java.lang.Object
  extended by org.ow2.clif.util.ExecutionContext

public abstract class ExecutionContext
extends java.lang.Object

This class helps gathering configuration parameters to ease portability between several assemblies of CLIF. It also configures log libraries and system properties.

Author:
Bruno Dillenseger, Florian Francheteau

Field Summary
static java.lang.String DEFAULT_MAXQ_PROPERTY_FILE
          relative path to the file holding MaxQ properties in console plugin
static java.lang.String DEFAULT_SERVER
          Name of the default CLIF server possibly launched by a user interface for convenience
static java.lang.String[] PROPERTIES_WITH_PATH
          Names of CLIF system properties whose value is a path
static java.lang.String PROPS_PATH
          relative path to the file holding CLIF system properties
static java.lang.String TEMPLATE_PATH
          relative path to the template file for CLIF system properties
static java.lang.String WORKSPACE_PATH
          absolute path to the workspace
 
Constructor Summary
ExecutionContext()
           
 
Method Summary
static java.lang.String getBaseDir()
          Gets the base directory of CLIF runtime environment.
static java.lang.String getMaxQPropFile()
          Gets location of maxq.properties file in current project
static void init(java.lang.String path)
          Sets the base directory of CLIF runtime environment, and configures log libraries.
static void setMaxQPropFile(java.lang.String dir)
          Sets absolute location of maxq.properties file in current project
static void setProperties(java.io.InputStream ins)
          Sets system properties according to the contents of an input stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SERVER

public static final java.lang.String DEFAULT_SERVER
Name of the default CLIF server possibly launched by a user interface for convenience

See Also:
Constant Field Values

TEMPLATE_PATH

public static final java.lang.String TEMPLATE_PATH
relative path to the template file for CLIF system properties

See Also:
Constant Field Values

DEFAULT_MAXQ_PROPERTY_FILE

public static final java.lang.String DEFAULT_MAXQ_PROPERTY_FILE
relative path to the file holding MaxQ properties in console plugin

See Also:
Constant Field Values

PROPS_PATH

public static final java.lang.String PROPS_PATH
relative path to the file holding CLIF system properties

See Also:
Constant Field Values

WORKSPACE_PATH

public static java.lang.String WORKSPACE_PATH
absolute path to the workspace


PROPERTIES_WITH_PATH

public static java.lang.String[] PROPERTIES_WITH_PATH
Names of CLIF system properties whose value is a path

Constructor Detail

ExecutionContext

public ExecutionContext()
Method Detail

init

public static void init(java.lang.String path)
Sets the base directory of CLIF runtime environment, and configures log libraries.

Parameters:
path - the filesystem path to the base directory of CLIF runtime environment. Must have a trailing filesystem separator.

getBaseDir

public static java.lang.String getBaseDir()
Gets the base directory of CLIF runtime environment.

Returns:
the base directory of CLIF runtime environment, or null if this directory has not been set.

setProperties

public static void setProperties(java.io.InputStream ins)
Sets system properties according to the contents of an input stream. The stream is read as a proerties-formatted content, from which property clif.parameters is analyzed and transformed into system properties.

Parameters:
ins - input stream properties are read from

setMaxQPropFile

public static void setMaxQPropFile(java.lang.String dir)
Sets absolute location of maxq.properties file in current project

Parameters:
dir - absolute location of maxq.properties

getMaxQPropFile

public static java.lang.String getMaxQPropFile()
Gets location of maxq.properties file in current project

Returns:
String the absolute path of maxq.properties