User: vharcq  
  Date: 01/08/15 08:13:45

  Modified:    src/main/org/jboss/ejb AutoDeployer.java
                        AutoDeployerMBean.java
  Log:
  Parametrize the timeout that the deployer takes before coming again looking at the 
directory for new Xars to deploy.
  
  Revision  Changes    Path
  1.21      +19 -2     jboss/src/main/org/jboss/ejb/AutoDeployer.java
  
  Index: AutoDeployer.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/AutoDeployer.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- AutoDeployer.java 2001/08/03 17:15:43     1.20
  +++ AutoDeployer.java 2001/08/15 15:13:45     1.21
  @@ -47,7 +47,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Rickard Öberg</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Toby Allsopp</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Jason Dillon</a>
  - * @version $Revision: 1.20 $
  + * @version $Revision: 1.21 $
    */
   public class AutoDeployer
        extends ServiceMBeanSupport
  @@ -84,6 +84,9 @@
      // URL list
      String urlList = "";
   
  +   // TimeOut that in case of big ears to deploy should be set high enough
  +   int timeout = 3000;
  +
      /** Filters, one per configured deployer, to decide which files are
          deployable and which should be ignored */
      FilenameFilter[] deployableFilters = null;
  @@ -127,6 +130,16 @@
         return deployerList;
      }
   
  +   public void setTimeout(int to)
  +   {
  +      this.timeout = to;
  +   }
  +
  +   public int getTimeout()
  +   {
  +      return timeout;
  +   }
  +
      // Public --------------------------------------------------------
      public void run()
      {
  @@ -135,7 +148,11 @@
            // Sleep
            if (running)
            {
  -            try { Thread.sleep(3000); } catch (InterruptedException e) {}
  +            try
  +            {
  +               if (log.isDebugEnabled()) log.debug("Wait for "+timeout / 1000 +" 
seconds");
  +               Thread.sleep(timeout);
  +            } catch (InterruptedException e) {}
            }
   
            try
  
  
  
  1.8       +18 -1     jboss/src/main/org/jboss/ejb/AutoDeployerMBean.java
  
  Index: AutoDeployerMBean.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/AutoDeployerMBean.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AutoDeployerMBean.java    2001/08/03 17:15:43     1.7
  +++ AutoDeployerMBean.java    2001/08/15 15:13:45     1.8
  @@ -16,7 +16,7 @@
    * 
    * @author <a href="mailto:[EMAIL PROTECTED]";>Rickard Öberg</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Toby Allsopp</a>
  - * @version $Revision: 1.7 $
  + * @version $Revision: 1.8 $
    */
   public interface AutoDeployerMBean
      extends ServiceMBean
  @@ -51,5 +51,22 @@
       * @return   The list of deployers that is currently being used.
       */
      String getDeployers();
  +
  +   /**
  +    * Set the time in milli seconds the AutoDeployer have to sleep before
  +    * looking again for new files.
  +    *
  +    * @param to Timeout in miliseconds
  +    */
  +   void setTimeout(int to);
  +
  +   /**
  +    * Return the time in milli seconds the AutoDeployer have to sleep before
  +    * looking again for new files.
  +    *
  +    * @return The timeout in miliseconds
  +    */
  +   int getTimeout();
  +
   }
   
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to