avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: avalon-sandbox/merlin/activation/src/java/org/apache/avalon/activation/appliance/impl DefaultAppliance.java
Date Mon, 08 Sep 2003 10:38:00 GMT
mcconnell    2003/09/08 03:38:00

  Modified:    merlin/activation/src/java/org/apache/avalon/activation/appliance/impl
                        DefaultAppliance.java
  Log:
  Check for non-deployed state (can occur if a recursive dependency is not identified).
  
  Revision  Changes    Path
  1.15      +10 -3     avalon-sandbox/merlin/activation/src/java/org/apache/avalon/activation/appliance/impl/DefaultAppliance.java
  
  Index: DefaultAppliance.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/activation/src/java/org/apache/avalon/activation/appliance/impl/DefaultAppliance.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- DefaultAppliance.java	8 Sep 2003 06:12:21 -0000	1.14
  +++ DefaultAppliance.java	8 Sep 2003 10:38:00 -0000	1.15
  @@ -486,6 +486,7 @@
               //
   
               m_lifestyle = createLifestyleHandler( lifestyle );
  +            m_deployment.setEnabled( true );
   
               //
               // if the deployment policy is on startup then trigger 
  @@ -501,7 +502,6 @@
                       getLogger().debug( "activated instance: " + id );
                   }
               }
  -            m_deployment.setEnabled( true );
           }
       }
   
  @@ -560,7 +560,14 @@
       public Object resolve( final Object source, final Class[] ref ) throws Exception
       {
           if( source == null ) throw new NullPointerException( "source" );
  -        if( m_lifestyle == null ) throw new IllegalStateException( "lifestyle" );
  +        if( !m_deployment.isEnabled() )
  +        {
  +            final String error = 
  +              "Illegal attempt to resolve an service from a non-deployed appliance ["
  +              + this + "]. A probably cause is a recursive dependency declaration.";
  +            getLogger().error( error );
  +            throw new IllegalStateException( error );
  +        }
   
           Class[] refs = ref;
           if( refs == null ) refs = new Class[0];
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message