mcconnell    02/03/03 19:40:13

  Modified:    src/scratchpad/org/apache/avalon/excalibur/service
                        PipelineException.java
                        PipelineRuntimeException.java ServiceContext.java
                        ServiceLoader.java ServiceRegistry.java
  Log:
  removal of Phoenix and JDK1.4 dependecies (hopefully)
  
  Revision  Changes    Path
  1.2       +2 -10     
jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/service/PipelineException.java
  
  Index: PipelineException.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/service/PipelineException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PipelineException.java    3 Mar 2002 15:51:12 -0000       1.1
  +++ PipelineException.java    4 Mar 2002 03:40:13 -0000       1.2
  @@ -47,7 +47,7 @@
       {
           super( message, cause );
       }
  -
  +/*
       public String toString()
       {
           final StringBuffer sb = new StringBuffer();
  @@ -85,14 +85,6 @@
           return splitString( sw.toString(), "\n" );
       }
   
  -    /**
  -     * Splits the string on every token into an array of stack frames.
  -     *
  -     * @param string the string
  -     * @param onToken the token
  -     * @return the resultant array
  -     * @deprecated This is an internal utility method that should not be used
  -     */
       private static String[] splitString( final String string, final String 
onToken )
       {
           final StringTokenizer tokenizer = new StringTokenizer( string, 
onToken );
  @@ -105,6 +97,6 @@
   
           return result;
       }
  -
  +*/
   }
   
  
  
  
  1.2       +2 -10     
jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/service/PipelineRuntimeException.java
  
  Index: PipelineRuntimeException.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/service/PipelineRuntimeException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PipelineRuntimeException.java     3 Mar 2002 15:51:12 -0000       1.1
  +++ PipelineRuntimeException.java     4 Mar 2002 03:40:13 -0000       1.2
  @@ -47,7 +47,7 @@
       {
           super( message, cause );
       }
  -
  +/*
       public String toString()
       {
           final StringBuffer sb = new StringBuffer();
  @@ -85,14 +85,6 @@
           return splitString( sw.toString(), "\n" );
       }
   
  -    /**
  -     * Splits the string on every token into an array of stack frames.
  -     *
  -     * @param string the string
  -     * @param onToken the token
  -     * @return the resultant array
  -     * @deprecated This is an internal utility method that should not be used
  -     */
       private static String[] splitString( final String string, final String 
onToken )
       {
           final StringTokenizer tokenizer = new StringTokenizer( string, 
onToken );
  @@ -105,6 +97,6 @@
   
           return result;
       }
  -
  +*/
   }
   
  
  
  
  1.2       +2 -13     
jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/service/ServiceContext.java
  
  Index: ServiceContext.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/service/ServiceContext.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ServiceContext.java       3 Mar 2002 15:51:12 -0000       1.1
  +++ ServiceContext.java       4 Mar 2002 03:40:13 -0000       1.2
  @@ -8,7 +8,6 @@
   package org.apache.avalon.excalibur.service;
   
   import java.io.File;
  -import org.apache.avalon.phoenix.BlockContext;
   import org.apache.avalon.framework.logger.Logger;
   
   import org.apache.avalon.framework.context.DefaultContext;
  @@ -20,11 +19,11 @@
    * @author <a href="mailto:[EMAIL PROTECTED]">Stephen McConnell</a>
    */
   
  -public class ServiceContext extends DefaultContext implements BlockContext
  +public class ServiceContext extends DefaultContext 
   {
   
       public static final String ARGS_KEY = "ARGS";
  -    public static final String BASE_DIRECTORY_KEY = "APP_DIR";
  +    public static final String BASE_DIRECTORY_KEY = "app.home";
   
       private String[] m_args;
       private File m_root;
  @@ -49,15 +48,5 @@
       public File getBaseDirectory()
       {
           return m_root;
  -    }
  -
  -    public Logger getLogger( String name )
  -    {
  -        throw new RuntimeException("Not implemented.");
  -    }
  -
  -    public String getName()
  -    {
  -        return m_name;   
       }
   }
  
  
  
  1.3       +8 -28     
jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/service/ServiceLoader.java
  
  Index: ServiceLoader.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/service/ServiceLoader.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ServiceLoader.java        3 Mar 2002 23:07:49 -0000       1.2
  +++ ServiceLoader.java        4 Mar 2002 03:40:13 -0000       1.3
  @@ -51,6 +51,8 @@
   import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.activity.Startable;
   import org.apache.avalon.framework.activity.Disposable;
  +import org.apache.avalon.framework.ExceptionUtil;
  +import org.apache.avalon.framework.CascadingThrowable;
   
   /**
    * A service loader that loads a target class, manages full component 
lifecycle
  @@ -68,7 +70,7 @@
    * of a component, the pipline processor will attempt to locate a block 
configuration
    * based on the class name of the block.  If there is no configuration 
matching the 
    * class name an empty configuration will be supplied to the component or a 
component
  - * the the target component is depedant on (assuming the component in 
question 
  + * the the target component is dependent on (assuming the component in 
question 
    * implements the Configurable interface).
    *
    * <pre>
  @@ -278,25 +280,13 @@
           }
           catch( IllegalParameterException ipe )
           {
  -            System.err.println( ipe.getMessage() );
  -        }
  -        catch( PipelineException e )
  -        {
  -            final String error = "Service loader processing exception.";
  -            System.err.println( error );
  -            System.err.println( e );
  -        }
  -        catch( PipelineRuntimeException e )
  -        {
  -            final String error = "Service loader runtime exception.";
  -            System.err.println( error );
  -            System.err.println( e );
  +            System.err.println( "IPE: " + ipe.getMessage() );
           }
           catch( Throwable e )
           {
  -            final String error = "Unexpected service loader exception.";
  -            System.err.println( error );
  +            System.out.println( "MAIN: " + e.toString() );
               e.printStackTrace();
  +            //ExceptionUtil.printStackTrace( e, true ); // something wrong 
in ExceptionUtil !!
           }
           finally
           {
  @@ -376,20 +366,10 @@
           {
               process();
           }
  -        catch( PipelineException e )
  -        {
  -            final String error = "Service loader processing exception.";
  -            getLogger().error( error );
  -        }
  -        catch( PipelineRuntimeException e )
  -        {
  -            final String error = "Service loader runtime exception.";
  -            getLogger().error( error );
  -        }
           catch( Throwable e )
           {
  -            final String error = "Unexpected pipeline exception.";
  -            getLogger().error( error, e );
  +            final String error = "Service processing error.";
  +            throw new PipelineException( error, e );
           }
           finally
           {
  
  
  
  1.2       +9 -1      
jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/service/ServiceRegistry.java
  
  Index: ServiceRegistry.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/service/ServiceRegistry.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ServiceRegistry.java      3 Mar 2002 15:51:12 -0000       1.1
  +++ ServiceRegistry.java      4 Mar 2002 03:40:13 -0000       1.2
  @@ -129,6 +129,9 @@
                   final String classname = path.replace('/','.');
                   Class block = 
Thread.currentThread().getContextClassLoader().loadClass( classname );
                   vector.add( new UnitInfo( block, xinfo, config ));
  +                //System.out.println("LOADED CONFIG: " + path + ".conf" + ", 
" + config.getName() );
  +                //System.out.println("CHILDREN: " + 
config.getChildren().length );
  +                //System.out.println("PROFILE: " + 
config.getChild("profile").getChildren().length );
               }
           }
           catch( Throwable e )
  @@ -148,9 +151,14 @@
           try
           {
               String path = block.getName().replace('.','/');
  -            Configuration config = loadConfiguration( path + ".config", true 
);
  +            Configuration config = loadConfiguration( path + ".conf", true );
               Configuration xinfo = loadConfiguration( path + ".xinfo", false 
);
               if( xinfo == null ) xinfo = new DefaultConfiguration("", null);
  +
  +            //System.out.println("X-LOADED CONFIG: " + path + ".conf" + ", " 
+ config.getName() );
  +            //System.out.println("X-CHILDREN: " + 
config.getChildren().length );
  +            //System.out.println("X-PROFILE: " + 
config.getChild("profile").getChildren().length );
  +
               return new UnitInfo( block, xinfo, config );
           }
           catch( Throwable e )
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to