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/utils RhinoHelper.java
Date Thu, 08 Nov 2001 15:16:37 GMT
hammant     01/11/08 07:16:37

  Modified:    apps/db/src/conf db-assembly.xml
  Added:       apps/db/lib bsf.jar js.jar
               apps/db/src/java/org/apache/avalon/db/utils RhinoHelper.java
  Log:
  Start of Rhino for Actions
  
  Revision  Changes    Path
  1.1                  jakarta-avalon-cornerstone/apps/db/lib/bsf.jar
  
  	<<Binary file>>
  
  
  1.1                  jakarta-avalon-cornerstone/apps/db/lib/js.jar
  
  	<<Binary file>>
  
  
  1.7       +9 -1      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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- db-assembly.xml	2001/11/03 15:02:07	1.6
  +++ db-assembly.xml	2001/11/08 15:16:37	1.7
  @@ -19,10 +19,18 @@
   
         <block class="org.apache.avalon.cornerstone.blocks.dom.DOMBuilderFactory" name="dom-builder-factory"
/>
         
  -      <block class="org.apache.avalon.db.bcel.parser.LXSQLParser" name="sql-parser">
  +      <!--
  +      <block class="org.apache.avalon.db.bcel.parser.BCELLXSQLParser" name="sql-parser">
             <provide name="dom-builder-factory" role="org.apache.avalon.cornerstone.services.dom.DocumentBuilderFactory"
/>
             <provide name="db-persistor" role="org.apache.avalon.db.services.DatabasePersistor"
/>          
         </block>
  +      -->
  + 
  +      <block class="org.apache.avalon.db.basic.parser.BasicLXSQLParser" name="sql-parser">
  +           <provide name="dom-builder-factory" role="org.apache.avalon.cornerstone.services.dom.DocumentBuilderFactory"
/>
  +           <provide name="db-persistor" role="org.apache.avalon.db.services.DatabasePersistor"
/>          
  +      </block>
  + 
    
         <block class="org.apache.avalon.db.optimizer.DefaultSQLOptimizer" name="sql-optimizer"
/>
    
  
  
  
  1.1                  jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/utils/RhinoHelper.java
  
  Index: RhinoHelper.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.utils;
  
  import com.ibm.bsf.BSFManager;
  import com.ibm.bsf.BSFException;
  import org.apache.avalon.db.actions.ActionException;
  
  public class RhinoHelper {
  
      BSFManager mBsfManager;
  
      public RhinoHelper() {
          mBsfManager = new BSFManager ();
      }
  
      public void addBean(String name, Object bean) {
          try {
              mBsfManager.declareBean(name, bean, bean.getClass());
          } catch (BSFException bsfe) {
              bsfe.printStackTrace();
              throw new RuntimeException("Failed to Add bean to BSF ");
          }
      }
  
      public void executeAction(String script) throws ActionException {
          try {
              mBsfManager.exec("JavaScript", "<ANT>", 0, 0, script);
          } catch (BSFException bsfe) {
              bsfe.printStackTrace();
              bsfe.getTargetException().printStackTrace();
              throw new ActionException("Action Execution Failed because of scripting error
: " + bsfe.getMessage());
          }
      }
  
  }
  
  
  

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