org.springframework.yarn.configuration
Class EnvironmentFactoryBean

java.lang.Object
  extended by org.springframework.yarn.configuration.EnvironmentFactoryBean
All Implemented Interfaces:
FactoryBean<Map<String,String>>, InitializingBean

public class EnvironmentFactoryBean
extends Object
implements InitializingBean, FactoryBean<Map<String,String>>

FactoryBean for creating a Map of environment variables.

Author:
Janne Valkealahti

Constructor Summary
EnvironmentFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  Map<String,String> createEnvironment()
          Creates the Map to be returned from this factory bean.
 Map<String,String> getObject()
           
 Class<?> getObjectType()
           
 boolean isSingleton()
           
 void setClasspath(String classpath)
          Sets incoming classpath.
 void setDefaultYarnAppClasspath(String defaultYarnAppClasspath)
          Sets the default yarn app classpath.
 void setDelimiter(String delimiter)
          Sets the delimiter used in a classpath.
 void setIncludeBaseDirectory(boolean includeBaseDirectory)
          If set to true a base directory entry will be added to a 'CLASSPATH' environment variable.
 void setIncludeSystemEnv(boolean includeSystemEnv)
          If set to true properties from a System.getenv() will be included to environment settings.
 void setProperties(Properties properties)
          Sets the configuration properties.
 void setUseDefaultYarnClasspath(boolean useDefaultYarnClasspath)
          If set to true a default 'yarn' entries will be added to a 'CLASSPATH' environment variable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnvironmentFactoryBean

public EnvironmentFactoryBean()
Method Detail

getObject

public Map<String,String> getObject()
                             throws Exception
Specified by:
getObject in interface FactoryBean<Map<String,String>>
Throws:
Exception

getObjectType

public Class<?> getObjectType()
Specified by:
getObjectType in interface FactoryBean<Map<String,String>>

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface FactoryBean<Map<String,String>>

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

setIncludeSystemEnv

public void setIncludeSystemEnv(boolean includeSystemEnv)
If set to true properties from a System.getenv() will be included to environment settings. Default value is true.

Parameters:
includeSystemEnv - flag to set

createEnvironment

protected Map<String,String> createEnvironment()
Creates the Map to be returned from this factory bean.

Returns:
map of environment variables

setProperties

public void setProperties(Properties properties)
Sets the configuration properties.

Parameters:
properties - The properties to set.

setClasspath

public void setClasspath(String classpath)
Sets incoming classpath.

Parameters:
classpath - the incoming classpath to set

setDefaultYarnAppClasspath

public void setDefaultYarnAppClasspath(String defaultYarnAppClasspath)
Sets the default yarn app classpath.

Parameters:
defaultYarnAppClasspath - the new default yarn app classpath

setUseDefaultYarnClasspath

public void setUseDefaultYarnClasspath(boolean useDefaultYarnClasspath)
If set to true a default 'yarn' entries will be added to a 'CLASSPATH' environment variable.

Parameters:
useDefaultYarnClasspath - Flag telling if default yarn entries should be added to classpath

setIncludeBaseDirectory

public void setIncludeBaseDirectory(boolean includeBaseDirectory)
If set to true a base directory entry will be added to a 'CLASSPATH' environment variable.

Parameters:
includeBaseDirectory - Flag telling if base directory entry should be added to classpath

setDelimiter

public void setDelimiter(String delimiter)
Sets the delimiter used in a classpath.

Parameters:
delimiter - delimiter to use in classpath