avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/launcher Main.java
Date Fri, 12 Jul 2002 22:45:40 GMT
donaldp     2002/07/12 15:45:40

  Modified:    .        LICENSE.txt build.xml
               src/java/org/apache/avalon/phoenix/launcher Main.java
  Log:
  Update runtime so that all engine files are loaded from
  $PHOENIX_HOME/dist/lib
  
  Revision  Changes    Path
  1.2       +2 -3      jakarta-avalon-phoenix/LICENSE.txt
  
  Index: LICENSE.txt
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/LICENSE.txt,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LICENSE.txt	11 Dec 2001 10:13:32 -0000	1.1
  +++ LICENSE.txt	12 Jul 2002 22:45:40 -0000	1.2
  @@ -43,8 +43,7 @@
    THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    
    This software  consists of voluntary contributions made  by many individuals
  - on  behalf of the Apache Software  Foundation and was  originally created by
  - Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache 
  - Software Foundation, please see <http://www.apache.org/>.
  + on  behalf of the Apache Software  Foundation. For more  information on the 
  + Apache Software Foundation, please see <http://www.apache.org/>.
    
   */
  
  
  
  1.139     +2 -2      jakarta-avalon-phoenix/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/build.xml,v
  retrieving revision 1.138
  retrieving revision 1.139
  diff -u -r1.138 -r1.139
  --- build.xml	9 Jul 2002 07:11:28 -0000	1.138
  +++ build.xml	12 Jul 2002 22:45:40 -0000	1.139
  @@ -339,7 +339,7 @@
           <property name="bin.dist.lib" value="${bin.dist.dir}/lib"/>
           <property name="bin.dist.conf" value="${bin.dist.dir}/conf"/>
   
  -        <mkdir dir="${bin.dist.bin}"/>
  +        <mkdir dir="${bin.dist.bin}/lib"/>
           <mkdir dir="${bin.dist.apps}"/>
           <mkdir dir="${bin.dist.ext}"/>
           <mkdir dir="${bin.dist.lib}"/>
  @@ -353,7 +353,7 @@
               </fileset>
           </copy>
           <copy file="${build.lib}/phoenix-loader.jar" todir="${bin.dist.bin}/"/>
  -        <copy file="${build.lib}/phoenix-engine.jar" todir="${bin.dist.bin}"/>
  +        <copy file="${build.lib}/phoenix-engine.jar" todir="${bin.dist.bin}/lib"/>
   
           <copy file="${logkit.jar}" todir="${bin.dist.lib}"/>
           <copy file="${framework.jar}" todir="${bin.dist.lib}"/>
  
  
  
  1.19      +27 -12    jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/launcher/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/launcher/Main.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- Main.java	12 Jul 2002 22:05:29 -0000	1.18
  +++ Main.java	12 Jul 2002 22:45:40 -0000	1.19
  @@ -15,6 +15,7 @@
   import java.security.PermissionCollection;
   import java.security.Permissions;
   import java.security.Policy;
  +import java.util.ArrayList;
   import java.util.Hashtable;
   import java.util.StringTokenizer;
   
  @@ -27,7 +28,6 @@
   public final class Main
   {
       private static final String MAIN_CLASS = "org.apache.avalon.phoenix.frontends.CLIMain";
  -    private static final String MAIN_JAR = "phoenix-engine.jar";
       private static final String LOADER_JAR = "phoenix-loader.jar";
   
       private static Object c_frontend;
  @@ -138,25 +138,40 @@
       private static URL[] getEngineClassPath()
           throws Exception
       {
  -        final File mainJar = findEngineJar();
  -        final URL archive = mainJar.toURL();
  -        return new URL[]{archive};
  +        final ArrayList urls = new ArrayList();
  +
  +        final File dir = findEngineLibDir();
  +        final File[] files = dir.listFiles();
  +        for( int i = 0; i < files.length; i++ )
  +        {
  +            final File file = files[ i ];
  +            if( file.getName().endsWith( ".jar" ) )
  +            {
  +                urls.add( file.toURL() );
  +            }
  +        }
  +
  +        return (URL[])urls.toArray( new URL[ urls.size() ] );
       }
   
       /**
  -     * Find the "engine" jar from which to run main phoenix kernel.
  +     * Find directory to load engine specific libraries from.
        *
  -     * @return the engine file
  -     * @throws Exception if an error occurs
  +     * @return the lib dir
  +     * @throws Exception if unable to aquire directory
        */
  -    private static final File findEngineJar()
  +    private static File findEngineLibDir()
           throws Exception
       {
           final String phoenixHome = findPhoenixHome();
  -
  -        final String filename =
  -            phoenixHome + File.separator + "bin" + File.separator + MAIN_JAR;
  -        return ( new File( filename ) ).getCanonicalFile();
  +        final String engineLibDir =
  +            phoenixHome + File.separator + "bin" + File.separator + "lib";
  +        final File dir = new File( engineLibDir ).getCanonicalFile();
  +        if( !dir.exists() )
  +        {
  +            throw new Exception( "Unable to locate engine lib directory at " + engineLibDir
);
  +        }
  +        return dir;
       }
   
       /**
  
  
  

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