cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blorit...@apache.org
Subject cvs commit: xml-cocoon/src/org/apache/cocoon/util RoleUtils.java
Date Tue, 16 Jan 2001 17:03:19 GMT
bloritsch    01/01/16 09:03:19

  Modified:    src/org/apache/cocoon/util Tag: xml-cocoon2 RoleUtils.java
  Log:
  Fixes for step 2 of cocoon.xconf complexity cleanup
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +28 -5     xml-cocoon/src/org/apache/cocoon/util/Attic/RoleUtils.java
  
  Index: RoleUtils.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/util/Attic/RoleUtils.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- RoleUtils.java	2001/01/15 04:44:26	1.1.2.1
  +++ RoleUtils.java	2001/01/16 17:03:19	1.1.2.2
  @@ -5,23 +5,25 @@
    * version 1.1, a copy of which has been included  with this distribution in *
    * the LICENSE file.                                                         *
    *****************************************************************************/
  - 
  +
   package org.apache.cocoon.util;
   
   import org.apache.cocoon.Roles;
   import java.util.HashMap;
  +import java.util.Iterator;
   
   /**
    * Created this class to assist the translation from easy to understand
    * role aliases and the real Avalon role names.
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.1.2.1 $ $Date: 2001/01/15 04:44:26 $
  + * @version CVS $Revision: 1.1.2.2 $ $Date: 2001/01/16 17:03:19 $
    */
   
   public class RoleUtils {
   
       private static final HashMap shorthand;
  +    private static final HashMap classname;
   
       static {
           HashMap setup = new HashMap();
  @@ -30,18 +32,39 @@
           setup.put("parser", Roles.PARSER);
           setup.put("processor", Roles.PROCESSOR);
           setup.put("store", Roles.STORE);
  -        setup.put("markup-language", Roles.MARKUP_LANGUAGE);
  -        setup.put("programming-language", Roles.PROGRAMMING_LANGUAGE);
  +        setup.put("markup-languages", Roles.MARKUP_LANGUAGE);
  +        setup.put("programming-languages", Roles.PROGRAMMING_LANGUAGE);
           setup.put("program-generator", Roles.PROGRAM_GENERATOR);
           setup.put("classloader", Roles.CLASS_LOADER);
           setup.put("pool-controller", Roles.POOL_CONTROLLER);
           setup.put("image-encoder", Roles.IMAGE_ENCODER);
  -        setup.put("datasource", Roles.DB_CONNECTION);
  +        setup.put("datasources", Roles.DB_CONNECTION);
   
           shorthand = setup;
  +
  +        setup = new HashMap();
  +
  +        setup.put(Roles.PARSER, "org.apache.cocoon.components.parser.XercesParser");
  +        setup.put(Roles.STORE, "org.apache.cocoon.components.store.MemoryStore");
  +        setup.put(Roles.PROGRAMMING_LANGUAGE, "org.apache.cocoon.CocoonComponentSelector");
  +        setup.put(Roles.MARKUP_LANGUAGE, "org.apache.cocoon.CocoonComponentSelector");
  +        setup.put(Roles.CLASS_LOADER, "org.apache.cocoon.components.classloader.ClassLoaderManagerImpl");
  +        setup.put(Roles.PROGRAM_GENERATOR, "org.apache.cocoon.components.language.generator.ProgramGeneratorImpl");
  +        setup.put(Roles.DB_CONNECTION, "org.apache.cocoon.CocoonComponentSelector");
  +        setup.put(Roles.POOL_CONTROLLER, "org.apache.cocoon.util.ComponentPoolController");
  +
  +        classname = setup;
       }
   
       public static String lookup(String shorthandName) {
           return (String) RoleUtils.shorthand.get(shorthandName);
  +    }
  +
  +    public static Iterator shorthandNames() {
  +        return RoleUtils.shorthand.keySet().iterator();
  +    }
  +
  +    public static String defaultClass(String role) {
  +        return (String) RoleUtils.classname.get(role);
       }
   }
  
  
  

Mime
View raw message