-
1. Re: Is there a bean implementation that is like a "Stateful Singleton Bean"?
wdfink Jun 27, 2012 4:02 PM (in response to madchedar0)Why you think a Singleton is stateless?
A singleton is a singleton, you might have a state and concurency can be managed by the container or by bean, you can annotate the whole bean or methods.
One other thing is whether you will have a Singleton in a cluster, if you want that have a look to this quickstart
-
2. Re: Is there a bean implementation that is like a "Stateful Singleton Bean"?
madchedar0 Jun 27, 2012 4:14 PM (in response to wdfink)Ah good point. In the definition I missed this part:
(From http://docs.oracle.com/javaee/6/tutorial/doc/gipjg.html#gipmt)
"Singleton session beans offer similar functionality to stateless session beans but differ from them in that there is only one singleton session bean per application, as opposed to a pool of stateless session beans, any of which may respond to a client request. Like stateless session beans, singleton session beans can implement web service endpoints.
Singleton session beans maintain their state between client invocations but are not required to maintain their state across server crashes or shutdowns."
So I guess I can use a @Singleton after all... Thanks for the quickstart link too - I'm sure that will come in handy.
-
3. Re: Is there a bean implementation that is like a "Stateful Singleton Bean"?
wdfink Jun 27, 2012 4:18 PM (in response to madchedar0)No problem your are welcome
-
4. Re: Is there a bean implementation that is like a "Stateful Singleton Bean"?
sgilda Jun 27, 2012 4:39 PM (in response to madchedar0)There is a simpler singleton quickstart example here: https://github.com/jbossas/quickstart/tree/master/helloworld-singleton
Wolf's deals with clustering, so you might want to start wit hthe simpler version and then move on to his. :-)