3 Replies Latest reply on Dec 20, 2005 6:34 PM by Mirko Nasato

    Setting URLDeploymentScanner.ScanEnabled at runtime

    Mirko Nasato Newbie

      Disabling ScanEnabled in the URLDeploymentScanner MBean at runtime has no effects.

      It would be useful to disable scanning via JMX console when doing some changes on the filesystem we don't want immediately hot-deployed, and for custom deployment scripts driven by twiddle.

      This wiki page suggests that is should work
      http://wiki.jboss.org/wiki/Wiki.jsp?page=ManageTheDeploymentScannerWithTheJMXConsole

      but this comment in the source code clearly states otherwise, in org.jboss.deployment.scanner.AbstractDeploymentScanner before inner class ScannerThread

       /**
       * Should use Timer/TimerTask instead? This has some issues with
       * interaction with ScanEnabled attribute. ScanEnabled works only
       * when starting/stopping.
       */
      


      I've tried changing the setter method to

       public void setScanEnabled(final boolean flag)
       {
       if (flag != scanEnabled)
       {
       scanEnabled = flag;
       if (scannerThread != null)
       scannerThread.setEnabled(scanEnabled);
       }
       }
      


      and now it seems to work fine, disabling/enabling scanning is applied at runtime. But maybe I'm missing something; what are these issues the comment is referring to? Otherwise I'll open a feature request in Jira.