Well, may be this option is not quite right in srping terms but, this work for me, and at last i have got only one instance in my context.


Set static properties in a static factory method. 


i mean set in appContext.xml as follows


Code:
<bean id="properties"
  class="org.springframework.beans.factory.config.PropertiesFactoryBean">
  <property name="location"
   value="classpath:/a/property/file/Utils.properties" />
 </bean>

 <bean class="your.class.UtilMessages" factory-method="setInstance" autowire="autodetect" scope="singleton">
   <constructor-arg ref="properties" />
 </bean>
The interest thing is in factory method and the argument.


So the class looks like...


Code:
public class UtilMessages {

 public static Properties properties;
  
 // Cheating spring to set a static property.
 public static Properties setInstance(Properties propertiesArgs) {
  properties = propertiesArgs;
  return properties;
 }

 public static String getMsg(String key) {
  return properties.getProperty(key);
 }
}
I did call it "setInstance" because i'm setting the value, even when it's a cosntructor.


So you can set any static property in context instantantion and use them after as any static value.


For me was a property file, so i can read it by calling static UtilsMessages.getMsg("key") method. No need to set dependency in xml file and no need to create a new instance each time i need it.