Announcement Announcement Module
Collapse
No announcement yet.
TimerManagerTaskScheduler use in JBoss 5 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • TimerManagerTaskScheduler use in JBoss 5

    I am trying to decide on whether or not to use spring to handle the scheduling of my tasks. At first this seemed very easy as I was just going to use a ThreadPoolTaskScheduler to get the job done.

    However this is a WAR that I am deploying to a JBoss application server. I would like to use spring to schedule tasks within my WAR instead of EJB3 timers because I want to be able to be AS agnostic, i.e. maybe just deploy my WAR to tomcat.

    The problem is this:
    26.3.3 TaskScheduler implementations

    As with Spring's TaskExecutor abstraction, the primary benefit of the TaskScheduler is that code relying on scheduling behavior need not be coupled to a particular scheduler implementation. The flexibility this provides is particularly relevant when running within Application Server environments where threads should not be created directly by the application itself. For such cases, Spring provides a TimerManagerTaskScheduler that delegates to a CommonJ TimerManager instance, typically configured with a JNDI-lookup.
    Meaning JBoss should be the one managing threads not spring. This makes it tough to be AS agnostic as I will need to hook into something that lives in JBoss.

    Does anyone have an example of how I can configure Jboss/Spring scheduler to be 'correct' in my case?

  • #2
    Hi!

    Unfortunately JBOSS has his own TimerManager implementation http://www.docjar.com/html/api/org/j...ager.java.html and it isn't compatible with commonJ. And of course it can't achievable with TimerManagerTaskScheduler.

    There are some attempts to include into JBOSS commonJ: https://www.google.com/search?q=JBOS...20TimerManager
    However it is still without good news.

    Neverthess I can say on my own experience: don't worry about this issue! Just use an existing ability from default ThreadPoolTaskScheduler.
    I have several application in production with Spring Integration which work OK on JBOSS, WebSphere & WebLogic too.
    And until recently, I didn't know about JEE WorkManager & TimerManager ;-)

    By the way they just have the same properties as provided by Spring...

    You can take out similar properties of your Executors & Scheduler and let end-user to configure them before application start up via <contextroperty-placeholder>.

    Take care,
    Artem

    Comment

    Working...
    X