logo       

cvs commit: xml-xindice/java/src/org/apache/xindice/tools/command Shutdown.: msg#00205

Subject: cvs commit: xml-xindice/java/src/org/apache/xindice/tools/command Shutdown.java
vgritsenko    2004/02/21 06:29:45

  Modified:    java/src/org/apache/xindice/core Database.java
               java/src/org/apache/xindice/tools XMLTools.java
               java/src/org/apache/xindice/tools/command Shutdown.java
  Log:
  XMLTools to shutdown the database when working in embed ("local") mode.
  
  Revision  Changes    Path
  1.41      +6 -2      
xml-xindice/java/src/org/apache/xindice/core/Database.java
  
  Index: Database.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/Database.java,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- Database.java     21 Feb 2004 13:48:23 -0000      1.40
  +++ Database.java     21 Feb 2004 14:29:45 -0000      1.41
  @@ -142,6 +142,10 @@
        * @see org.apache.xindice.core.DBObject#close()
        */
       public boolean close() throws DBException {
  +        if (log.isDebugEnabled()) {
  +            log.debug("Shutting down database: '" + getName() + "'");
  +        }
  +
           flushConfig();
           super.close();
   
  
  
  
  1.29      +13 -9     
xml-xindice/java/src/org/apache/xindice/tools/XMLTools.java
  
  Index: XMLTools.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/tools/XMLTools.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- XMLTools.java     8 Feb 2004 02:57:35 -0000       1.28
  +++ XMLTools.java     21 Feb 2004 14:29:45 -0000      1.29
  @@ -29,7 +29,6 @@
   import org.w3c.dom.Element;
   import org.w3c.dom.NodeList;
   import org.xmldb.api.DatabaseManager;
  -import org.xmldb.api.base.Database;
   import org.xmldb.api.base.XMLDBException;
   
   import java.io.File;
  @@ -285,24 +284,29 @@
   
           if (commandClass != null) {
               try {
  -                // register Xindice Database with xml:db
  -                Database db = new DatabaseImpl();
  -
  +                // Register Xindice Database with xml:db
  +                DatabaseImpl db = new DatabaseImpl();
                   DatabaseManager.registerDatabase(db);
   
  -                // execute command class
  +                // Execute command class
                   Command command = (Command) 
Class.forName(commandClass).newInstance();
                   command.execute(table);
  +
  +                // Close Database
  +                if ("true".equals(table.get(LOCAL))) {
  +                    command = new 
org.apache.xindice.tools.command.Shutdown();
  +                    command.execute(table);
  +                }
  +
                   return true;
               } catch (XMLDBException e) {
  -                System.err.println("XMLDB Exception with code " + 
e.errorCode);
  +                System.err.println("XMLDB Exception " + e.errorCode + ": " + 
e.getMessage());
                   if (table.get(VERBOSE).equals("true")) {
                       e.printStackTrace(System.err);
                   }
                   return false;
               } catch (Exception e) {
                   System.err.println("ERROR : " + e.getMessage());
  -
                   if (table.get(VERBOSE).equals("true")) {
                       e.printStackTrace(System.err);
                   }
  
  
  
  1.9       +4 -6      
xml-xindice/java/src/org/apache/xindice/tools/command/Shutdown.java
  
  Index: Shutdown.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/tools/command/Shutdown.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Shutdown.java     8 Feb 2004 02:57:35 -0000       1.8
  +++ Shutdown.java     21 Feb 2004 14:29:45 -0000      1.9
  @@ -27,8 +27,8 @@
   import java.util.Hashtable;
   
   /**
  - * AddCollection.java is designed to let the user create
  - * new Collections and Nested Collections within the Database.
  + * Shutdown.java is designed to let the user shutdown
  + * the Database.
    *
    * @version CVS $Revision$, $Date$
    */
  @@ -44,7 +44,6 @@
           }
   
           try {
  -
               // Get a Collection reference to pass on to individual commands
               String colstring = normalizeCollectionURI((String) 
table.get(XMLTools.COLLECTION),
                                                         (String) 
table.get(XMLTools.LOCAL));
  @@ -54,7 +53,6 @@
   
               // Shutdown the server
               man.shutdown();
  -
           } finally {
               if (col != null) {
                   col.close();
  
  
  



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

Recently Viewed:
boot-loaders.gr...    php.pear.genera...    debugging.valgr...    kde.redhat.user...    text.xml.xsl.ge...    culture.languag...    hardware.microc...    java.servicemix...    redhat.release....    web.zope.plone....    user-groups.lin...    opendarwin.webk...    video.mjpeg.use...    sysutils.bcfg2....    encryption.gpg....    lx-office.devel...    xfree86.forum/2...    mail.mutt.devel...    acpi.devel/2003...    qnx.openqnx.dev...    network.irc.irs...    freebsd.devel.m...   
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