org.springframework.batch.support
Class SystemPropertyInitializer

java.lang.Object
  extended by org.springframework.batch.support.SystemPropertyInitializer
All Implemented Interfaces:
InitializingBean

public class SystemPropertyInitializer
extends Object
implements InitializingBean

Helper class that sets up a System property with a default value. A System property is created with the specified key name, and default value (i.e. if the property already exists it is not changed).

Author:
Dave Syer

Field Summary
static String ENVIRONMENT
          Name of system property used by default.
 
Constructor Summary
SystemPropertyInitializer()
           
 
Method Summary
 void afterPropertiesSet()
          Sets the System property with the provided name and default value.
 void setDefaultValue(String defaultValue)
          Mandatory property specifying the default value of the System property.
 void setKeyName(String keyName)
          Set the key name for the System property that is created.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENVIRONMENT

public static final String ENVIRONMENT
Name of system property used by default.

See Also:
Constant Field Values
Constructor Detail

SystemPropertyInitializer

public SystemPropertyInitializer()
Method Detail

setKeyName

public void setKeyName(String keyName)
Set the key name for the System property that is created. Defaults to ENVIRONMENT.

Parameters:
keyName - the key name to set

setDefaultValue

public void setDefaultValue(String defaultValue)
Mandatory property specifying the default value of the System property.

Parameters:
defaultValue - the default value to set

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Sets the System property with the provided name and default value.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception
See Also:
InitializingBean.afterPropertiesSet()


Copyright © 2009 SpringSource. All Rights Reserved.