Java: How to do a Factory for Singletons within Spring