crafterm    2002/10/16 09:21:07

  Modified:    xfc/src/test/org/apache/excalibur/xfc/test/util
                        FortressTestRig.java ECMTestRig.java
               xfc/src/test/org/apache/excalibur/xfc/test xfcTestCase.java
               xfc/src/java/org/apache/excalibur/xfc/ant XFCTask.java
               xfc/src/java/org/apache/excalibur/xfc package.html Main.java
  Added:       xfc/src/java/org/apache/excalibur/xfc/modules Constants.java
  Removed:     xfc/src/java/org/apache/excalibur/xfc/modules Fortress.java
                        ECM.java AbstractModule.java
  Log:
  Started cleaning up and refactoring xfc code
  
  * Split up Fortress and ECM modules into small components so
    they are easier to work with.
  * Adjusted test rigs and entry point classes to work with
    the split.
  
  Revision  Changes    Path
  1.2       +23 -3     
jakarta-avalon-excalibur/xfc/src/test/org/apache/excalibur/xfc/test/util/FortressTestRig.java
  
  Index: FortressTestRig.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/xfc/src/test/org/apache/excalibur/xfc/test/util/FortressTestRig.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FortressTestRig.java      8 Oct 2002 10:39:37 -0000       1.1
  +++ FortressTestRig.java      16 Oct 2002 16:21:06 -0000      1.2
  @@ -50,9 +50,12 @@
   package org.apache.excalibur.xfc.test.util;
   
   import org.apache.avalon.framework.configuration.Configuration;
  +import org.apache.avalon.framework.logger.Logger;
   
   import org.apache.excalibur.xfc.model.RoleRef;
  -import org.apache.excalibur.xfc.modules.Fortress;
  +
  +import org.apache.excalibur.xfc.modules.fortress.Fortress;
  +import org.apache.excalibur.xfc.modules.fortress.FortressSerializer;
   
   /**
    * Fortress Module Test Rig. This class extends Fortress and provides several 
accessor
  @@ -64,10 +67,27 @@
    */
   public final class FortressTestRig extends Fortress
   {
  +    private FortressSerializerTestRig m_serializerRig = new 
FortressSerializerTestRig();
  +
       public Configuration buildRole( final RoleRef roleref )
           throws Exception
       {
  -        return super.buildRole( roleref );
  +        return m_serializerRig.buildRole( roleref );
  +    }
  +
  +    public void enableLogging( final Logger logger )
  +    {
  +        super.enableLogging( logger );
  +        m_serializerRig.enableLogging( logger );
  +    }
  +
  +    class FortressSerializerTestRig extends FortressSerializer
  +    {
  +        public Configuration buildRole( final RoleRef roleref )
  +            throws Exception
  +        {
  +            return super.buildRole( roleref );
  +        }
       }
   }
   
  
  
  
  1.4       +24 -4     
jakarta-avalon-excalibur/xfc/src/test/org/apache/excalibur/xfc/test/util/ECMTestRig.java
  
  Index: ECMTestRig.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/xfc/src/test/org/apache/excalibur/xfc/test/util/ECMTestRig.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ECMTestRig.java   8 Oct 2002 12:49:22 -0000       1.3
  +++ ECMTestRig.java   16 Oct 2002 16:21:06 -0000      1.4
  @@ -50,8 +50,11 @@
   package org.apache.excalibur.xfc.test.util;
   
   import org.apache.avalon.framework.configuration.Configuration;
  +import org.apache.avalon.framework.logger.Logger;
   
  -import org.apache.excalibur.xfc.modules.ECM;
  +import org.apache.excalibur.xfc.modules.ecm.ECM;
  +import org.apache.excalibur.xfc.modules.ecm.ECMSerializer;
  +import org.apache.excalibur.xfc.modules.ecm.HandlerAnalyzer;
   import org.apache.excalibur.xfc.model.RoleRef;
   
   /**
  @@ -63,16 +66,33 @@
    */
   public final class ECMTestRig extends ECM
   {
  +    private ECMSerializerTestRig m_serializerRig = new ECMSerializerTestRig();
  +
       public Configuration buildRole( final RoleRef roleref )
           throws Exception
       {
  -        return super.buildRole( roleref );
  +        return m_serializerRig.buildRole( roleref );
       }
   
       public String getHandler( final String classname )
           throws Exception
       {
  -        return super.getHandler( classname );
  +        return HandlerAnalyzer.getHandler( classname );
  +    }
  +
  +    public void enableLogging( final Logger logger )
  +    {
  +        super.enableLogging( logger );
  +        m_serializerRig.enableLogging( logger );
  +    }
  +
  +    class ECMSerializerTestRig extends ECMSerializer
  +    {
  +        public Configuration buildRole( final RoleRef roleref )
  +            throws Exception
  +        {
  +            return super.buildRole( roleref );
  +        }
       }
   }
   
  
  
  
  1.7       +2 -2      
jakarta-avalon-excalibur/xfc/src/test/org/apache/excalibur/xfc/test/xfcTestCase.java
  
  Index: xfcTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/xfc/src/test/org/apache/excalibur/xfc/test/xfcTestCase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- xfcTestCase.java  14 Oct 2002 16:17:50 -0000      1.6
  +++ xfcTestCase.java  16 Oct 2002 16:21:06 -0000      1.7
  @@ -57,7 +57,7 @@
   
   import org.apache.excalibur.configuration.ConfigurationUtil;
   
  -import org.apache.excalibur.xfc.modules.ECM;
  +import org.apache.excalibur.xfc.modules.ecm.ECM;
   import org.apache.excalibur.xfc.model.Definition;
   import org.apache.excalibur.xfc.model.Model;
   import org.apache.excalibur.xfc.model.RoleRef;
  
  
  
  1.1                  
