-
Enhancement
-
Resolution: Done
-
Major
-
None
currently there are 3 groups of NonFunctionalTimerService:
- when timer service is disabled;
- when a stateless, mdb, or singleton bean does not have timeout method;
- for stateful bean, which is not allowed to have timer service
the above 3 kinds of NonFunctionalTimerService only differ in their message. We should be able to make NonFunctionalTimerService instances immutable and shareable by all occasions to reduce memory consumption.
all instances of NonFunctionalTimerService are registered with TimerServiceRegistry, along with good TimerService, which slows down getting timers. For example, if an app contains a stateless bean with timers, 2 stateless bean without timers, and 3 stateful bean, the TimerServiceRegistry will contain 5 instances of NonFunctionalTimerService, and 1 instance of good TimerService. getAllTimers() operation will loop through all 6 instances in a synchronized block while 5 of them are not contributing to the result.