costin      01/06/28 00:27:21

  Modified:    src/share/org/apache/tomcat/modules/config
                        ServerXmlReader.java
  Log:
  Set the hook for Hook setup ( here because later on we might use
  modules.xml instead of introspection )
  
  Revision  Changes    Path
  1.9       +14 -2     
jakarta-tomcat/src/share/org/apache/tomcat/modules/config/ServerXmlReader.java
  
  Index: ServerXmlReader.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/ServerXmlReader.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ServerXmlReader.java      2001/03/08 01:09:50     1.8
  +++ ServerXmlReader.java      2001/06/28 07:27:17     1.9
  @@ -70,6 +70,7 @@
   import org.apache.tomcat.core.*;
   import org.apache.tomcat.modules.server.*;
   import org.apache.tomcat.util.log.*;
  +import org.apache.tomcat.util.hooks.*;
   import org.apache.tomcat.util.IntrospectionUtils;
   import org.xml.sax.*;
   
  @@ -113,6 +114,7 @@
        throws TomcatException
       {
        if( this != module ) return;
  +     setupHookFinder();
        XmlMapper xh=new XmlMapper();
        xh.setDebug( debug );
        xh.addRule( "ContextManager", xh.setProperties() );
  @@ -158,7 +160,8 @@
        try {
            xh.readXml(f,cm);
        } catch( Exception ex ) {
  -         cm.log( sm.getString("tomcat.fatalconfigerror"), ex );
  +         ex.printStackTrace();
  +         //      cm.log( sm.getString("tomcat.fatalconfigerror"), ex );
            throw new TomcatException(ex);
        }
       }
  @@ -215,7 +218,7 @@
            String tag=(String)keys.nextElement();
            String classN=(String)modules.get( tag );
   
  -         xh.addRule(  tag ,
  +         xh.addRule( tag ,
                         xh.objectCreate( classN, null ));
            xh.addRule( tag ,
                        xh.setProperties());
  @@ -262,6 +265,15 @@
        }
       }
   
  +    void setupHookFinder() {
  +     Hooks.setHookFinder( new IntrospectionHookFinder() );
  +    }
  +
  +    static class IntrospectionHookFinder implements Hooks.HookFinder {
  +     public boolean hasHook( Object o, String hook ) {
  +         return IntrospectionUtils.hasHook( o, hook );
  +     }
  +    }
       // -------------------- File utils --------------------
   
       // get additional files
  
  
  

Reply via email to