avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamm...@apache.org
Subject cvs commit: jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/server AbstractDatabaseManager.java
Date Tue, 13 Nov 2001 14:16:24 GMT
hammant     01/11/13 06:16:24

  Modified:    apps/db/src/java/org/apache/avalon/db/actions Action.java
               apps/db/src/java/org/apache/avalon/db/actions/impl
                        AbstractAction.java
               apps/db/src/java/org/apache/avalon/db/basic/actions
                        BasicCreateIndex.java BasicCreateTable.java
                        BasicCreateView.java BasicInsert.java
                        BasicSelect.java
               apps/db/src/java/org/apache/avalon/db/bcel/actions
                        BCELCreateTable.java BCELInsert.java
                        BCELSelect.java
               apps/db/src/java/org/apache/avalon/db/server
                        AbstractDatabaseManager.java
  Log:
  Actions can be loggable now
  
  Revision  Changes    Path
  1.8       +4 -2      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/actions/Action.java
  
  Index: Action.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/actions/Action.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Action.java	2001/11/09 10:21:33	1.7
  +++ Action.java	2001/11/13 14:16:23	1.8
  @@ -10,6 +10,7 @@
   
   import org.apache.avalon.db.services.DatabasePersistor;
   import org.apache.avalon.db.services.SQLParser;
  +import org.apache.avalon.framework.logger.LogEnabled;
   
   
   /**
  @@ -18,9 +19,10 @@
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
    * @author Gerhard Froehlich <a href="mailto:g-froehlich@gmx.de">g-froehlich@gmx.de</a>
  - * @version * $Revision: 1.7 $
  + * @version * $Revision: 1.8 $
    */
  -public interface Action {
  +public interface Action extends LogEnabled {
  +    void initialize() throws ActionException;
       void execute() throws ActionException;
       void setDatabasePersistor(DatabasePersistor databasePersistor);
   }
  
  
  
  1.6       +1 -0      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/actions/impl/AbstractAction.java
  
  Index: AbstractAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/actions/impl/AbstractAction.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AbstractAction.java	2001/11/13 13:44:30	1.5
  +++ AbstractAction.java	2001/11/13 14:16:23	1.6
  @@ -21,6 +21,7 @@
           mDatabasePersistor = databasePersistor;
       }
   
  +
       /* TODO not needed ? - PH
       protected Class getJavaType(String sqlType) throws ActionException {
   
  
  
  
  1.4       +6 -2      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/actions/BasicCreateIndex.java
  
  Index: BasicCreateIndex.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/actions/BasicCreateIndex.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BasicCreateIndex.java	2001/11/11 21:44:47	1.3
  +++ BasicCreateIndex.java	2001/11/13 14:16:23	1.4
  @@ -23,7 +23,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.3 $
  + * @version $Revision: 1.4 $
    */
   public class BasicCreateIndex extends BasicCreateQueryable implements CreateIndex {
   
  @@ -35,14 +35,18 @@
           mIndexName = IndexName;
           mLxsql = lxsql;
   
  +    }
  +
  +    public void initialize() throws ActionException {
           NodeList subRootNodes = mLxsql.getChildNodes();
           for (int i = 0; i < subRootNodes.getLength(); i++) {
               if (subRootNodes.item(i).getNodeName().equals("???")) {
                   //TODO
               }
           }
  -
  +        mBasicSelect.initialize();
       }
  +
   
   
   
  
  
  
  1.9       +2 -0      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/actions/BasicCreateTable.java
  
  Index: BasicCreateTable.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/actions/BasicCreateTable.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- BasicCreateTable.java	2001/11/12 23:09:56	1.8
  +++ BasicCreateTable.java	2001/11/13 14:16:23	1.9
  @@ -42,6 +42,8 @@
           mLxsql = lxsql;
       }
   
  +    public void initialize() throws ActionException {
  +    }
   
       /**
        * Method execute
  
  
  
  1.9       +4 -4      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/actions/BasicCreateView.java
  
  Index: BasicCreateView.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/actions/BasicCreateView.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- BasicCreateView.java	2001/11/11 21:44:47	1.8
  +++ BasicCreateView.java	2001/11/13 14:16:23	1.9
  @@ -29,7 +29,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.8 $
  + * @version $Revision: 1.9 $
    */
   public class BasicCreateView extends BasicCreateQueryable implements CreateView {
   
  @@ -40,17 +40,17 @@
       public BasicCreateView(String viewName, Document lxsql) {
           mViewName = viewName;
           mLxsql = lxsql;
  +    }
   
  +    public void initialize() throws ActionException {
           NodeList subRootNodes = mLxsql.getChildNodes();
           for (int i = 0; i < subRootNodes.getLength(); i++) {
               if (subRootNodes.item(i).getNodeName().equals("select-simple")) {
                   mBasicSelect = new BasicSelect((Element) subRootNodes.item(i));
               }
           }
  -
  +        mBasicSelect.initialize();
       }
  -
  -
   
       /**
        * Method execute
  
  
  
  1.5       +3 -0      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/actions/BasicInsert.java
  
  Index: BasicInsert.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/actions/BasicInsert.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BasicInsert.java	2001/11/13 09:25:42	1.4
  +++ BasicInsert.java	2001/11/13 14:16:23	1.5
  @@ -49,6 +49,9 @@
           mDocument = document;
       }
   
  +    public void initialize() throws ActionException {
  +    }
  +
       /**
        * Method execute
        *
  
  
  
  1.16      +3 -1      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/actions/BasicSelect.java
  
  Index: BasicSelect.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/actions/BasicSelect.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- BasicSelect.java	2001/11/13 13:44:18	1.15
  +++ BasicSelect.java	2001/11/13 14:16:23	1.16
  @@ -52,7 +52,9 @@
        */
       public BasicSelect(Element rootElement) {
           mRootElement = rootElement;
  -        setupLogger(this);
  +    }
  +
  +    public void initialize() throws ActionException {
           getLogger().debug("TEST");
       }
   
  
  
  
  1.9       +3 -2      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/bcel/actions/BCELCreateTable.java
  
  Index: BCELCreateTable.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/bcel/actions/BCELCreateTable.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- BCELCreateTable.java	2001/11/11 21:44:47	1.8
  +++ BCELCreateTable.java	2001/11/13 14:16:23	1.9
  @@ -27,7 +27,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.8 $
  + * @version $Revision: 1.9 $
    */
   public class BCELCreateTable extends AbstractBCELAction implements CreateTable {
   
  @@ -54,7 +54,8 @@
           columns.toArray(mColumns);
       }
   
  -
  +    public void initialize() throws ActionException {
  +    }
   
       /**
        * Method execute
  
  
  
  1.5       +3 -2      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/bcel/actions/BCELInsert.java
  
  Index: BCELInsert.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/bcel/actions/BCELInsert.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BCELInsert.java	2001/11/05 14:12:22	1.4
  +++ BCELInsert.java	2001/11/13 14:16:23	1.5
  @@ -25,7 +25,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    */
   public class BCELInsert extends AbstractBCELAction implements Insert {
   
  @@ -46,7 +46,8 @@
           mDocument = document;
       }
   
  -
  +    public void initialize() throws ActionException {
  +    }
   
       /**
        * Method execute
  
  
  
  1.5       +3 -0      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/bcel/actions/BCELSelect.java
  
  Index: BCELSelect.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/bcel/actions/BCELSelect.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BCELSelect.java	2001/11/09 23:31:09	1.4
  +++ BCELSelect.java	2001/11/13 14:16:23	1.5
  @@ -44,6 +44,9 @@
           mDocument = document;
       }
   
  +    public void initialize() throws ActionException {
  +    }
  +
       /**
        * Method execute
        */
  
  
  
  1.18      +9 -1      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/server/AbstractDatabaseManager.java
  
  Index: AbstractDatabaseManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/server/AbstractDatabaseManager.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- AbstractDatabaseManager.java	2001/11/10 21:45:03	1.17
  +++ AbstractDatabaseManager.java	2001/11/13 14:16:23	1.18
  @@ -42,7 +42,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.17 $
  + * @version $Revision: 1.18 $
    */
   public abstract class AbstractDatabaseManager extends AbstractLogEnabled implements Composable
{
   
  @@ -105,18 +105,24 @@
               mSQLOptimizer.optimizeSelectRequest(selectRequest);
           */
           Select select = mSQLParser.createSelectAction(selectRequest); //optimizedSelectRequest);
  +        this.setupLogger(select);
  +        select.initialize();
           select.execute();
           return new ResultSetReply(select.getRowSet());
       }
   
       public Reply processCreateTableRequest(CreateTableRequest createTableRequest) throws
ActionException {
           CreateTable ct = mSQLParser.createCreateTableAction(createTableRequest);
  +        this.setupLogger(ct);
  +        ct.initialize();
           ct.execute();
           return new UpdateReply(ct.getRecordCount());
       }
   
       public Reply processCreateViewRequest(CreateViewRequest createViewRequest) throws ActionException
{
           CreateView cv = mSQLParser.createCreateViewAction(createViewRequest);
  +        this.setupLogger(cv);
  +        cv.initialize();
           cv.execute();
           return new UpdateReply(cv.getRecordCount());
       }
  @@ -124,6 +130,8 @@
   
       public Reply processInsertRequest(InsertRequest insertRequest) throws ActionException
{
           Insert ins = mSQLParser.createInsertAction(insertRequest);
  +        this.setupLogger(ins);
  +        ins.initialize();
           ins.execute();
           return new UpdateReply(ins.getRecordCount());
       }
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message