avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamm...@apache.org
Subject cvs commit: jakarta-avalon-apps/sevak/src/java/org/apache/avalon/apps/sevak/blocks/jetty JettySevak.java
Date Mon, 30 Sep 2002 23:08:48 GMT
hammant     2002/09/30 16:08:48

  Modified:    sevak/src/demo/conf jetty-config.xml
               sevak/src/demo/java/org/apache/avalon/apps/sevak/demo
                        SevakTest.java
               sevak/src/java/org/apache/avalon/apps/sevak/blocks/jetty
                        JettySevak.java
  Log:
  Attempt to get Jetty working again.
  
  Revision  Changes    Path
  1.2       +1 -0      jakarta-avalon-apps/sevak/src/demo/conf/jetty-config.xml
  
  Index: jetty-config.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/sevak/src/demo/conf/jetty-config.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- jetty-config.xml	22 Sep 2002 21:39:12 -0000	1.1
  +++ jetty-config.xml	30 Sep 2002 23:08:48 -0000	1.2
  @@ -11,6 +11,7 @@
         <hostname>localhost</hostname>
     </sevak>
     <sevakTest>  
  +      <Context docBase="ROOT" path="webapps/root"/>
     </sevakTest>
   
   </config>
  
  
  
  1.4       +3 -2      jakarta-avalon-apps/sevak/src/demo/java/org/apache/avalon/apps/sevak/demo/SevakTest.java
  
  Index: SevakTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/sevak/src/demo/java/org/apache/avalon/apps/sevak/demo/SevakTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SevakTest.java	30 Sep 2002 22:03:12 -0000	1.3
  +++ SevakTest.java	30 Sep 2002 23:08:48 -0000	1.4
  @@ -69,8 +69,9 @@
               String ctxPath = contexts[ i ].getAttribute( "path" );
               ctxPath = ctxPath.replace( '/', File.separatorChar );
               ctxPath = ctxPath.replace( '\\', File.separatorChar );
  -            String ctxFullPath = m_context.getBaseDirectory().getAbsolutePath() + File.separatorChar
+ ctxPath;
  -            //System.out.println("Ctx = " + ctx + ", path = " + ctxFullPath);
  +            String ctxFullPath = m_context.getBaseDirectory().getAbsolutePath()
  +                    + File.separatorChar + ctxPath;
  +            //System.out.println("Deploying " + ctx + " " + ctxFullPath);
               m_sevak.deploy( ctx, new File( ctxFullPath ) );
           }
   
  
  
  
  1.3       +12 -2     jakarta-avalon-apps/sevak/src/java/org/apache/avalon/apps/sevak/blocks/jetty/JettySevak.java
  
  Index: JettySevak.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/sevak/src/java/org/apache/avalon/apps/sevak/blocks/jetty/JettySevak.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JettySevak.java	29 Sep 2002 11:38:43 -0000	1.2
  +++ JettySevak.java	30 Sep 2002 23:08:48 -0000	1.3
  @@ -8,6 +8,7 @@
   package org.apache.avalon.apps.sevak.blocks.jetty;
   
   import org.apache.avalon.framework.activity.Startable;
  +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;
  @@ -25,6 +26,7 @@
   import org.mortbay.jetty.Server;
   import org.mortbay.jetty.servlet.WebApplicationContext;
   import org.mortbay.util.MultiException;
  +import org.mortbay.util.InetAddrPort;
   
   
   /**
  @@ -40,12 +42,13 @@
    * @version 1.0
    */
   public class JettySevak extends AbstractLogEnabled implements Sevak, Startable, Contextualizable,
  -        Configurable
  +        Configurable, Initializable
   {
   
       private Server m_server;
       private String m_hostName;
       private HashMap m_webapps = new HashMap();
  +    private int m_port;
   
   
       public JettySevak()
  @@ -61,6 +64,12 @@
       public void configure(final Configuration configuration) throws ConfigurationException
       {
           m_hostName = configuration.getChild("hostname").getValue("localhost");
  +        m_port = configuration.getChild("port").getValueAsInteger(8080);
  +    }
  +
  +    public void initialize() throws Exception
  +    {
  +        m_server.addListener(new InetAddrPort(m_hostName, m_port));
       }
   
       public final void start()
  @@ -91,15 +100,16 @@
       {
           try
           {
  +            // This does not work.
               WebApplicationContext ctx = m_server.addWebApplication(m_hostName, context,
                       pathToWebAppFolder.getAbsolutePath());
  +            System.out.println("deploying " + context + " " + pathToWebAppFolder.getAbsolutePath());
               m_webapps.put(context,ctx);
           }
           catch (IOException ioe)
           {
               throw new SevakException("Problem deploying web application in Jetty",ioe);
           }
  -
       }
   
       public void undeploy(String context) throws SevakException
  
  
  

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