You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by st...@apache.org on 2002/08/12 07:57:51 UTC

cvs commit: xml-axis/java/src/org/apache/axis/transport/http AxisServletBase.java

stevel      2002/08/11 22:57:51

  Modified:    java/src/org/apache/axis/transport/http AxisServletBase.java
  Log:
  nobody else needs to worry about this, but I am sharing this base among AxisServlet and AdminServlet
  
  Revision  Changes    Path
  1.7       +30 -2     xml-axis/java/src/org/apache/axis/transport/http/AxisServletBase.java
  
  Index: AxisServletBase.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/transport/http/AxisServletBase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- AxisServletBase.java	3 Jul 2002 17:50:27 -0000	1.6
  +++ AxisServletBase.java	12 Aug 2002 05:57:51 -0000	1.7
  @@ -131,9 +131,17 @@
        */
       public void destroy() {
           super.destroy();
  +
  +        //if we have had anything to do with creating an axis server
           if (axisServer != null) {
  -            axisServer.cleanup();
  -            axisServer =null;
  +            //then we lock it
  +            synchronized(axisServer) {
  +                //clean it up
  +                axisServer.cleanup();
  +                //and erase our history of it
  +                axisServer =null;
  +                storeEngine(getServletContext(),null);
  +            }
           }
       }
   
  @@ -295,5 +303,25 @@
           finally {
               decLockCounter();
           }
  +    }
  +    
  +    /**
  +     * extract the base of our webapp from an inbound request
  +     *
  +     * @param request request containing http://foobar/axis/services/
  +     * @return http://foobar/axis/services/
  +     */
  +    protected String getWebappBase(HttpServletRequest request) {
  +        StringBuffer baseURL=new StringBuffer(128);
  +        baseURL.append(request.getScheme());
  +        baseURL.append("//");
  +        baseURL.append(request.getServerName());
  +        if(request.getServerPort()!=80) {
  +            baseURL.append(":");
  +            baseURL.append(request.getServerPort());
  +        }
  +        baseURL.append("/");
  +        baseURL.append(request.getContextPath());
  +        return baseURL.toString();
       }
   }