3 Replies Latest reply on Sep 13, 2004 2:36 PM by Dimitris Andreadis

    Scheduling Tasks

    Ary Junior Newbie

      Hi, they see below the definition of my MBean that implements the interface org.jboss.varia.scheduler.Schedulable on file jboss-service.xml:


      true
      br.com.valoriza.alertas.mbean.AlertasStockScreener
      NOW
      60000
      -1


      Through the "JMX MBean View" I can modify the properties defined in the XML, such as "SchedulePeriod" or "StartAtStartup". My problem is that these modifications do not persist when the JBoss is restarted. Is it impossible? Another question: How I could define other properties beyond these?

      []s

      Ary Junior

        • 1. Re: Scheduling Tasks
          Elias Ross Master


          Unfortuantely JBoss/JMX does not have a good way to persist attribute changes to disk or database. I think with XMBeans you can create interceptors, but I haven't gotten this to work very well. I think there are two good solutions:

          1) Modify the -service.xml file directly.
          2) Create your own MBean which, through setAttribute/getAttribute saves/loads values from a database.

          • 2. Re: Scheduling Tasks
            Raja Master

            XMBean should be a good option to do this combined with a custom persistence manager. you can define ur custom persistence manager to extend from org.jboss.mx.persistence.PersistenceManager and override the load and store methods to retrieve/store values from DB or flat file.

            My MBean is XDoclet-ed to use this persistencemanager like
            * @jmx.mbean name="net.collab:type=Configuration"
            * description="Configuration Bean - XMBean"
            * persistPolicy="OnUpdate"
            * persistLocation="/tmp"
            * persistName="config.mbean"
            * persistence-manager="net.collab.xmbean.persistence.PropertyStyledPersistenceManager"
            *

            • 3. Re: Scheduling Tasks
              Dimitris Andreadis Master

              There is a new persistence framework + XML based persistence backend for XMBeans,

              see:

              http://www.jboss.org/wiki/Wiki.jsp?page=XMBeanAttributePersistenceService

              Regards
              /Dimitris