1 Reply Latest reply on Aug 24, 2009 11:27 AM by Renen W

    Accessing serialized timer objects

    Renen W Newbie

      Hello,

      I hope that this is the right forum and apologise if it isn't.

      I would like to be able to produce a friendly list of timers. In other words, the list should reflect something along the following lines:

      * 15 Dec 2009, 3:52PM: Launch space rocket 12 (za.co.acme.messages.TestMessage@31491f7b)
      * 23 Dec 2009, 11:00AM: Sell Mr Smiths shares and reap vast profits (za.co.acme.messages.TestMessage@e2df60d)

      Displaying the time is trivial.

      However, I am not clear how I can interrogate the objects that have been serialised into the database - the objects returned by getTimers() are reluctant to be de-serialized and horrible errors are thrown when you try (I suspect because they probably aren't read from the database until the events actually fire).

      In our scenario, everything we are serializing into the timer system implements a consistent interface: "Description" which allows us to retrieve the details we require.

      Is there a way to retrieve the objects so that I can interrogate them? Or to store additional information with the timer? Obviously, I would prefer not to maintain an additional data store.

      I currently retrieve the timers using getTimers(), and I then iterate over the collection calling getInfo() on each Timer.

      I am running JBoss 5.1.0.GA.

      Thank you in advance for your guidance.

      Renen.