mcconnell    2004/03/07 14:10:39

  Modified:    merlin/composition/api/src/java/org/apache/avalon/composition/model
                        AssemblyException.java
               
merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl
                        DefaultContainmentModelAssemblyHelper.java
                        DefaultSecurityModel.java DefaultSystemContext.java
                        DefaultSystemContextFactory.java
  Added:       merlin/composition/api/src/java/org/apache/avalon/composition/model
                        ProviderNotFoundException.java
  Log:
  Add a ServiceNotFoundException to the model api.
  
  Revision  Changes    Path
  1.5       +2 -2      
avalon/merlin/composition/api/src/java/org/apache/avalon/composition/model/AssemblyException.java
  
  Index: AssemblyException.java
  ===================================================================
  RCS file: 
/home/cvs/avalon/merlin/composition/api/src/java/org/apache/avalon/composition/model/AssemblyException.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AssemblyException.java    24 Feb 2004 22:18:21 -0000      1.4
  +++ AssemblyException.java    7 Mar 2004 22:10:39 -0000       1.5
  @@ -23,7 +23,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]">Avalon Development Team</a>
    * @version $Revision$ $Date$
    */
  -public final class AssemblyException
  +public class AssemblyException
           extends ModelException
   {
   
  
  
  
  1.1                  
avalon/merlin/composition/api/src/java/org/apache/avalon/composition/model/ProviderNotFoundException.java
  
  Index: ProviderNotFoundException.java
  ===================================================================
  /* 
   * Copyright 2004 Apache Software Foundation
   * Licensed  under the  Apache License,  Version 2.0  (the "License");
   * you may not use  this file  except in  compliance with the License.
   * You may obtain a copy of the License at 
   * 
   *   http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed  under the  License is distributed on an "AS IS" BASIS,
   * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
   * implied.
   * 
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.apache.avalon.composition.model;
  
  /**
   * Exception raised in response to a model provider resolution failure.
   *
   * @author <a href="mailto:[EMAIL PROTECTED]">Avalon Development Team</a>
   * @version $Revision: 1.1 $ $Date: 2004/03/07 22:10:39 $
   */
  public final class ProviderNotFoundException
          extends AssemblyException
  {
  
      /**
       * Construct a new <code>ProviderNotFoundException</code> instance.
       *
       * @param message The detail message for this exception.
       */
      public ProviderNotFoundException( final String message )
      {
          this( message, null );
      }
  
      /**
       * Construct a new <code>ProviderNotFoundException</code> instance.
       *
       * @param message The detail message for this exception.
       * @param throwable the root cause of the exception
       */
      public ProviderNotFoundException( final String message, final Throwable 
throwable )
      {
          super( message, throwable );
      }
  }
  
  
  
  
  1.5       +9 -8      
avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultContainmentModelAssemblyHelper.java
  
  Index: DefaultContainmentModelAssemblyHelper.java
  ===================================================================
  RCS file: 
/home/cvs/avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultContainmentModelAssemblyHelper.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DefaultContainmentModelAssemblyHelper.java        21 Feb 2004 23:54:42 -0000     
 1.4
  +++ DefaultContainmentModelAssemblyHelper.java        7 Mar 2004 22:10:39 -0000      
 1.5
  @@ -25,6 +25,7 @@
   import org.apache.avalon.composition.model.ComponentModel;
   import org.apache.avalon.composition.model.DeploymentModel;
   import org.apache.avalon.composition.model.AssemblyException;
  +import org.apache.avalon.composition.model.ProviderNotFoundException;
   import org.apache.avalon.composition.model.ModelRepository;
   import org.apache.avalon.composition.model.ContextModel;
   import org.apache.avalon.composition.model.DependencyModel;
  @@ -296,7 +297,7 @@
               {
                   final String error = 
                     "Nested assembly failure while attempting to construct model"
  -                  + " for the profile: [" + profile + "] for the dependency: ["
  +                  + " for the profile: " + profile + " for the dependency: ["
                     + dependency + "].";
                   throw new AssemblyException( error, ae );
               }
  @@ -304,7 +305,7 @@
               {
                   final String error = 
                     "Nested model failure while attempting to add model"
  -                  + " for the profile: [" + profile + "] for the dependency: ["
  +                  + " for the profile: " + profile + " for the dependency: ["
                     + dependency + "].";
                   throw new AssemblyException( error, me );
               }
  @@ -369,7 +370,7 @@
               {
                   final String error = 
                     "Nested model failure while attempting to add model"
  -                  + " for the profile: [" + profile + "] for the reference: ["
  +                  + " for the profile: " + profile + " for the reference: ["
                     + reference + "].";
                   throw new AssemblyException( error, me );
               }
  @@ -379,7 +380,7 @@
               final String error = 
                 "Unable to locate a service provider for the reference: [ "
                 + reference + "].";
  -            throw new AssemblyException( error );
  +            throw new ProviderNotFoundException( error );
           }
       }
   
  @@ -452,8 +453,8 @@
               {
                   final String error = 
                     "Nested model failure while attempting to add model"
  -                  + " for the extension profile: [" + profile 
  -                  + "] for the stage dependency: ["
  +                  + " for the extension profile: " + profile 
  +                  + " for the stage dependency: ["
                     + stage + "].";
                   throw new AssemblyException( error, me );
               }
  @@ -463,7 +464,7 @@
               final String error = 
                 "Unable to locate a extension provider for the stage: [ "
                 + stage + "].";
  -            throw new AssemblyException( error );
  +            throw new ProviderNotFoundException( error );
           }
       }
   
  
  
  
  1.7       +8 -5      
avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultSecurityModel.java
  
  Index: DefaultSecurityModel.java
  ===================================================================
  RCS file: 
/home/cvs/avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultSecurityModel.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DefaultSecurityModel.java 7 Mar 2004 03:02:42 -0000       1.6
  +++ DefaultSecurityModel.java 7 Mar 2004 22:10:39 -0000       1.7
  @@ -133,7 +133,8 @@
           return permissions;
       }
   
  -    private Permission createPermission( PermissionDescriptor descriptor ) throws 
Exception
  +    private Permission createPermission( 
  +      PermissionDescriptor descriptor ) throws Exception
       {
           String classname = descriptor.getClassname();
           String name = descriptor.getName();
  @@ -177,8 +178,9 @@
        * @throws InvocationTargetException, if the constructor in the Permission
        *         class throws an exception.
        */
  -    private static Permission createPermission( String classname, String name, 
String action )
  -        throws InstantiationException, IllegalAccessException, 
ClassNotFoundException,
  +    private static Permission createPermission( 
  +      String classname, String name, String action )
  +      throws InstantiationException, IllegalAccessException, ClassNotFoundException,
             ClassCastException, InvocationTargetException
       {
           if( classname == null )
  @@ -208,7 +210,8 @@
           }
       }
   
  -    private static Constructor getConstructor( Constructor[] constructors, int 
noOfParameters )
  +    private static Constructor getConstructor( 
  +      Constructor[] constructors, int noOfParameters )
       {
           for ( int i=0 ; i < constructors.length ; i++ )
           {
  
  
  
  1.27      +2 -2      
avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultSystemContext.java
  
  Index: DefaultSystemContext.java
  ===================================================================
  RCS file: 
/home/cvs/avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultSystemContext.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- DefaultSystemContext.java 7 Mar 2004 00:00:58 -0000       1.26
  +++ DefaultSystemContext.java 7 Mar 2004 22:10:39 -0000       1.27
  @@ -494,7 +494,7 @@
           }
   
           //
  -        // log target factories only have one constructor
  +        // runtime class may has one constructor
           //
   
           Constructor constructor = constructors[0];
  
  
  
  1.6       +21 -1     
avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultSystemContextFactory.java
  
  Index: DefaultSystemContextFactory.java
  ===================================================================
  RCS file: 
/home/cvs/avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultSystemContextFactory.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DefaultSystemContextFactory.java  7 Mar 2004 00:00:59 -0000       1.5
  +++ DefaultSystemContextFactory.java  7 Mar 2004 22:10:39 -0000       1.6
  @@ -133,16 +133,36 @@
       // SystemContextFactory
       //--------------------------------------------------------------
   
  +   /**
  +    * Set the security enabled status.  If TRUE component level 
  +    * security policies will be enabled.  If FALSE security will 
  +    * disabled.  The default value is FALSE.
  +    *
  +    * @param secure the security enabled status
  +    */
       public void setSecurityEnabled( boolean secure )
       {
           m_secure = secure;
       }
   
  +   /**
  +    * Set the parent context of the system context.  If undefined
  +    * the system context will be created using a null parent.
  +    *
  +    * @param parent the parent context
  +    */
       public void setParentContext( Context parent )
       {
           m_parent = parent;
       }
   
  +   /**
  +    * Set the runtime artifact.  The runtime artifact is a reference
  +    * to a runtime system capable of supporting component lifestyle 
  +    * and lifecycle management. 
  +    * 
  +    * @param artifact an artifact referencing the runtime
  +    */
       public void setRuntime( Artifact artifact )
       {
           m_artifact = artifact;
  
  
  

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

Reply via email to