axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rsi...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/providers/java JavaProvider.java
Date Thu, 26 Sep 2002 16:43:55 GMT
rsitze      2002/09/26 09:43:55

  Modified:    java/src/org/apache/axis/transport/http
                        ServletEndpointContextImpl.java
               java/src/org/apache/axis/providers/java JavaProvider.java
  Log:
  Cleanup
  
  Revision  Changes    Path
  1.4       +10 -10    xml-axis/java/src/org/apache/axis/transport/http/ServletEndpointContextImpl.java
  
  Index: ServletEndpointContextImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/transport/http/ServletEndpointContextImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ServletEndpointContextImpl.java	25 Sep 2002 20:54:36 -0000	1.3
  +++ ServletEndpointContextImpl.java	26 Sep 2002 16:43:55 -0000	1.4
  @@ -54,17 +54,19 @@
    */
   package org.apache.axis.transport.http;
   
  -import javax.xml.rpc.server.ServletEndpointContext;
  -import javax.xml.rpc.handler.MessageContext;
  -import javax.servlet.http.HttpSession;
  -import javax.servlet.ServletContext;
   import java.security.Principal;
   
  +import javax.servlet.ServletContext;
  +import javax.servlet.http.HttpServlet;
  +import javax.servlet.http.HttpServletRequest;
  +import javax.servlet.http.HttpSession;
  +import javax.xml.rpc.handler.MessageContext;
  +import javax.xml.rpc.server.ServletEndpointContext;
  +
   public class ServletEndpointContextImpl implements ServletEndpointContext {
       
       public HttpSession getHttpSession() {
  -        javax.servlet.http.HttpServletRequest srvreq =
  -            (javax.servlet.http.HttpServletRequest) 
  +        HttpServletRequest srvreq = (HttpServletRequest) 
                   getMessageContext().getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);
           return (srvreq == null)  ? null : srvreq.getSession();
       }
  @@ -74,15 +76,13 @@
       }
   
       public ServletContext getServletContext() {
  -        javax.servlet.http.HttpServlet srv =
  -            (javax.servlet.http.HttpServlet)
  +        HttpServlet srv = (HttpServlet)
                   getMessageContext().getProperty(HTTPConstants.MC_HTTP_SERVLET);
           return (srv == null) ? null : srv.getServletContext();
       }
   
       public Principal getUserPrincipal() {
  -        javax.servlet.http.HttpServletRequest srvreq =
  -            (javax.servlet.http.HttpServletRequest)
  +        HttpServletRequest srvreq = (HttpServletRequest)
                   getMessageContext().getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);
   
           return (srvreq == null) ? null : srvreq.getUserPrincipal();
  
  
  
  1.83      +29 -33    xml-axis/java/src/org/apache/axis/providers/java/JavaProvider.java
  
  Index: JavaProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/providers/java/JavaProvider.java,v
  retrieving revision 1.82
  retrieving revision 1.83
  diff -u -r1.82 -r1.83
  --- JavaProvider.java	25 Sep 2002 21:28:59 -0000	1.82
  +++ JavaProvider.java	26 Sep 2002 16:43:55 -0000	1.83
  @@ -251,46 +251,42 @@
                   null, null);
           }
   
  -        try {
  -            IntHolder scope   = new IntHolder();
  -            Object obj        = getServiceObject(msgContext,
  -                                                 service,
  -                                                 clsName,
  -                                                 scope);
  +        IntHolder scope   = new IntHolder();
  +        Object serviceObject = null;
   
  -            try {
  -                Message        reqMsg  = msgContext.getRequestMessage();
  -                SOAPEnvelope   reqEnv  = (SOAPEnvelope)reqMsg.getSOAPEnvelope();
  -                Message        resMsg  = msgContext.getResponseMessage();
  -                SOAPEnvelope   resEnv  = (resMsg == null) ?
  -                                         new SOAPEnvelope(msgContext.
  -                                                            getSOAPConstants()) :
  -                                         (SOAPEnvelope)resMsg.getSOAPEnvelope();
  -    
  -                // If we didn't have a response message, make sure we set one up
  -                if (resMsg == null) {
  -                    resMsg = new Message(resEnv);
  -                    msgContext.setResponseMessage( resMsg );
  -                }
  +        try {
  +            serviceObject = getServiceObject(msgContext, service, clsName, scope);
       
  -                try {
  -                    processMessage(msgContext, reqEnv,
  -                                   resEnv, obj);
  -                } catch (Exception exp) {
  -                    throw exp;
  -                }
  -            } finally {
  -                // If this is a request scoped service object which implements
  -                // ServiceLifecycle, let it know that it's being destroyed now.
  -                if (scope.value == Scope.REQUEST.getValue() &&
  -                        obj instanceof ServiceLifecycle) {
  -                    ((ServiceLifecycle)obj).destroy();
  -                }
  +            Message        resMsg  = msgContext.getResponseMessage();
  +            SOAPEnvelope   resEnv;
  +
  +            // If we didn't have a response message, make sure we set one up
  +            if (resMsg == null) {
  +                resEnv  = new SOAPEnvelope(msgContext.getSOAPConstants());
  +
  +                resMsg = new Message(resEnv);
  +                msgContext.setResponseMessage( resMsg );
  +            } else {
  +                resEnv  = (SOAPEnvelope)resMsg.getSOAPEnvelope();
               }
  +
  +            Message        reqMsg  = msgContext.getRequestMessage();
  +            SOAPEnvelope   reqEnv  = (SOAPEnvelope)reqMsg.getSOAPEnvelope();
  +
  +            processMessage(msgContext, reqEnv, resEnv, serviceObject);
           }
           catch( Exception exp ) {
               entLog.debug( Messages.getMessage("toAxisFault00"), exp);
               throw AxisFault.makeFault(exp);
  +        } finally {
  +            // If this is a request scoped service object which implements
  +            // ServiceLifecycle, let it know that it's being destroyed now.
  +            if (serviceObject != null  &&
  +                scope.value == Scope.REQUEST.getValue() &&
  +                serviceObject instanceof ServiceLifecycle)
  +            {
  +                ((ServiceLifecycle)serviceObject).destroy();
  +            }
           }
   
           if (log.isDebugEnabled())
  
  
  

Mime
View raw message