You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mc...@apache.org on 2003/07/16 00:36:32 UTC

cvs commit: avalon-sandbox/meta/tools/src/java/org/apache/avalon/meta/info/builder/tags/legacy FortressComponentTag.java

mcconnell    2003/07/15 15:36:32

  Modified:    meta/tools/src/java/org/apache/avalon/meta/info/ant
                        MetaTask.java
               meta/tools/src/java/org/apache/avalon/meta/info/builder/tags
                        TypeTag.java
  Added:       meta/tools/src/java/org/apache/avalon/meta/info/builder/tags/legacy
                        FortressComponentTag.java
  Log:
  Add hooks to migrate fortress tags.
  
  Revision  Changes    Path
  1.5       +11 -2     avalon-sandbox/meta/tools/src/java/org/apache/avalon/meta/info/ant/MetaTask.java
  
  Index: MetaTask.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/meta/tools/src/java/org/apache/avalon/meta/info/ant/MetaTask.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- MetaTask.java	15 Jul 2003 21:26:35 -0000	1.4
  +++ MetaTask.java	15 Jul 2003 22:36:31 -0000	1.5
  @@ -63,6 +63,7 @@
   import org.apache.avalon.meta.info.writer.XMLServiceWriter;
   import org.apache.avalon.meta.info.writer.XMLTypeWriter;
   import org.apache.avalon.meta.info.builder.tags.TypeTag;
  +import org.apache.avalon.meta.info.builder.tags.legacy.FortressComponentTag;
   import org.apache.avalon.meta.info.builder.tags.ServiceTag;
   
   import org.apache.tools.ant.BuildException;
  @@ -317,7 +318,15 @@
                   Type type = new TypeTag( javaClass ).getType();
                   if( type == null )
                   {
  -                    continue;
  +                    //
  +                    // check for legacy
  +                    //
  +
  +                    type = new FortressComponentTag( javaClass ).getType();
  +                    if( type == null )
  +                    {
  +                        continue;
  +                    }
                   }
   
                   types++;
  
  
  
  1.4       +5 -8      avalon-sandbox/meta/tools/src/java/org/apache/avalon/meta/info/builder/tags/TypeTag.java
  
  Index: TypeTag.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/meta/tools/src/java/org/apache/avalon/meta/info/builder/tags/TypeTag.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TypeTag.java	15 Jul 2003 21:26:35 -0000	1.3
  +++ TypeTag.java	15 Jul 2003 22:36:32 -0000	1.4
  @@ -101,7 +101,7 @@
      /**
       * Alternative tag name.
       */
  -    public static final String COMPONENT_KEY = "component";
  +    public static final String KEY = "component";
   
      /**
       * The name parameter
  @@ -137,15 +137,11 @@
           DocletTag tag = getJavaClass().getTagByName( getNS() + Tags.DELIMITER + KEY );
           if( null == tag )
           {
  -            tag = getJavaClass().getTagByName( getNS() + Tags.DELIMITER + COMPONENT_KEY );
  -            if( null == tag )
  -            {
  -                return null;
  -            }
  +            return null;
           }
           final String name = getNamedParameter( tag, NAME_PARAM );
  -        final Version version = Version.getVersion( getNamedParameter( tag, VERSION_PARAM, "" ) );
           final String lifestyle = getNamedParameter( tag, LIFESTYLE_PARAM, null );
  +        final Version version = Version.getVersion( getNamedParameter( tag, VERSION_PARAM, "" ) );    
           final String type = getJavaClass().getFullyQualifiedName();
           final Properties properties = new AttributeTag( getJavaClass() ).getProperties();
           final InfoDescriptor info = new InfoDescriptor( name, type, version, lifestyle, properties );
  @@ -156,6 +152,7 @@
           final StageDescriptor[] stages = new StageTag( getJavaClass() ).getStages();
           final ExtensionDescriptor[] extensions = new ExtensionTag( getJavaClass() ).getExtensions();
           final ContextDescriptor context = new ContextTag( getJavaClass() ).getContext();
  +
           return new Type( info, loggers, context, services, dependencies, stages, extensions, null );
       }
   }
  
  
  
  1.1                  avalon-sandbox/meta/tools/src/java/org/apache/avalon/meta/info/builder/tags/legacy/FortressComponentTag.java
  
  Index: FortressComponentTag.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 2002-2003 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Jakarta", "Apache Avalon", "Avalon Framework" and
      "Apache Software Foundation"  must not be used to endorse or promote
      products derived  from this  software without  prior written
      permission. For written permission, please contact apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation. For more  information on the
   Apache Software Foundation, please see <http://www.apache.org/>.
  */
  
  package org.apache.avalon.meta.info.builder.tags.legacy;
  
  import org.apache.avalon.meta.info.builder.tags.AbstractTag
  import org.apache.avalon.meta.info.Type;
  
  import com.thoughtworks.qdox.model.DocletTag;
  import com.thoughtworks.qdox.model.JavaClass;
  
  /**
   * @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
   * @version $Revision: 1.1 $ $Date: 2003/07/15 22:36:32 $
   */
  public class FortressComponentTag extends AbstractTag
  {
     /**
      * Type tag constructor.
      * @param clazz the javadoc class descriptor
      */
      public ForessComponentTag( final JavaClass clazz )
      {
          super( clazz );
      }
  
     /**
      * Return the value of the Avalon 'type' tag.
      * @return the name of the component type
      * @exception IllegalArgumentException if the name tag does not contain a value
      */
      public Type getType()
      {
          //
          // waiting for an implementation that handles the @avalon.component
          // and related @x-avalon tags used by Fortress together with a bunch
          // of "please migrate to ..." messages
          //
  
          return null;
      }
  }
  
  
  

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