geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gr...@apache.org
Subject cvs commit: incubator-geronimo/modules/web/src/java/org/apache/geronimo/web/jetty JettyWebConnector.java
Date Thu, 21 Aug 2003 15:02:45 GMT
gregw       2003/08/21 08:02:45

  Modified:    modules/web/src/java/org/apache/geronimo/web
                        AbstractWebContainer.java
  Added:       modules/web/src/java/org/apache/geronimo/web/jetty
                        JettyWebConnector.java
  Log:
  Adding connectors skeleton
  
  Revision  Changes    Path
  1.2       +65 -1     incubator-geronimo/modules/web/src/java/org/apache/geronimo/web/AbstractWebContainer.java
  
  Index: AbstractWebContainer.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/web/src/java/org/apache/geronimo/web/AbstractWebContainer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractWebContainer.java	18 Aug 2003 13:30:41 -0000	1.1
  +++ AbstractWebContainer.java	21 Aug 2003 15:02:45 -0000	1.2
  @@ -56,6 +56,7 @@
   package org.apache.geronimo.web;
   
   import org.apache.geronimo.common.AbstractContainer;
  +import org.apache.geronimo.common.Component;
   
   /**
    * Base class for web containers.
  @@ -94,4 +95,67 @@
       public void setDefaultWebXmlURL(String url) {
           defaultWebXmlURL = url;
       }
  +    
  +    /* (non-Javadoc)
  +     * @see org.apache.geronimo.common.Container#addComponent(org.apache.geronimo.common.Component)
  +     */
  +    public void addComponent(Component component)
  +    {
  +        super.addComponent(component);
  +        
  +        if (component instanceof WebConnector)
  +            webConnectorAdded((WebConnector)component);
  +        else if (component instanceof WebApplication)
  +            webApplicationAdded((WebApplication)component);
  +    }
  +
  +    /* (non-Javadoc)
  +     * @see org.apache.geronimo.common.Container#removeComponent(org.apache.geronimo.common.Component)
  +     */
  +    public void removeComponent(Component component) throws Exception
  +    {
  +        if (component instanceof WebConnector)
  +            webConnectorRemoval((WebConnector)component);
  +        else if (component instanceof WebApplication)
  +            webApplicationRemoval((WebApplication)component);
  +            
  +        super.removeComponent(component);
  +    }
  +    
  +    /**
  +     * Method called by addComponent after a WebConnector has been added.
  +     * @param connector
  +     */
  +    protected void webConnectorAdded(WebConnector connector)
  +    {
  +    }
  +
  +    
  +    /**
  +     * Method called by addComponment after a WebApplication has been added.
  +     * @param connector
  +     */
  +    protected void webApplicationAdded(WebApplication connector)
  +    {
  +    }
  +    
  +    
  +    /**
  +     * Method called by addComponent before a WebConnector has been removed.
  +     * @param connector
  +     */
  +    protected void webConnectorRemoval(WebConnector connector)
  +    {
  +    }
  +
  +    
  +    /**
  +     * Method called by removeComponment before a WebApplication has been removed.
  +     * @param connector
  +     */
  +    protected void webApplicationRemoval(WebApplication connector)
  +    {
  +    }
  +    
  +
   }
  
  
  
  1.1                  incubator-geronimo/modules/web/src/java/org/apache/geronimo/web/jetty/JettyWebConnector.java
  
  Index: JettyWebConnector.java
  ===================================================================
  /*
   * Created on 22-Aug-2003
   *
   * To change the template for this generated file go to
   * Window>Preferences>Java>Code Generation>Code and Comments
   */
  package org.apache.geronimo.web.jetty;
  
  import org.apache.geronimo.common.AbstractComponent;
  import org.apache.geronimo.web.WebConnector;
  import org.mortbay.http.HttpListener;
  
  /**
   * @author gregw
   *
   * To change the template for this generated type comment go to
   * Window>Preferences>Java>Code Generation>Code and Comments
   */
  public class JettyWebConnector extends AbstractComponent implements WebConnector
  {
      private HttpListener listener;
  
      /* (non-Javadoc)
       * @see org.apache.geronimo.web.WebConnector#setPort(int)
       */
      public void setPort(int port)
      {
          listener.setPort(port);
      }
  
      /* (non-Javadoc)
       * @see org.apache.geronimo.web.WebConnector#getPort()
       */
      public int getPort()
      {
          return listener.getPort();
      }
  
      /* (non-Javadoc)
       * @see org.apache.geronimo.web.WebConnector#setProtocol(java.lang.String)
       */
      public void setProtocol(String protocol)
      {
          // TODO. We have a choice here - if the protocol changes then create a new listener

          // and copy over all the parameters from the old listener  OR this class can store
all the 
          // parameters and only create a listener when it is started.
      }
  
      /* (non-Javadoc)
       * @see org.apache.geronimo.web.WebConnector#getProtocol()
       */
      public String getProtocol()
      {
          // TODO Auto-generated method stub
          return null;
      }
  
      /* (non-Javadoc)
       * @see org.apache.geronimo.web.WebConnector#setInterface(java.lang.String)
       */
      public void setInterface(String iface)
      {
          // TODO Auto-generated method stub
  
      }
  
      /* (non-Javadoc)
       * @see org.apache.geronimo.web.WebConnector#getInterface()
       */
      public String getInterface()
      {
          // TODO Auto-generated method stub
          return null;
      }
  
      /* (non-Javadoc)
       * @see org.apache.geronimo.web.WebConnector#setMaxConnections(int)
       */
      public void setMaxConnections(int maxConnects)
      {
          // TODO Auto-generated method stub
  
      }
  
      /* (non-Javadoc)
       * @see org.apache.geronimo.web.WebConnector#getMaxConnections()
       */
      public int getMaxConnections()
      {
          // TODO Auto-generated method stub
          return 0;
      }
  
      /* (non-Javadoc)
       * @see org.apache.geronimo.web.WebConnector#setMaxIdleTime(int)
       */
      public void setMaxIdleTime(int maxIdleTime)
      {
          // TODO Auto-generated method stub
  
      }
  
      /* (non-Javadoc)
       * @see org.apache.geronimo.web.WebConnector#getMaxIdleTime()
       */
      public int getMaxIdleTime()
      {
          // TODO Auto-generated method stub
          return 0;
      }
  
      /* (non-Javadoc)
       * @see org.apache.geronimo.web.WebConnector#setContexts(java.lang.String[])
       */
      public void setContexts(String[] contexts)
      {
          // TODO Auto-generated method stub
  
      }
  
      /* (non-Javadoc)
       * @see org.apache.geronimo.web.WebConnector#getContexts()
       */
      public String[] getContexts()
      {
          // TODO Auto-generated method stub
          return null;
      }
  
  }
  
  
  

Mime
View raw message