avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vin...@apache.org
Subject cvs commit: jakarta-avalon-apps/sevak/src/demo/java/org/apache/avalon/apps/sevak/demo SevakTest.java
Date Fri, 28 Jun 2002 05:04:39 GMT
vinayc      2002/06/27 22:04:39

  Added:       sevak/src/demo/java/org/apache/avalon/apps/sevak/demo
                        SevakTest.java
  Log:
  Sevak - Catalina Wrapper
  
  Revision  Changes    Path
  1.1                  jakarta-avalon-apps/sevak/src/demo/java/org/apache/avalon/apps/sevak/demo/SevakTest.java
  
  Index: SevakTest.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.apps.sevak.demo;
  
  import java.io.File;
  import java.net.URL;
  //avalon imports
  import org.apache.avalon.framework.activity.Initializable;
  import org.apache.avalon.framework.configuration.Configurable;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.ConfigurationException;
  import org.apache.avalon.framework.context.Context;
  import org.apache.avalon.framework.context.Contextualizable;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.service.ServiceException;
  import org.apache.avalon.framework.service.ServiceManager;
  import org.apache.avalon.framework.service.Serviceable;
  import org.apache.avalon.phoenix.BlockContext;
  //sevak imports
  import org.apache.avalon.apps.sevak.Sevak;
  import org.apache.avalon.apps.sevak.SevakException;
  
  /**
   * @phoenix:block
   *
   * Test Sevak (Tomcat wrapper).
   *
   * @author  Vinay Chandran<vinayc77@yahoo.com>
   * @version 1.0
   */
  public class SevakTest
          extends AbstractLogEnabled
          implements Contextualizable, Serviceable, Configurable, Initializable
  {
      private BlockContext m_context;
  	private Configuration m_configuration;
  	private Sevak m_sevak;
      
      public void contextualize(final Context context)
      {
          getLogger().info("SevakTest.contextualize()");
          m_context = (BlockContext) context;
      }
  
      public void configure(final Configuration configuration)
              throws ConfigurationException
      {
  		
  		m_configuration=configuration;	
  		
      }
  
      /**
       * @see org.apache.avalon.framework.service.Serviceable
       * @phoenix:dependency name="org.apache.avalon.apps.sevak.Sevak"
       */
      public void service(final ServiceManager serviceManager)
              throws ServiceException
      {
          getLogger().info("SevakTest.service()");
  		m_sevak=(Sevak)serviceManager.lookup(Sevak.class.getName());
      }
  
      public void initialize()
              throws Exception
      {
          getLogger().info("SevakTest.initialize()");
          Configuration[] contexts=m_configuration.getChildren("Context");
          for(int i=0;i<contexts.length;i++)
          {
     	     	m_sevak.deploy(contexts[i].getAttribute("docBase"),new File(m_context.getBaseDirectory().getAbsolutePath()+File.separatorChar+contexts[i].getAttribute("path")));
 
          }
  		
      }
  
  
  }
  
  
  

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