2015-05-01 3 views
2

Я пытаюсь отменить таймер, но после этого у меня все еще есть его возврат через getTimers(). Это нормально или просто ошибка в каучо-смоле? Как правильно отменить программный таймер?java ejb TimerService: отменен таймер, возвращаемый getTimers (смола caucho)

@Singleton 
@LocalBean 
@Startup 
public class TimerTest 
{ 
    @Resource 
    TimerService ts; 
    static TimerTest inst; 

    @PostConstruct 
    void init() 
    { inst=this; 
    } 

    public synchronized static TimerTest getInstance() 
    { return(inst); 
    } 

    public Collection<Timer> getTimers() 
    { Collection <Timer> res=ts.getTimers(); 
     return(res); 
    } 

    public void cancelAll() 
    { for(Timer ot: ts.getTimers()) 
     { try 
      { System.out.println("Found old timer "+ot.getInfo()+", cancelling it."); 
       ot.cancel(); 
      } 
      catch(Exception e) {} 
     } 
    } 

А потом (с JSP):

TimerTest tt=TimerTest.getInstance(); 
Collection <Timer> timers=tt.getTimers(); 
out.println("<br>Got "+timers.size()+" timer(s)<br>"); 
for(Timer t: timers) 
{ 
    try 
    { 
     out.println("<br>Got timer: "+t.getInfo()); 
    } 
    catch(Exception e) 
    { 
     out.println("Error while cancelling timers "+e); 
    } 
} 

Ошибка при отменяя таймеров javax.ejb.NoSuchObjectLocalException: Этот таймер был отменен.

Спасибо!)

ответ

0

Got ответ здесь: http://bugs.caucho.com/view.php?id=5891

06-03-15 08:50 FERG Назначено => Ферг

06-03-15 08:50 Ферг Состояние новое => закрыт

06-03-15 08:50 FERG Разрешение разомкнут => фиксированной

06-03-15 08:50 FERG Исправлено в версии => 4.0.45

Смежные вопросы