2 Replies Latest reply on Dec 28, 2010 5:58 AM by piotrekde

    Alternative to Stateful bean with Timer

    piotrekde Newbie



      I am developing application in which beans communicates with network routers (using snmp protocol). Every 5 seconds routers has to be queried to return some information. So I developed stateful bean that holds all properties required to communicate with router, and also exposes business method sendRequest(...).  The problem is: how to call this method every 5 seconds? The perfect solution would be to use stateful session bean with timer service - unfortunately it is forbidden by EJB specification. I don't want to make this developed bean stateless, because it holds some important information about current connection (router IP, port, community name, protocol and so on), so passing all those information every 5 seconds would be inconvenient (that's first), and also harm the scalability (that's second - more important). I need to have multiple instances of this bean, because many routers are queried the same time. Do I have any alternative?


      Thank you in advance!