avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject cvs commit: jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/frontends PhoenixServlet.java
Date Wed, 27 Mar 2002 14:30:39 GMT
colus       02/03/27 06:30:39

  Modified:    src/java/org/apache/avalon/phoenix/frontends
                        PhoenixServlet.java
  Log:
  More readable.
  
  Revision  Changes    Path
  1.11      +12 -7     jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/frontends/PhoenixServlet.java
  
  Index: PhoenixServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/frontends/PhoenixServlet.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- PhoenixServlet.java	21 Mar 2002 05:35:25 -0000	1.10
  +++ PhoenixServlet.java	27 Mar 2002 14:30:39 -0000	1.11
  @@ -69,11 +69,10 @@
       {
           super.init();
   
  -        //TODO: configuring with more parameters.
           final ServletContext context = getServletContext();
           final String phoenixHome = getInitParameter( "phoenix.home", "/WEB-INF" );
  -        final String logDestination = getInitParameter( "log-destination", phoenixHome
+ "/logs/phoenix.log" );
  -        final String logPriority = getInitParameter( "log-priority", "INFO" );
  +        final String logDestination = getInitParameter( "log-destination" );
  +        final String logPriority = getInitParameter( "log-priority" );
           final String appName = getInitParameter( "application-name", "default" );
           final String appLoc = getInitParameter( "application-location", phoenixHome + "/"
+ appName );
           final String configFile = getInitParameter( "config-file", phoenixHome + "/conf/kernel.xml"
);
  @@ -88,21 +87,27 @@
           try
           {
               final DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
  -            final Configuration conf = builder.buildFromFile( context.getRealPath( configFile
) ).getChild( "embeddor" );
  -            m_embeddor = (SingleAppEmbeddor)Class.forName( conf.getAttribute( "class" )
).newInstance();
  +            final Configuration kernelConf = builder.buildFromFile( context.getRealPath(
configFile ) );
  +            final Configuration embeddorConf = kernelConf.getChild( "embeddor" );
  +            final String embeddorClassname = embeddorConf.getAttribute( "class" );
  +
  +            m_embeddor = (SingleAppEmbeddor)Class.forName( embeddorClassname ).newInstance();
  +
               m_embeddor.enableLogging( createLogger( m_parameters ) );
   
               if ( m_embeddor instanceof Parameterizable )
               {
                   ( (Parameterizable)m_embeddor ).parameterize( m_parameters );
               }
  +
               if ( m_embeddor instanceof Configurable )
               {
  -                ( (Configurable)m_embeddor ).configure( conf );
  +                ( (Configurable)m_embeddor ).configure( embeddorConf );
               }
  +
               m_embeddor.initialize();
   
  -            final Thread thread = new Thread( this, "Phoenix" );
  +            final Thread thread = new Thread( this, "Phoenix-Monitor" );
               thread.start();
           }
           catch ( final Throwable throwable )
  
  
  

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