cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/request RequestFactory.java
Date Thu, 03 Apr 2003 14:16:32 GMT
stefano     2003/04/03 06:16:32

  Modified:    src/java/org/apache/cocoon/components/request
                        RequestFactory.java
  Log:
  removing fixmes and adding explainations
  
  Revision  Changes    Path
  1.2       +13 -6     cocoon-2.1/src/java/org/apache/cocoon/components/request/RequestFactory.java
  
  Index: RequestFactory.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/request/RequestFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RequestFactory.java	9 Mar 2003 00:09:09 -0000	1.1
  +++ RequestFactory.java	3 Apr 2003 14:16:31 -0000	1.2
  @@ -65,25 +65,32 @@
   public abstract class RequestFactory implements Component {
   
       public static RequestFactory getRequestFactory(String className) {
  +
           RequestFactory factory = null;
  +
           try {
               ClassLoader loader = Thread.currentThread().getContextClassLoader();
               Class clazz = loader.loadClass(className);
  -            factory = (RequestFactory)clazz.newInstance();
  +            factory = (RequestFactory) clazz.newInstance();
           } catch (Throwable t) {
  -            // FIXME (VG): Is it Ok to ignore all exceptions?
  +            // the try/catch mechanism is used because there is no way
  +            // to know if a classloader contains a class without asking for it
           }
  -        if(factory == null) {
  +        
  +        if (factory == null) {
               try {
                   Class clazz = Class.forName(className);
  -                factory = (RequestFactory)clazz.newInstance();
  +                factory = (RequestFactory) clazz.newInstance();
               } catch (Throwable t) {
  -                // FIXME (VG): Is it Ok to ignore all exceptions?
  +                // the try/catch mechanism is used because there is no way
  +                // to know if a classloader contains a class without asking for it
               }
           }
  +
           if (factory == null) {
               factory = new SimpleRequestFactoryImpl();
           }
  +
           return factory;
       }
   
  
  
  

Mime
View raw message