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/altrmi/server AltrmiDatabaseManager.java AltrmiDatabaseManager.xinfo
Date Thu, 10 Jan 2002 11:19:37 GMT
hammant     02/01/10 03:19:37

  Modified:    apps/db  build.xml
               apps/db/src/conf db-assembly.xml db-config.xml
               apps/db/src/java/org/apache/avalon/db/basic/handlers/lxsql
                        BasicLXSQLInsertRowsHandler.java
               apps/db/src/java/org/apache/avalon/db/server
                        AbstractDatabaseManager.java
               apps/db/src/java/org/apache/avalon/db/test Tester.java
               apps/db/src/java/org/apache/avalon/db/transport/altrmi/client
                        AltrmiConnection.java
               apps/db/src/java/org/apache/avalon/db/transport/altrmi/server
                        AltrmiDatabaseManager.java
                        AltrmiDatabaseManager.xinfo
  Log:
  migration of transport from homegrown to altrmi
  
  Revision  Changes    Path
  1.31      +30 -4     jakarta-avalon-cornerstone/apps/db/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/build.xml,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- build.xml	10 Jan 2002 00:49:29 -0000	1.30
  +++ build.xml	10 Jan 2002 11:19:36 -0000	1.31
  @@ -59,9 +59,13 @@
         <include name="*.jar" />
       </fileset>    
     </path>
  -  
  +        
     <path id="test.path">
       <pathelement path="${build.classes}" />  
  +    <pathelement path="../../lib/commons-altrmi-common.jar" />
  +    <pathelement path="../../lib/commons-altrmi-client-interfaces.jar" />
  +    <pathelement path="../../lib/commons-altrmi-client-impl.jar" />
  +    <pathelement path="build/genclasses" />  
     </path>
   
     <path id="tools.class.path">
  @@ -74,6 +78,10 @@
     <taskdef name="sar" classname="org.apache.avalon.phoenix.tools.tasks.Sar">
       <classpath refid="project.class.path" />
     </taskdef>
  +  
  +  <taskdef name="altrmiinterfaces" classname="org.apache.commons.altrmi.generator.ant.AltrmiInterfaceTask">
  +    <classpath refid="project.class.path" />
  +  </taskdef>  
   
     <!-- Help on usage -->
     <target name="help" depends="usage"/>
  @@ -115,6 +123,8 @@
       <ant antfile="build.xml" dir="../.." target="compile" inheritall="false"/>
   
       <mkdir dir="${build.classes}"/>
  +    <mkdir dir="build/genjava"/>
  +    <mkdir dir="build/genclasses"/>
   
       <available classname="electric.registry.Registry" 
           classpathref="project.class.path" 
  @@ -159,7 +169,18 @@
         <exclude name="org/apache/avalon/db/**LXSQL**"
                  unless="DocumentBuilderFactory.present" />
       </javac>
  -
  +
  +    <altrmiinterfaces genname="AvalonDB" gendir="apps/db/build/genjava" 
  +        classesorinterfaces="org.apache.avalon.db.services.DatabaseManager" />
  +
  +    <javac  srcdir="build/genjava"
  +               destdir="build/genclasses"
  +                 debug="${compile.debug}"
  +           deprecation="${compile.deprecation}"
  +              optimize="${compile.optimize}">
  +          <classpath refid="project.class.path"/>
  +    </javac>
  +    
       <copy todir="${build.classes}">
         <fileset dir="${java.dir}">
           <exclude name="**/test/**"/>
  @@ -232,10 +253,15 @@
           <include name="bcel.jar"/>
           <include name="bsf.jar"/>
           <include name="js.jar"/>
  -        <include name="jakarta-regexp.jar"/>
  +        <include name="jakarta-regexp.jar"/>
         </lib>
   
  -      <lib dir="../../build/lib/" >
  +      <lib dir="../../lib/" >
  +        <include name="commons-altrmi-server-*.jar"/>
  +        <include name="commons-altrmi-common.jar"/>
  +      </lib>
  +
  +      <lib dir="../../build/lib/" >      
           <include name="cornerstone.jar"/>
         </lib>        
         
  
  
  
  1.13      +17 -0     jakarta-avalon-cornerstone/apps/db/src/conf/db-assembly.xml
  
  Index: db-assembly.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/conf/db-assembly.xml,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- db-assembly.xml	3 Dec 2001 11:18:35 -0000	1.12
  +++ db-assembly.xml	10 Jan 2002 11:19:36 -0000	1.13
  @@ -69,6 +69,7 @@
    
    
         <!-- Database Manager, including transport -->
  +      <!--
         <block class="org.apache.avalon.db.transport.cmdstream.server.PlainCMDDatabaseManager"

             name="avalondb-server" >
       	<provide name="sockets" role="org.apache.avalon.cornerstone.services.sockets.SocketManager"/>
  @@ -77,5 +78,21 @@
           <provide name="parser-manager" role="org.apache.avalon.db.services.ParserManager"
