logo       

cvs commit: xml-xindice/java/src/org/apache/xindice/core/indexer IndexManag: msg#00117

Subject: cvs commit: xml-xindice/java/src/org/apache/xindice/core/indexer IndexManager.java
vgritsenko    2004/02/11 06:00:33

  Modified:    java/src/org/apache/xindice/core Collection.java
               java/src/org/apache/xindice/core/indexer IndexManager.java
  Log:
  Exception handling: processChildren() catches all exceptions, no need to do 
this again.
  Propagate DBException from getSymbols (it does not throw any right now) in 
IndexManager
  constructor.
  
  Revision  Changes    Path
  1.47      +3 -3      
xml-xindice/java/src/org/apache/xindice/core/Collection.java
  
  Index: Collection.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/Collection.java,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- Collection.java   8 Feb 2004 02:51:06 -0000       1.46
  +++ Collection.java   11 Feb 2004 14:00:32 -0000      1.47
  @@ -1454,7 +1454,7 @@
                   indexManager.setConfig(idxConfig);
               } catch (Exception e) {
                   if (log.isWarnEnabled()) {
  -                    log.warn("ignored exception", e);
  +                    log.warn("Failed to initialize indexer", e);
                   }
               }
           }
  
  
  
  1.27      +15 -29    
xml-xindice/java/src/org/apache/xindice/core/indexer/IndexManager.java
  
  Index: IndexManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/indexer/IndexManager.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- IndexManager.java 8 Feb 2004 02:50:21 -0000       1.26
  +++ IndexManager.java 11 Feb 2004 14:00:33 -0000      1.27
  @@ -20,22 +20,19 @@
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  +import org.apache.xindice.Stopwatch;
   import org.apache.xindice.core.Collection;
   import org.apache.xindice.core.DBException;
   import org.apache.xindice.core.data.Key;
  -import org.apache.xindice.core.data.Record;
   import org.apache.xindice.core.data.RecordSet;
   import org.apache.xindice.util.Configuration;
   import org.apache.xindice.util.ConfigurationCallback;
   import org.apache.xindice.util.ObjectStack;
   import org.apache.xindice.util.SimpleConfigurable;
   import org.apache.xindice.util.XindiceException;
  -import org.apache.xindice.xml.NodeSource;
   import org.apache.xindice.xml.SymbolTable;
  -import org.apache.xindice.xml.dom.DocumentImpl;
   import org.apache.xindice.xml.sax.CompressionHandler;
   import org.apache.xindice.xml.sax.SAXEventGenerator;
  -import org.apache.xindice.Stopwatch;
   
   import org.w3c.dom.Document;
   import org.xml.sax.Attributes;
  @@ -88,38 +85,27 @@
       private SymbolTable symbols;
       private List newIndexers = new ArrayList(); // of IndexerInfo
   
  -    public IndexManager(Collection collection) {
  +
  +    public IndexManager(Collection collection) throws DBException {
           this.collection = collection;
  -        try {
  -            symbols = collection.getSymbols();
  -        } catch (Exception e) {
  -            if (log.isWarnEnabled()) {
  -                log.warn("ignored exception", e);
  -            }
  -        }
  +        this.symbols = collection.getSymbols();
       }
   
       public void setConfig(Configuration config) throws XindiceException {
           super.setConfig(config);
   
  -        try {
  -            config.processChildren(INDEX, new ConfigurationCallback() {
  -                public void process(Configuration cfg) {
  -                    String className = cfg.getAttribute(CLASS);
  -                    try {
  -                        register(Class.forName(className), cfg);
  -                    } catch (Exception e) {
  -                        if (log.isWarnEnabled()) {
  -                            log.warn("ignored exception", e);
  -                        }
  +        config.processChildren(INDEX, new ConfigurationCallback() {
  +            public void process(Configuration cfg) {
  +                String className = cfg.getAttribute(CLASS);
  +                try {
  +                    register(Class.forName(className), cfg);
  +                } catch (Exception e) {
  +                    if (log.isWarnEnabled()) {
  +                        log.warn("Failed to register index with class '" + 
className + "'", e);
                       }
                   }
  -            });
  -        } catch (Exception e) {
  -            if (log.isWarnEnabled()) {
  -                log.warn("setConfig", e);
               }
  -        }
  +        });
       }
   
       /**
  
  
  



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
audio.irate.dev...    yellowdog.gener...    ietf.ips/2002-0...    xfree86.fonts/2...    busybox/2003-07...    emacs.jdee/2004...    linux.mandrake....    hardware.microc...    user-groups.lin...    science.analysi...    version-control...    db.filemaker.de...    cluster.openmos...    mail.eyebrowse....    text.xml.xerces...    kde.devel.kwrit...    finance.moneyda...    gcc.regression/...    network.routing...    os.freebsd.deve...    recreation.radi...    qnx.openqnx.dev...    python.xml/2002...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe