-
1. JBoss @Service vs. EJB3.1 @Singleton
jaikiran Apr 15, 2011 1:15 AM (in response to david_b)Starting JBoss AS6, the JBoss specific @Service has been deprecated. It's recommended that you start using @Singleton.
The only additional advantage that the JBoss specific @Service beans provided was that you could register a MBean (by using @Management) for the @Service bean. That isn't supported for @Singleton.
-
2. JBoss @Service vs. EJB3.1 @Singleton
david_b Apr 15, 2011 1:24 AM (in response to jaikiran)Thanks, in that case I'll definitely be switching over.
The services are being registered as MBeans using @Management, but only to use start/create/stop/destroy. These can be replaced with @PostConstruct/@PreDestroy etc.
-
3. JBoss @Service vs. EJB3.1 @Singleton
jaikiran Apr 15, 2011 1:33 AM (in response to david_b)david_b wrote:
The services are being registered as MBeans using @Management, but only to use start/create/stop/destroy. These can be replaced with @PostConstruct/@PreDestroy etc.
That's correct. Also you can add a @Startup to the @Singleton to make it behave like @Service (i.e. create an instance on server/deployment start).