/>
           <provide name="sql-optimizer" role="org.apache.avalon.db.services.SQLOptimizer"
/>  
         </block>
  +      -->
  +      
  +      <block class="org.apache.avalon.db.transport.altrmi.server.AltrmiDatabaseManager"

  +          name="avalondb-server" >
  +    	<provide name="armi-publisher" role="org.apache.commons.altrmi.server.AltrmiPublisher"/>
  +        <provide name="parser-manager" role="org.apache.avalon.db.services.ParserManager"
/>
  +        <provide name="sql-optimizer" role="org.apache.avalon.db.services.SQLOptimizer"
/>  
  +      </block>
  +      
  +      <block class="org.apache.avalon.cornerstone.blocks.transport.publishing.SocketObjectStreamPublisher"

  +          name="armi-publisher" >
  +    	<provide name="sockets" role="org.apache.avalon.cornerstone.services.sockets.SocketManager"/>
  +        <provide name="connections" 
  +                 role="org.apache.avalon.cornerstone.services.connection.ConnectionManager"
/>                 
  +      </block>
  +      
         
   </assembly>
  
  
  
  1.9       +8 -0      jakarta-avalon-cornerstone/apps/db/src/conf/db-config.xml
  
  Index: db-config.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/conf/db-config.xml,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- db-config.xml	3 Dec 2001 11:18:35 -0000	1.8
  +++ db-config.xml	10 Jan 2002 11:19:36 -0000	1.9
  @@ -102,5 +102,13 @@
           <domClass>org.apache.xerces.jaxp.DocumentBuilderFactoryImpl</domClass>
       </dom-builder-factory>
       
  +    <armi-publisher>
  +      <port>8777</port>
  +      <bind>127.0.0.1</bind>
  +      <socketObjectStreamHandler>
  +        <connectiontimeout>360000</connectiontimeout>
  +      </socketObjectStreamHandler>
  +      <classRetrieverType>none</classRetrieverType>
  +    </armi-publisher>
   
   </config>
  
  
  
  1.8       +2 -1      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/handlers/lxsql/BasicLXSQLInsertRowsHandler.java
  
  Index: BasicLXSQLInsertRowsHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/handlers/lxsql/BasicLXSQLInsertRowsHandler.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- BasicLXSQLInsertRowsHandler.java	3 Dec 2001 11:18:35 -0000	1.7
  +++ BasicLXSQLInsertRowsHandler.java	10 Jan 2002 11:19:37 -0000	1.8
  @@ -40,7 +40,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.7 $
  + * @version $Revision: 1.8 $
    */
   public class BasicLXSQLInsertRowsHandler extends BasicLXSQLHandler {
   
  @@ -98,6 +98,7 @@
           //TOTO should be able to work with views and indexes.
           InsertRows action = new BasicInsertRows((BasicTable) queryable, rows);
   
  +        System.out.println("mParser = " + mParser);
           mParser.initializeAction(action);
           action.execute();
   
  
  
  
  1.29      +2 -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.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- AbstractDatabaseManager.java	3 Dec 2001 11:18:36 -0000	1.28
  +++ AbstractDatabaseManager.java	10 Jan 2002 11:19:37 -0000	1.29
  @@ -27,7 +27,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.28 $
  + * @version $Revision: 1.29 $
    */
   public abstract class AbstractDatabaseManager extends AbstractLogEnabled
           implements Composable, Initializable {
  @@ -49,6 +49,7 @@
           getLogger().info("AvalonDB.compose()");
   
           mSQLParser = (ParserManager) componentManager.lookup(ParserManager.class.getName());
  +        System.out.println("mSQLParser" + mSQLParser);
           mSQLOptimizer = (SQLOptimizer) componentManager.lookup(SQLOptimizer.class.getName());
       }
   
  
  
  
  1.40      +1 -1      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/test/Tester.java
  
  Index: Tester.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/test/Tester.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- Tester.java	20 Dec 2001 12:31:16 -0000	1.39
  +++ Tester.java	10 Jan 2002 11:19:37 -0000	1.40
  @@ -25,7 +25,7 @@
   
       private Tester(String type, String scriptFile) throws Exception {
           Class.forName("org.apache.avalon.db.driver.AvalonDBDriver").newInstance();
  -        String url = "jdbc:avalondb:cmds:"+type+":BlahBlah:localhost:9001";
  +        String url = "jdbc:avalondb:altrmi-sos:"+type+":BlahBlah:localhost:8777";
           mCon = DriverManager.getConnection(url, "todo", "todo");
   
           String D = File.separator;
  
  
  
  1.2       +13 -1     jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/transport/altrmi/client/AltrmiConnection.java
  
  Index: AltrmiConnection.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/transport/altrmi/client/AltrmiConnection.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AltrmiConnection.java	10 Jan 2002 00:49:29 -0000	1.1
  +++ AltrmiConnection.java	10 Jan 2002 11:19:37 -0000	1.2
  @@ -14,6 +14,8 @@
   import org.apache.avalon.db.common.AvalonDBSQLException;
   import org.apache.avalon.db.transport.Reply;
   import org.apache.avalon.db.transport.Request;
  +import org.apache.avalon.db.transport.EstablishConnectionReply;
  +import org.apache.avalon.db.transport.EstablishConnectionRequest;
   import org.apache.commons.altrmi.client.AltrmiHostContext;
   import org.apache.commons.altrmi.client.AltrmiFactory;
   import org.apache.commons.altrmi.client.impl.rmi.RmiAltrmiHostContext;
  @@ -30,13 +32,15 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   public abstract class AltrmiConnection extends AvalonDBConnection {
   
   
       private DatabaseManager mDBManager;
       private String[] mOptions;
  +    private String mRequestContextID;
  +    private int mSQLSyntax;
   
       private AltrmiHostContext getAltrmiHostContext(String url, String host, int port) throws
SQLException {
           String[] words = StringUtils.split(url,":");
  @@ -60,10 +64,14 @@
           AltrmiFactory altrmiFactory = new ClientClassAltrmiFactory();
           altrmiFactory.setHostContext(getAltrmiHostContext(url,host,port));
           mOptions = options;
  +        mSQLSyntax = syntax;
   
           try {
               mDBManager = (DatabaseManager) altrmiFactory.lookup("AvalonDB");
  +            EstablishConnectionReply rep = (EstablishConnectionReply) this.sendRequest(new
EstablishConnectionRequest(url));
  +            mRequestContextID = rep.getRequestContextID();
           } catch (AltrmiConnectionException ace) {
  +            ace.printStackTrace();
               throw new AvalonDBSQLException(
                   "Some IO Exception during connection creation to AltRMI Service" + url
                   + " during connection creation", ace);
  @@ -86,6 +94,10 @@
        *
        */
       public Reply sendRequest(Request request) throws SQLException {
  +
  +        request.setRequestContextID(mRequestContextID);
  +        request.setSQLSyntax(mSQLSyntax);
  +
           try {
               return mDBManager.processRequest(request);
           } catch (AltrmiInvocationException aie) {
  
  
  
  1.2       +1 -0      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/transport/altrmi/server/AltrmiDatabaseManager.java
  
  Index: AltrmiDatabaseManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/transport/altrmi/server/AltrmiDatabaseManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AltrmiDatabaseManager.java	10 Jan 2002 00:49:30 -0000	1.1
  +++ AltrmiDatabaseManager.java	10 Jan 2002 11:19:37 -0000	1.2
  @@ -68,6 +68,7 @@
       public void initialize() throws Exception {
           //TODO published name should be taken from config.xml
           mAltrmiPublisher.publish(this, "AvalonDB", DatabaseManager.class);
  +        System.out.println("AvalonDBListener server running using AltRMI");
       }
   
   }
  
  
  
  1.2       +1 -4      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/transport/altrmi/server/AltrmiDatabaseManager.xinfo
  
  Index: AltrmiDatabaseManager.xinfo
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/transport/altrmi/server/AltrmiDatabaseManager.xinfo,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AltrmiDatabaseManager.xinfo	10 Jan 2002 00:49:30 -0000	1.1
  +++ AltrmiDatabaseManager.xinfo	10 Jan 2002 11:19:37 -0000	1.2
  @@ -22,10 +22,7 @@
       </dependency>
       <dependency>
         <service name="org.apache.avalon.db.services.SQLOptimizer" version="1.0"/>
  -    </dependency>
  -    <dependency>
  -      <service name="org.apache.avalon.db.services.DatabasePersistence" version="1.0"/>
  -    </dependency>      
  +    </dependency>     
     </dependencies>  
   
   </blockinfo>
  
  
  

--
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