jakarta-avalon-excalibur/xfc/src/java/org/apache/excalibur/xfc/modules/Constants.java
  
  Index: Constants.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) @year@ 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", "Avalon", "Excalibur" 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
      [EMAIL PROTECTED]
  
   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.excalibur.xfc.modules;
  
  /**
   * Constants common to all {@link Module}s.
   *
   * @author <a href="mailto:[EMAIL PROTECTED]";>Marcus Crafter</a>
   * @version CVS $Id: Constants.java,v 1.1 2002/10/16 16:21:07 crafterm Exp $
   */
  public interface Constants
  {
      // normalized component handler names
      String TRANSIENT            = "transient";
      String THREAD               = "thread";
      String POOLED               = "pooled";
      String SINGLETON            = "singleton";
  
      // character used to separate context entries
      char   CONTEXT_SEPARATOR    = ':';
  
      // ExcaliburComponentSelector class name
      String ECS = "org.apache.avalon.excalibur.component.ExcaliburComponentSelector";
  
      // general strings used in .roles/.xconf files.
      String COMPONENT            = "component";
      String COMPONENT_INSTANCE   = "component-instance";
      String ROLELIST             = "role-list";
      String SHORTHAND            = "shorthand";
      String CLASS                = "class";
      String NAME                 = "name";
      String DEFAULT              = "default-class";
      String HINT                 = "hint";
      String ROLE                 = "role";
      String ID                   = "id";
      String HANDLER              = "handler";
  }
  
  
  
  1.2       +9 -4      
jakarta-avalon-excalibur/xfc/src/java/org/apache/excalibur/xfc/ant/XFCTask.java
  
  Index: XFCTask.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/xfc/src/java/org/apache/excalibur/xfc/ant/XFCTask.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XFCTask.java      8 Oct 2002 16:30:18 -0000       1.1
  +++ XFCTask.java      16 Oct 2002 16:21:07 -0000      1.2
  @@ -180,23 +180,28 @@
       {
           if ( "ecm".equalsIgnoreCase( clazz ) )
           {
  -            return Class.forName( "org.apache.excalibur.xfc.modules.ECM" );
  +            return Class.forName( "org.apache.excalibur.xfc.modules.ecm.ECM" );
           }
   
           if ( "fortress".equalsIgnoreCase( clazz ) )
           {
  -            return Class.forName( "org.apache.excalibur.xfc.modules.Fortress" );
  +            return Class.forName( 
"org.apache.excalibur.xfc.modules.fortress.Fortress" );
           }
   
           if ( "merlin".equalsIgnoreCase( clazz ) )
           {
  -            return Class.forName( "org.apache.excalibur.xfc.modules.Merlin" );
  +            return Class.forName( "org.apache.excalibur.xfc.modules.merlin.Merlin" 
);
           }
   
           // assume custom module
           return Class.forName( clazz );
       }
   
  +    /**
  +     * Helper method to return the current logging instance, LogEnabled style.
  +     *
  +     * @return a <code>Logger</code> value
  +     */
       private Logger getLogger()
       {
           return m_logger;
  
  
  
  1.2       +1 -1      
jakarta-avalon-excalibur/xfc/src/java/org/apache/excalibur/xfc/package.html
  
  Index: package.html
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/xfc/src/java/org/apache/excalibur/xfc/package.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- package.html      2 Oct 2002 17:32:28 -0000       1.1
  +++ package.html      16 Oct 2002 16:21:07 -0000      1.2
  @@ -4,7 +4,7 @@
   
   <p>
   <b>XFC</b> - The Excalibur <b>X</b>Conf <b>F</b>ile <b>C</b>onverter
  -<i>(currently in development)</i>
  +<i>(currently under development)</i>
   </p>
   
   <p>
  
  
  
  1.2       +4 -4      
jakarta-avalon-excalibur/xfc/src/java/org/apache/excalibur/xfc/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/xfc/src/java/org/apache/excalibur/xfc/Main.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Main.java 2 Oct 2002 17:32:28 -0000       1.1
  +++ Main.java 16 Oct 2002 16:21:07 -0000      1.2
  @@ -263,17 +263,17 @@
       {
           if ( "ecm".equalsIgnoreCase( clazz ) )
           {
  -            return Class.forName( "org.apache.excalibur.xfc.modules.ECM" );
  +            return Class.forName( "org.apache.excalibur.xfc.modules.ecm.ECM" );
           }
   
           if ( "fortress".equalsIgnoreCase( clazz ) )
           {
  -            return Class.forName( "org.apache.excalibur.xfc.modules.Fortress" );
  +            return Class.forName( 
"org.apache.excalibur.xfc.modules.fortress.Fortress" );
           }
   
           if ( "merlin".equalsIgnoreCase( clazz ) )
           {
  -            return Class.forName( "org.apache.excalibur.xfc.modules.Merlin" );
  +            return Class.forName( "org.apache.excalibur.xfc.modules.merlin.Merlin" 
);
           }
   
           // assume custom module
  
  
  

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

Reply via email to