mcconnell    2004/04/01 17:06:49

  Modified:    
merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl
                        CommissionRequest.java
  Log:
  Fix the 0 deployment timeout bug.
  
  Revision  Changes    Path
  1.3       +18 -3     
avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/CommissionRequest.java
  
  Index: CommissionRequest.java
  ===================================================================
  RCS file: 
/home/cvs/avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/CommissionRequest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CommissionRequest.java    17 Mar 2004 10:39:10 -0000      1.2
  +++ CommissionRequest.java    2 Apr 2004 01:06:49 -0000       1.3
  @@ -85,7 +85,7 @@
           synchronized( this )
           {
               long timeout = getDeploymentModel().getDeploymentTimeout();
  -            wait( timeout ); // wait for commission/decommission
  +            waitForCompletion( timeout );
               processException();
               if( m_completed )
               {
  @@ -93,7 +93,7 @@
                   return t2-t1;
               }
               m_thread.interrupt();
  -            wait( timeout ); // wait for shutdown
  +            waitForCompletion( timeout ); // wait for shutdown
               processException();
               if( m_interrupted || m_completed )
               {
  @@ -114,6 +114,21 @@
                     + timeout
                     + "] and failed to respond to an interrupt.";
                   throw new FatalCommissioningException( error );
  +            }
  +        }
  +    }
  +
  +    private void waitForCompletion( long timeout ) throws 
InterruptedException
  +    {
  +        if( timeout > 0 )
  +        {
  +            wait( timeout );
  +        }
  +        else
  +        {
  +            while( !m_completed )
  +            {
  +                wait( 1000 );
               }
           }
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to