avalon-cvs 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/transport CloseReply.java Reply.java
Date Fri, 23 Nov 2001 12:06:57 GMT
hammant     01/11/23 04:06:57

  Modified:    apps/db/src/java/org/apache/avalon/db/basic/parser
                        BasicLXSQLParser.java
               apps/db/src/java/org/apache/avalon/db/server
                        AbstractDatabaseManager.java AbstractParser.java
               apps/db/src/java/org/apache/avalon/db/server/stdhandlers
                        CatalogHandler.java EstablishConnectionHandler.java
                        PingHandler.java
               apps/db/src/java/org/apache/avalon/db/transport Reply.java
  Added:       apps/db/src/java/org/apache/avalon/db/basic/handlers
                        BasicCloseResultSetHandler.java
               apps/db/src/java/org/apache/avalon/db/server/stdhandlers
                        CloseHandler.java
               apps/db/src/java/org/apache/avalon/db/transport
                        CloseReply.java
  Log:
  close of statement and close of result set
  
  Revision  Changes    Path
  1.1                  jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/handlers/BasicCloseResultSetHandler.java
  
  Index: BasicCloseResultSetHandler.java
  ===================================================================
  
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.avalon.db.basic.handlers;
  
  import org.apache.avalon.db.server.AbstractRequestHandler;
  import org.apache.avalon.db.server.DBRequestContext;
  import org.apache.avalon.db.services.DatabasePersistor;
  import org.apache.avalon.db.transport.Reply;
  import org.apache.avalon.db.transport.Request;
  import org.apache.avalon.db.transport.CloseRequest;
  import org.apache.avalon.db.transport.CloseReply;
  import org.apache.avalon.db.actions.ActionException;
  
  
  /**
   * Class BasicCloseResultSetHandler
   *
   *
   * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
   * @version $Revision: 1.1 $
   */
  public class BasicCloseResultSetHandler extends AbstractRequestHandler {
  
      /**
       * Constructor BasicCloseResultSetHandler
       *
       *
       * @param databasePersistor
       *
       */
      public BasicCloseResultSetHandler(DatabasePersistor databasePersistor) {
          super(databasePersistor);
      }
  
      /**
       * Method handleRequest
       *
       *
       * @param request
       *
       * @return
       *
       * @throws ActionException
       *
       */
      public Reply handleRequest(DBRequestContext context, Request request) throws ActionException
{
          CloseRequest cr = (CloseRequest) request;
          //TODO find and close the "open" result set
          return new CloseReply();
      }
  }
  
  
  
  1.21      +2 -0      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/parser/BasicLXSQLParser.java
  
  Index: BasicLXSQLParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/parser/BasicLXSQLParser.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- BasicLXSQLParser.java	2001/11/21 07:19:58	1.20
  +++ BasicLXSQLParser.java	2001/11/23 12:06:57	1.21
  @@ -24,6 +24,7 @@
   import org.apache.avalon.db.basic.handlers.lxsql.BasicLXSQLDropTableHandler;
   import org.apache.avalon.db.basic.handlers.lxsql.BasicLXSQLDropViewHandler;
   import org.apache.avalon.db.basic.handlers.lxsql.BasicLXSQLDropIndexHandler;
  +import org.apache.avalon.db.basic.handlers.BasicCloseResultSetHandler;
   import org.apache.avalon.db.actions.Action;
   import org.apache.avalon.db.actions.ActionException;
   
  @@ -49,6 +50,7 @@
           handlers[Request.DROPTABLE] = new BasicLXSQLDropTableHandler(this,mDatabasePersistor);
           handlers[Request.DROPVIEW] = new BasicLXSQLDropViewHandler(this,mDatabasePersistor);
           handlers[Request.DROPINDEX] = new BasicLXSQLDropIndexHandler(this,mDatabasePersistor);
  +        handlers[Request.RESULTSETCLOSE] = new BasicCloseResultSetHandler(mDatabasePersistor);
       }
   
       public void initializeAction(Action action) throws ActionException {
  
  
  
  1.25      +1 -5      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.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- AbstractDatabaseManager.java	2001/11/19 17:03:13	1.24
  +++ AbstractDatabaseManager.java	2001/11/23 12:06:57	1.25
  @@ -27,7 +27,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.24 $
  + * @version $Revision: 1.25 $
    */
   public abstract class AbstractDatabaseManager extends AbstractLogEnabled
           implements Composable, Initializable {
  @@ -80,9 +80,5 @@
               getLogger().error("processRequest(): ActionException",ae);
               return new ExceptionReply(ae.getMessage());
           }
  -
  -
       }
  -
  -
   }
  
  
  
  1.8       +2 -0      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/server/AbstractParser.java
  
  Index: AbstractParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/server/AbstractParser.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AbstractParser.java	2001/11/19 17:03:13	1.7
  +++ AbstractParser.java	2001/11/23 12:06:57	1.8
  @@ -28,6 +28,7 @@
   import org.apache.avalon.db.server.stdhandlers.PingHandler;
   import org.apache.avalon.db.server.stdhandlers.CatalogHandler;
   import org.apache.avalon.db.server.stdhandlers.EstablishConnectionHandler;
  +import org.apache.avalon.db.server.stdhandlers.CloseHandler;
   
   import java.util.HashMap;
   
  @@ -97,6 +98,7 @@
           handlers[Request.SETCATALOG] = new CatalogHandler(mDatabasePersistor);
           handlers[Request.CATALOGREQUEST] = new CatalogHandler(mDatabasePersistor);
           handlers[Request.ESTABLISHCONNECTION] = new EstablishConnectionHandler(mDatabasePersistor);
  +        handlers[Request.CLOSE] = new CloseHandler(mDatabasePersistor);
   
           // custom
           getCustomRequestHandlers(handlers);
  
  
  
  1.3       +33 -2     jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/server/stdhandlers/CatalogHandler.java
  
  Index: CatalogHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/server/stdhandlers/CatalogHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CatalogHandler.java	2001/11/19 12:11:54	1.2
  +++ CatalogHandler.java	2001/11/23 12:06:57	1.3
  @@ -6,9 +6,10 @@
    * version 1.1, a copy of which has been included with this distribution in
    * the LICENSE file.
    */
  -
   package org.apache.avalon.db.server.stdhandlers;
   
  +
  +
   import org.apache.avalon.db.server.AbstractRequestHandler;
   import org.apache.avalon.db.server.DBRequestContext;
   import org.apache.avalon.db.transport.Reply;
  @@ -19,18 +20,48 @@
   import org.apache.avalon.db.actions.ActionException;
   import org.apache.avalon.db.services.DatabasePersistor;
   
  +
  +/**
  + * Class CatalogHandler
  + *
  + *
  + * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  + * @version $Revision: 1.3 $
  + */
   public class CatalogHandler extends AbstractRequestHandler {
   
  +    /**
  +     * Constructor CatalogHandler
  +     *
  +     *
  +     * @param databasePersistor
  +     *
  +     */
       public CatalogHandler(DatabasePersistor databasePersistor) {
           super(databasePersistor);
       }
   
  +    /**
  +     * Method handleRequest
  +     *
  +     *
  +     * @param context
  +     * @param request
  +     *
  +     * @return
  +     *
  +     * @throws ActionException
  +     *
  +     */
       public Reply handleRequest(DBRequestContext context, Request request) throws ActionException
{
  +
           CatalogRequest cr = (CatalogRequest) request;
  +
           if (request.getRequestCode() == Request.CATALOGREQUEST) {
               context.setCurrentCatalog(cr.getCatalog());
  -        } else { // SETCATALOG
  +        } else {    // SETCATALOG
           }
  +
           return new CatalogReply(context.getCurrentCatalog().getName());
       }
   }
  
  
  
  1.2       +33 -2     jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/server/stdhandlers/EstablishConnectionHandler.java
  
  Index: EstablishConnectionHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/server/stdhandlers/EstablishConnectionHandler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EstablishConnectionHandler.java	2001/11/19 15:58:59	1.1
  +++ EstablishConnectionHandler.java	2001/11/23 12:06:57	1.2
  @@ -6,9 +6,10 @@
    * version 1.1, a copy of which has been included with this distribution in
    * the LICENSE file.
    */
  -
   package org.apache.avalon.db.server.stdhandlers;
   
  +
  +
   import org.apache.avalon.db.server.AbstractRequestHandler;
   import org.apache.avalon.db.server.DBRequestContext;
   import org.apache.avalon.db.transport.Reply;
  @@ -18,14 +19,44 @@
   import org.apache.avalon.db.actions.ActionException;
   import org.apache.avalon.db.services.DatabasePersistor;
   
  +
  +/**
  + * Class EstablishConnectionHandler
  + *
  + *
  + * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  + * @version $Revision: 1.2 $
  + */
   public class EstablishConnectionHandler extends AbstractRequestHandler {
   
  +    /**
  +     * Constructor EstablishConnectionHandler
  +     *
  +     *
  +     * @param databasePersistor
  +     *
  +     */
       public EstablishConnectionHandler(DatabasePersistor databasePersistor) {
           super(databasePersistor);
       }
   
  +    /**
  +     * Method handleRequest
  +     *
  +     *
  +     * @param context
  +     * @param request
  +     *
  +     * @return
  +     *
  +     * @throws ActionException
  +     *
  +     */
       public Reply handleRequest(DBRequestContext context, Request request) throws ActionException
{
  +
           EstablishConnectionRequest ecr = (EstablishConnectionRequest) request;
  -        return new EstablishConnectionReply(mDatabasePersistor.getDBRequestContext("TODO").getRequestContextID());
  +
  +        return new EstablishConnectionReply(mDatabasePersistor.getDBRequestContext("TODO")
  +            .getRequestContextID());
       }
   }
  
  
  
  1.4       +29 -1     jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/server/stdhandlers/PingHandler.java
  
  Index: PingHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/server/stdhandlers/PingHandler.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PingHandler.java	2001/11/19 12:11:54	1.3
  +++ PingHandler.java	2001/11/23 12:06:57	1.4
  @@ -6,9 +6,10 @@
    * version 1.1, a copy of which has been included with this distribution in
    * the LICENSE file.
    */
  -
   package org.apache.avalon.db.server.stdhandlers;
   
  +
  +
   import org.apache.avalon.db.server.AbstractRequestHandler;
   import org.apache.avalon.db.server.DBRequestContext;
   import org.apache.avalon.db.transport.Reply;
  @@ -17,12 +18,39 @@
   import org.apache.avalon.db.actions.ActionException;
   import org.apache.avalon.db.services.DatabasePersistor;
   
  +
  +/**
  + * Class PingHandler
  + *
  + *
  + * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  + * @version $Revision: 1.4 $
  + */
   public class PingHandler extends AbstractRequestHandler {
   
  +    /**
  +     * Constructor PingHandler
  +     *
  +     *
  +     * @param databasePersistor
  +     *
  +     */
       public PingHandler(DatabasePersistor databasePersistor) {
           super(databasePersistor);
       }
   
  +    /**
  +     * Method handleRequest
  +     *
  +     *
  +     * @param context
  +     * @param request
  +     *
  +     * @return
  +     *
  +     * @throws ActionException
  +     *
  +     */
       public Reply handleRequest(DBRequestContext context, Request request) throws ActionException
{
           return new PingReply();
       }
  
  
  
  1.1                  jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/server/stdhandlers/CloseHandler.java
  
  Index: CloseHandler.java
  ===================================================================
  
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.avalon.db.server.stdhandlers;
  
  
  
  import org.apache.avalon.db.server.AbstractRequestHandler;
  import org.apache.avalon.db.server.DBRequestContext;
  import org.apache.avalon.db.services.DatabasePersistor;
  import org.apache.avalon.db.transport.Reply;
  import org.apache.avalon.db.transport.Request;
  import org.apache.avalon.db.transport.CloseReply;
  import org.apache.avalon.db.actions.ActionException;
  
  
  /**
   * Class CloseHandler
   *
   *
   * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
   * @version $Revision: 1.1 $
   */
  public class CloseHandler extends AbstractRequestHandler {
  
      // close connection...  databasePersistor
  
      /**
       * Constructor CloseHandler
       *
       *
       * @param databasePersistor
       *
       */
      public CloseHandler(DatabasePersistor databasePersistor) {
          super(databasePersistor);
      }
  
      /**
       * Method handleRequest
       *
       *
       * @param context
       * @param request
       *
       * @return
       *
       * @throws ActionException
       *
       */
      public Reply handleRequest(DBRequestContext context, Request request) throws ActionException
{
          return new CloseReply();
      }
  }
  
  
  
  1.11      +2 -1      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/transport/Reply.java
  
  Index: Reply.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/transport/Reply.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Reply.java	2001/11/19 12:11:54	1.10
  +++ Reply.java	2001/11/23 12:06:57	1.11
  @@ -17,7 +17,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.10 $
  + * @version $Revision: 1.11 $
    */
   public abstract class Reply implements Serializable {
   
  @@ -34,6 +34,7 @@
       public static final int TODOREPLY = 20;
       public static final int PINGREPLY = 21;
       public static final int ESTABLISHCONNECTIONREPLY = 22;
  +    public static final int CLOSEREPLY = 23;
   
   
       private int mReplyCode;
  
  
  
  1.1                  jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/transport/CloseReply.java
  
  Index: CloseReply.java
  ===================================================================
  
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.avalon.db.transport;
  
  /**
   * Class CloseReply
   *
   *
   * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
   * @version $Revision: 1.1 $
   */
  public class CloseReply extends Reply {
  
  
      /**
       * Constructor CloseReply
       *
       *
       */
      public CloseReply() {
          super(CLOSEREPLY);
      }
  
  
  }
  
  
  

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


Mime
View raw message