7 Replies Latest reply on Jul 14, 2006 4:25 AM by doung-seok lee

    JBAS-2773 - LRUEnterpriseContextCachePolicy should be update

    Darran Lofthouse Master

      I am planning to look at the Jira issue JBAS-2773

      At the moment the class 'org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy' makes use of 'java.util.Timer' for the scheduling of TimerTasks. The classes 'EntitySynchronizationInterceptor' and 'LRUStatefulContextCachePolicy' both also schedule timer tasks using this timer. As a result if any of the tasks fail with a RuntimeException the timer is killed and no further timers will fire.

      I was planning to make use of 'org.jboss.util.TimerQueue' to replace the 'java.util.Timer' as this was implemented to be similar to 'java.util.Timer' but with an Exception safe run implementation so the failure of one task will not kill the timer.

      Alternatively it has been suggested that I should use 'org.jboss.util.timeout.TimeoutFactory' instead.

      I have had a look at where the two different implementations are used and it appears that the TimerQueue is not used anywhere in Branch_4_0 and the TimeoutFactory is used in a couple of places.

      I think I should change LRUEnterpriseContextCachePolicy to use the TimeoutFactory.

      As the TimerQueue is not used anywhere is there any reason to keep it? Or can it be removed to make it easier to decide which one to use?