Hi!
Phan Anh Tran wrote:
> I have a BusinessSession with a number of methods. I want to delay the
> execution of a couple of methods. Ie. say I do not want the client to execute
> methods A,B,C more than once every 5 minutes. That is, execute A, wait 5
> minutes, execute B, wait 5 minutes, execute C.
>
> My initial thought is for each invocation of A, B, and C, I would just queue the
> requests, and I would keep a timer thread that wakes up every 5 minutes to check
> the queue for requests, dequeue the request, if any, and carry it out.
>
> Does this violate any SessionBean specs? I am not quite sure that by keeping a
> separate thread, I would violate the single thread restriction (?) of an EJB.
Use JMX. There is already a standard MBean for this type of things:
javax.management.timer.Timer. Register one in the server by adding it to
jboss.conf, and make your own MBean which adds jobs to it at your
discretion. Not very difficult to do, and follows standards (JMX in this
case).
/Rickard
--
Rickard �berg
@home: +46 13 177937
Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]