reintroduced createInstance() template method in deprecated form (SPR-7428)
This commit is contained in:
parent
9ef47b82a5
commit
b054ca4a48
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2008 the original author or authors.
|
* Copyright 2002-2010 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -66,7 +66,7 @@ public class PropertiesFactoryBean extends PropertiesLoaderSupport
|
||||||
|
|
||||||
public final void afterPropertiesSet() throws IOException {
|
public final void afterPropertiesSet() throws IOException {
|
||||||
if (this.singleton) {
|
if (this.singleton) {
|
||||||
this.singletonInstance = mergeProperties();
|
this.singletonInstance = createProperties();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -75,7 +75,7 @@ public class PropertiesFactoryBean extends PropertiesLoaderSupport
|
||||||
return this.singletonInstance;
|
return this.singletonInstance;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return mergeProperties();
|
return createProperties();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -83,4 +83,34 @@ public class PropertiesFactoryBean extends PropertiesLoaderSupport
|
||||||
return Properties.class;
|
return Properties.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Template method that subclasses may override to construct the object
|
||||||
|
* returned by this factory. The default implementation returns the
|
||||||
|
* plain merged Properties instance.
|
||||||
|
* <p>Invoked on initialization of this FactoryBean in case of a
|
||||||
|
* shared singleton; else, on each {@link #getObject()} call.
|
||||||
|
* @return the object returned by this factory
|
||||||
|
* @throws IOException if an exception occured during properties loading
|
||||||
|
* @see #mergeProperties()
|
||||||
|
*/
|
||||||
|
protected Properties createProperties() throws IOException {
|
||||||
|
return (Properties) createInstance();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Template method that subclasses may override to construct the object
|
||||||
|
* returned by this factory. The default implementation returns the
|
||||||
|
* plain merged Properties instance.
|
||||||
|
* <p>Invoked on initialization of this FactoryBean in case of a
|
||||||
|
* shared singleton; else, on each {@link #getObject()} call.
|
||||||
|
* @return the object returned by this factory
|
||||||
|
* @throws IOException if an exception occured during properties loading
|
||||||
|
* @deprecated as of Spring 3.0, in favor of {@link #createProperties()}
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
protected Object createInstance() throws IOException {
|
||||||
|
return mergeProperties();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue