-
1. Re: Support for JBoss EJB 3.0 extensions in wildfly
jaysensharma May 6, 2015 2:38 AM (in response to arnab_ghosh)EE6 and EE7 specifications has a specific place for the org.jboss.ejb3.annotation.Management and org.jboss.ejb3.annotation.Service. Hence these jboss specific classes are not present in WildFly because the functionality provided by those classes are now standardized so you can try using @Singleton to achieve the same functionality.
@
javax.ejb.Singleton
@
javax.ejb.Startup;
-
2. Re: Support for JBoss EJB 3.0 extensions in wildfly
arnab_ghosh May 6, 2015 1:53 PM (in response to jaysensharma)Thanks for your reply. But will it be possible to have a JMX view this single ton EJB ?
My intention was to have one Singleton SessionBean to start and cancel the EJB timers and be able to do that at run time via JMX Console.
Please let me know if this is possible or if there is a alternative way to achieve this.
-
3. Re: Support for JBoss EJB 3.0 extensions in wildfly
jaysensharma May 7, 2015 12:25 AM (in response to arnab_ghosh)The following link gives more detailed example of the same: http://codrspace.com/codertrader/making-an-mbean-ejb3-and-wildfly-compliant/
Example:
private ObjectName objectName = null; @PostConstruct public void registerInJMX() { logger.info( "Registering in JMX Console" ); try { objectName = new ObjectName( "company:service=TimeoutServiceMBean" ); MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer(); mBeanServer.registerMBean( this, objectName ); } catch ( Exception e ) { throw new IllegalStateException( "Problem during registration into JMX:" + e ); } }
Also as you mentioned that you want to be able to do that at run time via JMX Console. Byt default the JMX Console is not shipped with WildFly or JBossAS7 (jmxconsole usually is available with older version of JBoss). If you meant to say JConsole or some other jmx based client utility like JVisualVM then yes, the above link may be very useful.