I've been exploring JSF (ICEFaces, in fact) and EJB and have got to thinking about where one should store data that is application wide (but transient - i.e. if the application server or application is shut down, then loss of that data is expected).
In JSF, there is the concept of an application-scoped managed bean, but no direct analogue in EJB 3.0.
Is the use of a singleton class appropriate?
If I had a singleton class named AppData, say, with a static method getAppData returning the reference (creating it, if necessary), then I could grab a reference in my EJBs, with the AppData object being created on the first access.
In this example, would I be right in thinking that the object would continue to exist for as long as the application was deployed, and the application server was running?
More importantly, would this be a sensible thing to do?
[If anybody's interested, the reason I'm thinking about this is that I have an ICEFaces application-scoped managed bean which is capable of causing client browers to rerender. I want to be able to hold a reference to that bean so that EJBs can make calls to it in response to, say, receipt of a JMS message.]
I'd appreciate any thoughts on the subject!