Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JBoss User Help »

[jboss-user] [JBoss Seam] - problem with messages in scheduler.

scott.stark@jboss.org

2007-05-07


hi,
I got in messages properties some text like:


| myText = xxx yyy zzz
|

and my messages

| @In
| protected Map<String, String> messages;
|

in normal case it works when i do somethink like:
String someString = messages.ge("myText");

someString get "xxx yyy zzz",
but i got method scheduled each minute and when i use messages in method i still get not "xxx yyy zzz", but "myText", why?
If I run my medthod like <s:link action="sfsb.method", messages work!!!!

here is my controler:

| @Name("engineControler")
| public class EngineControler extends GameSystem {
|  public EngineControler() {}
|  
|  @In(create=true)
|   EngineProcessor processor;
|
|   public String calcUserPoints() {
|      try {
|        long interval = 1 * 500;
|       @SuppressWarnings("unused")
|      Timer timer = processor.scheduleUserPoints(new Date(), interval, null);      
|      
|      }
|      catch (RuntimeException e) {
|        log.error("Scheduler ->engineControler - calcUserPoints(): " + e.getMessage());
|      }
|      return "success";
|   }
|

and processor

| @Name("processor")
| public class EngineProcessor extends GameSystem {
|  public EngineProcessor() {}
|    
|   @SuppressWarnings("unchecked")
|  @Asynchronous
|   @Transactional
|   public Timer scheduleUserPoints(@(protected),
|                         @IntervalDuration long interval,
|                         Person p) {
|    try {
|      long a = System.currentTimeMillis();
|      //=================================================
| String someString = messages.ge("myText");          
|      //=================================================      
|      long b = System.currentTimeMillis();
|      System.out.println("TIME: " + (b - a) + " ms.");      
|      }
|      catch (RuntimeException e) {
|        log.error("processor -> scheduleUserPoints(): " +
|              e.getMessage());
|      }
|      return null;
|   }
|

can anyone explain why my messages instance can't work in scheduler?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043582#4043582

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043582
_______________________________________________
jboss-user mailing list
jboss-user@(protected)
https://lists.jboss.org/mailman/listinfo/jboss-user
©2008 junlu.com - Jax Systems, LLC, U.S.A.