A bean annotated with @Service acts as a stateful bean with just one instance 
available. So in effect it's the same as a singleton in EJB 3.1. Any lookup or 
injection of the service bean will result in an association with that single 
instance.

With the use of @Management the service bean will also expose a JMX view of 
itself. Note that lifecycle mbean methods are currently invoked, but I would 
rather eliminate that function and have the option of exposing a JMX view for 
stateless beans as well.

In effect this means that the service (/singleton) bean has the same 
'prohibitions' as any other EJB. The limitations are put in place to make the 
bean portable and easily maintainable. You can create threads or access the 
file system in an EJB, but that means governing your own resources and giving 
up portability.

Resources available to any EJB (JPA entity managers, declarative transactions 
etc) are fully supported from a service bean.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4151181#4151181

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4151181
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to