Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.common
Class Environment

java.lang.Object
  extended by org.nuxeo.common.Environment

public class Environment
extends Object

Author:
Bogdan Stefanescu

Field Summary
static String BUNDLES
           
static String BUNDLES_DIR
          The application layout (optional): directory containing nuxeo runtime osgi bundles.
static String CONFIG_DIR
          Deprecated. never defined; use NUXEO_CONFIG_DIR
static String DATA_DIR
          Deprecated. never defined; use NUXEO_DATA_DIR
static String HOME_DIR
          Deprecated. never defined; use NUXEO_HOME_DIR
static String JBOSS_HOST
          Constants that identifies possible hosts for the framework.
static String LOG_DIR
          Deprecated. never defined; use NUXEO_LOG_DIR
static String NUXEO_CONFIG_DIR
           
static String NUXEO_DATA_DIR
           
static String NUXEO_HOME_DIR
           
static String NUXEO_LOG_DIR
           
static String NUXEO_RUNTIME_HOME
           
static String NUXEO_TMP_DIR
           
static String NUXEO_WEB_DIR
           
static String NXSERVER_HOST
           
static String TOMCAT_HOST
           
static String WEB_DIR
          Deprecated. never defined; use NUXEO_WEB_DIR
 
Constructor Summary
Environment(File home)
           
Environment(File home, Properties properties)
           
 
Method Summary
 String[] getCommandLineArguments()
           
 File getConfig()
           
 Iterable<URL> getConfigurationProvider()
           
 File getData()
           
static Environment getDefault()
           
 File getHome()
           
 String getHostApplicationName()
           
 String getHostApplicationVersion()
           
 File getLog()
           
 Properties getProperties()
           
 String getProperty(String key)
           
 String getProperty(String key, String defaultValue)
           
 File getRuntimeHome()
           
 File getServerHome()
          This method always returns the server home (or null if NUXEO_HOME_DIR is not set), whereas getHome() may return runtime home.
 File getTemp()
           
 File getWeb()
           
 void init()
          Initialization with System properties to avoid issues due to home set with runtime home instead of server home.
 boolean isApplicationServer()
           
 boolean isJBoss()
           
 boolean isJetty()
           
 boolean isTomcat()
           
 void loadProperties(Properties props)
           
 void setCommandLineArguments(String[] args)
           
 void setConfig(File config)
           
 void setConfigurationProvider(Iterable<URL> configProvider)
           
 void setData(File data)
           
static void setDefault(Environment env)
           
 void setHostApplicationName(String name)
           
 void setHostApplicationVersion(String version)
           
 void setIsApplicationServer(boolean isAppServer)
           
 void setLog(File log)
           
 void setProperty(String key, String value)
           
 void setRuntimeHome(File runtimeHome)
           
 void setServerHome(File serverHome)
           
 void setTemp(File temp)
           
 void setWeb(File web)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

JBOSS_HOST

public static final String JBOSS_HOST
Constants that identifies possible hosts for the framework.

See Also:
Constant Field Values

NXSERVER_HOST

public static final String NXSERVER_HOST
See Also:
Constant Field Values

TOMCAT_HOST

public static final String TOMCAT_HOST
See Also:
Constant Field Values

NUXEO_HOME_DIR

public static final String NUXEO_HOME_DIR
See Also:
Constant Field Values

NUXEO_RUNTIME_HOME

public static final String NUXEO_RUNTIME_HOME
Since:
5.4.2
See Also:
Constant Field Values

NUXEO_DATA_DIR

public static final String NUXEO_DATA_DIR
See Also:
Constant Field Values

NUXEO_LOG_DIR

public static final String NUXEO_LOG_DIR
See Also:
Constant Field Values

NUXEO_TMP_DIR

public static final String NUXEO_TMP_DIR
See Also:
Constant Field Values

NUXEO_CONFIG_DIR

public static final String NUXEO_CONFIG_DIR
See Also:
Constant Field Values

NUXEO_WEB_DIR

public static final String NUXEO_WEB_DIR
See Also:
Constant Field Values

HOME_DIR

@Deprecated
public static final String HOME_DIR
Deprecated. never defined; use NUXEO_HOME_DIR
The home directory.

See Also:
Constant Field Values

WEB_DIR

@Deprecated
public static final String WEB_DIR
Deprecated. never defined; use NUXEO_WEB_DIR
The web root.

See Also:
Constant Field Values

CONFIG_DIR

@Deprecated
public static final String CONFIG_DIR
Deprecated. never defined; use NUXEO_CONFIG_DIR
The config directory.

See Also:
Constant Field Values

DATA_DIR

@Deprecated
public static final String DATA_DIR
Deprecated. never defined; use NUXEO_DATA_DIR
The data directory.

See Also:
Constant Field Values

LOG_DIR

@Deprecated
public static final String LOG_DIR
Deprecated. never defined; use NUXEO_LOG_DIR
The log directory.

See Also:
Constant Field Values

BUNDLES_DIR

public static final String BUNDLES_DIR
The application layout (optional): directory containing nuxeo runtime osgi bundles.

See Also:
Constant Field Values

BUNDLES

public static final String BUNDLES
See Also:
Constant Field Values
Constructor Detail

Environment

public Environment(File home)

Environment

public Environment(File home,
                   Properties properties)
Method Detail

setDefault

public static void setDefault(Environment env)

getDefault

public static Environment getDefault()

getHome

public File getHome()

isApplicationServer

public boolean isApplicationServer()

setIsApplicationServer

public void setIsApplicationServer(boolean isAppServer)

getHostApplicationName

public String getHostApplicationName()

getHostApplicationVersion

public String getHostApplicationVersion()

setHostApplicationName

public void setHostApplicationName(String name)

setHostApplicationVersion

public void setHostApplicationVersion(String version)

getTemp

public File getTemp()

setTemp

public void setTemp(File temp)

getConfig

public File getConfig()

setConfig

public void setConfig(File config)

getLog

public File getLog()

setLog

public void setLog(File log)

getData

public File getData()

setData

public void setData(File data)

getWeb

public File getWeb()

setWeb

public void setWeb(File web)

getRuntimeHome

public File getRuntimeHome()
Since:
5.4.2

setRuntimeHome

public void setRuntimeHome(File runtimeHome)
Since:
5.4.2

getCommandLineArguments

public String[] getCommandLineArguments()

setCommandLineArguments

public void setCommandLineArguments(String[] args)

getProperty

public String getProperty(String key)

getProperty

public String getProperty(String key,
                          String defaultValue)

setProperty

public void setProperty(String key,
                        String value)

getProperties

public Properties getProperties()

loadProperties

public void loadProperties(Properties props)

isJBoss

public boolean isJBoss()

isJetty

public boolean isJetty()

isTomcat

public boolean isTomcat()

init

public void init()
Initialization with System properties to avoid issues due to home set with runtime home instead of server home.

Since:
5.4.1

getServerHome

public File getServerHome()
This method always returns the server home (or null if NUXEO_HOME_DIR is not set), whereas getHome() may return runtime home.

Returns:
Server home
Since:
5.4.2

setServerHome

public void setServerHome(File serverHome)
Since:
5.4.2

setConfigurationProvider

public void setConfigurationProvider(Iterable<URL> configProvider)

getConfigurationProvider

public Iterable<URL> getConfigurationProvider()

toString

public String toString()
Overrides:
toString in class Object

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.