org.springframework.data.hadoop.configuration
Class ConfigurationFactoryBean

java.lang.Object
  extended by org.springframework.data.hadoop.configuration.ConfigurationFactoryBean
All Implemented Interfaces:
BeanClassLoaderAware, FactoryBean<Configuration>, InitializingBean

public class ConfigurationFactoryBean
extends Object
implements BeanClassLoaderAware, InitializingBean, FactoryBean<Configuration>

FactoryBean for creating Configuration instances.

Author:
Costin Leau

Constructor Summary
ConfigurationFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  Configuration createConfiguration(Configuration existing)
          Creates a configuration instance potentially using the existing one (passed as an argument - which can be null).
 Configuration getObject()
           
 Class<?> getObjectType()
           
 boolean isSingleton()
           
protected  void postProcessConfiguration(Configuration configuration)
           
 void setBeanClassLoader(ClassLoader classLoader)
           
 void setConfiguration(Configuration configuration)
          Sets the parent configuration.
 void setInitialize(boolean initialize)
          Indicates whether the configuration object should be initialized (true) or not.
 void setLoadDefaults(boolean loadDefaults)
          Indicates whether to load the defaults (the default) or not for this configuration.
 void setProperties(Properties properties)
          Sets the configuration properties.
 void setRegisterUrlHandler(boolean register)
          Indicates whether the configuration should register an URL handler (for allowing urls to understand HDFS prefixes, such as hdfs) or not.
 void setResources(Set<Resource> resources)
          Sets the configuration resources.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationFactoryBean

public ConfigurationFactoryBean()
Method Detail

afterPropertiesSet

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

createConfiguration

protected Configuration createConfiguration(Configuration existing)
Creates a configuration instance potentially using the existing one (passed as an argument - which can be null).

Parameters:
existing -
Returns:
configuration instance

postProcessConfiguration

protected void postProcessConfiguration(Configuration configuration)

getObject

public Configuration getObject()
Specified by:
getObject in interface FactoryBean<Configuration>

getObjectType

public Class<?> getObjectType()
Specified by:
getObjectType in interface FactoryBean<Configuration>

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface FactoryBean<Configuration>

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Specified by:
setBeanClassLoader in interface BeanClassLoaderAware

setConfiguration

public void setConfiguration(Configuration configuration)
Sets the parent configuration.

Parameters:
configuration - The configuration to set.

setLoadDefaults

public void setLoadDefaults(boolean loadDefaults)
Indicates whether to load the defaults (the default) or not for this configuration.

Parameters:
loadDefaults - The loadDefaults to set.

setResources

public void setResources(Set<Resource> resources)
Sets the configuration resources.

Parameters:
resources - The resources to set.

setProperties

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

Parameters:
properties - The properties to set.

setInitialize

public void setInitialize(boolean initialize)
Indicates whether the configuration object should be initialized (true) or not. This option should normally be set to true (the default) as it causes the jars, streams and resources set to be loaded - postponing the initializing might cause these to become unreadable.

Parameters:
initialize - whether to initialize or not.

setRegisterUrlHandler

public void setRegisterUrlHandler(boolean register)
Indicates whether the configuration should register an URL handler (for allowing urls to understand HDFS prefixes, such as hdfs) or not. As this operation impacts an entire VM and can be invoked at most once per JVM, by default it is false.

Parameters:
register - whether to register an URL handler or not