Benoit Xhenseval wrote:
> 

The Java Timer and TimerTask classes already handle all of this.

One solution is to start Timer/TimerTask threads from a permanently
loaded servlet.
These servlets can then act as EJB clients to perform periodic
activities.

This solution is portable to other application servers as well.
No need to depend on vendor specific scheduler MBean.



> Hi
> 
> I wonder if I could tap into the maillist knowledge...
> 
> I would like to schedule a task which is in fact a CLIENT to my EJBs, i.e. it will 
>need to call
> the EJB servers.
> 
> I can see several issues in using the MBean Scheduler, please tell me if I'm wrong...
> 
> 1/ the CODE for the scheduled task and the client ejb classes will need to be in the 
>JBoss/lib/ext
> 2/ SOMEHOW the task will have to login in order to acquire a PrincipalCallerId. 
>(How???, simple
> JAAS does not seem to work unlike a "normal" client)
> 3/ How to schedule MORE than one task? I've fiddled with the jboss.jcml to enter the 
>following as
> a SECOND scheduler:
> <mbean code="org.jboss.util.Scheduler" name=":service=Scheduler2">
> <constructor>
> <arg type="java.lang.String" value=":server=Scheduler2"/>
> <arg type="java.lang.String" 
>value="com.premier.cims.sbl.batch.MarkToMarketSchedule"/>
> <arg type="java.lang.String" value="MarkToMarket, 6789"/>
> <arg type="java.lang.String" value="java.lang.String,int"/>
> <arg type="long" value="30000"/>
> <arg type="long" value="10000"/>
> <arg type="long" value="-1"/>
> </constructor>
> </mbean>
> 
> it works but complains at startup about:
> [INFO,Scheduler,JBossMain] JBoss Scheduler Service 'scheduler::server=Scheduler2' 
>bound to
> scheduler::server=Scheduler2
> [ERROR,Default,JBossMain] javax.management.InstanceAlreadyExistsException:
> DefaultDomain:service=Timer
> 
> Is it the best way to schedule such a task? Or is cron "easier".
> 
> Any suggestions most welcome.
> 
> Thanks
> 
> Benoit.
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Shopping - Mother's Day is May 12th!
> http://shopping.yahoo.com
> 
> _______________________________________________________________
> 
> Have big pipes? SourceForge.net is looking for download mirrors. We supply
> the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user

-- 
Aaron Metzger

_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to