I have an object that must be created using a factory method:
public class FrameFactory {
public static Frame createFrame() throws IOException, SerializationException {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
return (Frame)bxmlSerializer.readObject(FrameFactory.class, "/gui/MainFrame.bxml");
}
}
The Spring call to get the mean will be something like this:
<bean id="frame" class="Frame" factory-method="createFrame"/>
However, I want this object to be singleton.
My question is that does Spring has some ready-made method to make a singleton OR I have to implement the singleton pattern myself in the FrameFactory?
Thank you very much.