Author: thomas.diesler(a)jboss.com
Date: 2007-05-03 07:47:53 -0400 (Thu, 03 May 2007)
New Revision: 2953
Removed:
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/server/PropertyCallback.java
Modified:
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/ClientHandler.java
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/SessionCreatingServlet.java
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/TestEndpointImpl.java
Log:
Remove support for "javax.xml.ws.servlet.session" message context property.
Fix JBWS-1619 ClientHandler
Modified:
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java
===================================================================
---
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java 2007-05-03
08:21:10 UTC (rev 2952)
+++
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java 2007-05-03
11:47:53 UTC (rev 2953)
@@ -34,7 +34,6 @@
import org.jboss.logging.Logger;
import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.server.PropertyCallback;
import org.jboss.ws.extensions.xop.XOPContext;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
@@ -376,11 +375,7 @@
public Object getValue()
{
- Object realValue = value;
- if (value instanceof PropertyCallback)
- realValue = ((PropertyCallback)value).get();
-
- return realValue;
+ return value;
}
public String toString()
Modified:
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java
===================================================================
---
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java 2007-05-03
08:21:10 UTC (rev 2952)
+++
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java 2007-05-03
11:47:53 UTC (rev 2953)
@@ -28,7 +28,6 @@
import java.util.Map;
import javax.xml.rpc.handler.MessageContext;
-import javax.xml.soap.SOAPMessage;
import org.jboss.logging.Logger;
import org.jboss.ws.core.CommonMessageContext;
@@ -56,7 +55,6 @@
public static final String SERVLET_CONTEXT =
"javax.xml.ws.servlet.context";
public static final String SERVLET_REQUEST =
"javax.xml.ws.servlet.request";
public static final String SERVLET_RESPONSE =
"javax.xml.ws.servlet.response";
- public static final String SERVLET_SESSION =
"javax.xml.ws.servlet.session";
public MessageContextJAXRPC()
{
Deleted:
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/server/PropertyCallback.java
===================================================================
---
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/server/PropertyCallback.java 2007-05-03
08:21:10 UTC (rev 2952)
+++
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/server/PropertyCallback.java 2007-05-03
11:47:53 UTC (rev 2953)
@@ -1,39 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.core.server;
-
-/**
- * Interface to be implemented by property helpers to assist the retrieval
- * of objects added to the property context.
- *
- * If an instance of MessageContextPropertyHelper is added to the
- * CommonMessageContext a call to get for the same property will return
- * the result of callig get on the helper instead of returning the helper
- * itself.
- *
- * @author darran.lofthouse(a)jboss.com
- * @since Oct 22, 2006
- */
-public interface PropertyCallback
-{
- Object get();
-}
Modified:
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java
===================================================================
---
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2007-05-03
08:21:10 UTC (rev 2952)
+++
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2007-05-03
11:47:53 UTC (rev 2953)
@@ -412,7 +412,6 @@
HttpServletRequest httpRequest = context.getHttpServletRequest();
HttpServletResponse httpResponse = context.getHttpServletResponse();
ServletHeaderSource headerSource = new ServletHeaderSource(httpRequest,
httpResponse);
- HttpSessionPropertyCallback httpSession = new
HttpSessionPropertyCallback(context);
// Associate a message context with the current thread
CommonMessageContext msgContext;
@@ -422,7 +421,6 @@
msgContext.put(MessageContextJAXRPC.SERVLET_CONTEXT, servletContext);
msgContext.put(MessageContextJAXRPC.SERVLET_REQUEST, httpRequest);
msgContext.put(MessageContextJAXRPC.SERVLET_RESPONSE, httpResponse);
- msgContext.put(MessageContextJAXRPC.SERVLET_SESSION, httpSession);
}
else
{
@@ -714,19 +712,4 @@
}
return server;
}
-
- public static class HttpSessionPropertyCallback implements PropertyCallback
- {
- private EndpointContext context;
-
- public HttpSessionPropertyCallback(final EndpointContext context)
- {
- this.context = context;
- }
-
- public Object get()
- {
- return context.getHttpSession();
- }
- }
}
Modified:
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java
===================================================================
---
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java 2007-05-03
08:21:10 UTC (rev 2952)
+++
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java 2007-05-03
11:47:53 UTC (rev 2953)
@@ -23,6 +23,7 @@
import java.rmi.RemoteException;
+import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.jboss.ws.core.CommonMessageContext;
@@ -45,7 +46,8 @@
public boolean canAccessSession() throws RemoteException
{
CommonMessageContext context = MessageContextAssociation.peekMessageContext();
- HttpSession session =
(HttpSession)context.get(MessageContextJAXRPC.SERVLET_SESSION);
+ HttpServletRequest request =
(HttpServletRequest)context.get(MessageContextJAXRPC.SERVLET_REQUEST);
+ HttpSession session = (HttpSession)request.getSession();
session.setAttribute("Test", "Test String");
String testString = (String)session.getAttribute("Test");
Modified:
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/ClientHandler.java
===================================================================
---
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/ClientHandler.java 2007-05-03
08:21:10 UTC (rev 2952)
+++
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/ClientHandler.java 2007-05-03
11:47:53 UTC (rev 2953)
@@ -53,17 +53,14 @@
try
{
- if ("Use MessageContext".equals(message))
- {
- SOAPMessageContext soapContext = (SOAPMessageContext)msgContext;
- MimeHeaders mimeHeaders = soapContext.getMessage().getMimeHeaders();
+ SOAPMessageContext soapContext = (SOAPMessageContext)msgContext;
+ MimeHeaders mimeHeaders = soapContext.getMessage().getMimeHeaders();
- String[] cookies = mimeHeaders.getHeader("Set-Cookie");
- if (cookies == null || cookies.length != 1)
- throw new IllegalStateException("Unexpected cookie list: " +
mimeHeaders);
+ String[] cookies = mimeHeaders.getHeader("Set-Cookie");
+ if (cookies == null || cookies.length != 1)
+ throw new IllegalStateException("Unexpected cookie list: " +
mimeHeaders);
- cookie = cookies[0];
- }
+ cookie = cookies[0];
}
catch (Exception e)
{
Modified:
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/SessionCreatingServlet.java
===================================================================
---
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/SessionCreatingServlet.java 2007-05-03
08:21:10 UTC (rev 2952)
+++
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/SessionCreatingServlet.java 2007-05-03
11:47:53 UTC (rev 2953)
@@ -54,8 +54,7 @@
private void process(HttpServletRequest httpServletRequest) throws IOException
{
HttpSession session = httpServletRequest.getSession();
- String msg = "Session id:" + session.getId();
- log.info(msg);
+ log.info("Session id: " + session.getId());
}
}
Modified:
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/TestEndpointImpl.java
===================================================================
---
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/TestEndpointImpl.java 2007-05-03
08:21:10 UTC (rev 2952)
+++
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/TestEndpointImpl.java 2007-05-03
11:47:53 UTC (rev 2953)
@@ -21,19 +21,21 @@
*/
package org.jboss.test.ws.jaxrpc.jbws1619;
-import org.jboss.logging.Logger;
+import java.rmi.RemoteException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.xml.rpc.ServiceException;
import javax.xml.rpc.handler.MessageContext;
import javax.xml.rpc.server.ServiceLifecycle;
import javax.xml.rpc.server.ServletEndpointContext;
-import java.rmi.RemoteException;
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.jaxrpc.handler.MessageContextJAXRPC;
+
public class TestEndpointImpl implements TestEndpoint, ServiceLifecycle
{
private Logger log = Logger.getLogger(TestEndpointImpl.class);
@@ -42,6 +44,8 @@
public String echoString(String message) throws RemoteException
{
+ log.info("echoString: " + message);
+
HttpSession httpSession = null;
if ("Use ServletEndpointContext".equals(message))
{
@@ -50,7 +54,8 @@
else if ("Use MessageContext".equals(message))
{
MessageContext msgContext = context.getMessageContext();
- httpSession =
(HttpSession)msgContext.getProperty("javax.xml.ws.servlet.session");
+ HttpServletRequest req =
(HttpServletRequest)msgContext.getProperty(MessageContextJAXRPC.SERVLET_REQUEST);
+ httpSession = req.getSession();
}
else if ("Use RequestDispatcher".equals(message))
{
@@ -59,8 +64,10 @@
RequestDispatcher dispatcher =
servletContext.getRequestDispatcher("/");
try
{
-
dispatcher.include((ServletRequest)msgContext.getProperty("javax.xml.ws.servlet.request"),
-
(ServletResponse)msgContext.getProperty("javax.xml.ws.servlet.response"));
+ HttpServletRequest req =
(HttpServletRequest)msgContext.getProperty(MessageContextJAXRPC.SERVLET_REQUEST);
+ HttpServletResponse res =
(HttpServletResponse)msgContext.getProperty(MessageContextJAXRPC.SERVLET_RESPONSE);
+ dispatcher.include(req, res);
+ httpSession = req.getSession(false);
}
catch (Exception e)
{
@@ -68,8 +75,10 @@
}
}
- log.info("echoString: " + httpSession);
- return "httpSession: " + httpSession;
+ String sessionID = (httpSession != null ? httpSession.getId() : null);
+ log.info("sessionID: " + sessionID);
+
+ return "httpSession: " + sessionID;
}
public void init(Object context) throws ServiceException