[jboss-svn-commits] JBoss Portal SVN: r5195 - in branches/JBoss_Portal_Branch_2_4/wsrp: . src/main/org/jboss/portal/test/wsrp/v1/producer src/main/org/jboss/portal/wsrp/handler src/main/org/jboss/portal/wsrp/invocation src/main/org/jboss/portal/wsrp/producer src/resources/portal-wsrp-client-jar/META-INF src/resources/test-wsrp-producer-client/META-INF
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Sep 13 17:51:45 EDT 2006
Author: chris.laprun at jboss.com
Date: 2006-09-13 17:51:39 -0400 (Wed, 13 Sep 2006)
New Revision: 5195
Modified:
branches/JBoss_Portal_Branch_2_4/wsrp/build.xml
branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java
branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/NeedPortletHandleTest.java
branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/handler/RequestHeaderClientHandler.java
branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPActionContext.java
branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPInvocationContext.java
branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPRenderContext.java
branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPRequestContext.java
branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java
branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
branches/JBoss_Portal_Branch_2_4/wsrp/src/resources/portal-wsrp-client-jar/META-INF/application-client.xml
branches/JBoss_Portal_Branch_2_4/wsrp/src/resources/test-wsrp-producer-client/META-INF/application-client.xml
Log:
- Preliminary work for JBPORTAL-1023. Still needs cleaning up and more testing.
- Now uses cookies to deal with sessions instead of SessionContext.
- Adapted tests in consequence.
- Removed testInitCookie (since we didn't implement it) and testReleaseSessions (broken by new session handling).
- Removed extra cookie setting in WSRPProducerImpl left over from former tests.
- Re-added RequestHeaderClientHandler for WS clients.
Modified: branches/JBoss_Portal_Branch_2_4/wsrp/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_4/wsrp/build.xml 2006-09-13 20:09:38 UTC (rev 5194)
+++ branches/JBoss_Portal_Branch_2_4/wsrp/build.xml 2006-09-13 21:51:39 UTC (rev 5195)
@@ -458,10 +458,10 @@
<target name="tests-local" depends="clean, output, clean-test">
<server:start name="default"/>
<antcall target="agent-deploy"/>
- <!--<antcall target="producer-test"/>-->
- <!--<antcall target="consumer-test"/>-->
+ <antcall target="producer-test"/>
+ <antcall target="consumer-test"/>
<antcall target="deployment-test"/>
- <!--<antcall target="other-test"/>-->
+ <antcall target="other-test"/>
<antcall target="agent-undeploy"/>
<server:stop name="default"/>
<antcall target="reports"/>
Modified: branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java 2006-09-13 20:09:38 UTC (rev 5194)
+++ branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java 2006-09-13 21:51:39 UTC (rev 5195)
@@ -25,27 +25,25 @@
import org.jboss.portal.wsrp.WSRPActionURL;
import org.jboss.portal.wsrp.WSRPConstants;
import org.jboss.portal.wsrp.WSRPPortletURL;
-import org.jboss.portal.wsrp.WSRPProducer;
import org.jboss.portal.wsrp.WSRPRenderURL;
import org.jboss.portal.wsrp.WSRPTypeFactory;
+import org.jboss.portal.wsrp.consumer.ProducerSessionInformation;
import org.jboss.portal.wsrp.core.BlockingInteractionResponse;
import org.jboss.portal.wsrp.core.CacheControl;
import org.jboss.portal.wsrp.core.GetMarkup;
-import org.jboss.portal.wsrp.core.InitCookie;
import org.jboss.portal.wsrp.core.InteractionParams;
-import org.jboss.portal.wsrp.core.InvalidSessionFault;
+import org.jboss.portal.wsrp.core.InvalidRegistrationFault;
import org.jboss.portal.wsrp.core.MarkupContext;
import org.jboss.portal.wsrp.core.MarkupResponse;
-import org.jboss.portal.wsrp.core.MissingParametersFault;
import org.jboss.portal.wsrp.core.NamedString;
+import org.jboss.portal.wsrp.core.OperationFailedFault;
import org.jboss.portal.wsrp.core.PerformBlockingInteraction;
-import org.jboss.portal.wsrp.core.RegistrationContext;
-import org.jboss.portal.wsrp.core.ReleaseSessions;
-import org.jboss.portal.wsrp.core.RuntimeContext;
-import org.jboss.portal.wsrp.core.SessionContext;
import org.jboss.portal.wsrp.core.UnsupportedModeFault;
import org.jboss.portal.wsrp.core.UpdateResponse;
+import org.jboss.portal.wsrp.handler.RequestHeaderClientHandler;
+import java.rmi.RemoteException;
+
/**
* @author <a href="mailto:chris.laprun at jboss.com">Chris Laprun</a>
* @version $Revision$
@@ -148,7 +146,7 @@
return markupString.substring(urlStartIndex + 2, urlEndIndex);
}
- // fix-me: this test is not completely right...
+ // fix-me: add more tests
public void testGetMarkupSession() throws Exception
{
undeploy(DEFAULT_MARKUP_PORTLET_WAR);
@@ -160,17 +158,9 @@
MarkupResponse response = markupService.getMarkup(getMarkup);
- String sessionID = checkMarkupResponseWithSession(response, 0);
+ checkMarkupResponseWithSession(response, 0);
- // fix-me: try to get markup again without using the provided session id: a new one should be issued => is this true?
response = markupService.getMarkup(getMarkup);
- String newSessionID = response.getSessionContext().getSessionID();
- assertFalse(sessionID.equals(newSessionID));
-
- RuntimeContext runtimeContext = WSRPTypeFactory.createRuntimeContext(WSRPConstants.NONE_USER_AUTHENTICATION);
- runtimeContext.setSessionID(sessionID);
- getMarkup.setRuntimeContext(runtimeContext);
- response = markupService.getMarkup(getMarkup);
checkMarkupResponseWithSession(response, 1);
// fix-me: try to reuse the old session id: what should happen?
@@ -190,7 +180,7 @@
undeploy(sessionPortletArchive);
}
- private String checkMarkupResponseWithSession(MarkupResponse response, int count)
+ private void checkMarkupResponseWithSession(MarkupResponse response, int count) throws RemoteException, InvalidRegistrationFault, OperationFailedFault
{
assertNotNull(response);
@@ -200,13 +190,10 @@
assertEquals("<p>" + count + "</p><div><a href=\"wsrp_rewrite?wsrp-urlType=render" +
"&wsrp-navigationalState=JBPNS_/wsrp_rewrite\">render</a></div>", markupContext.getMarkupString());
- // Session context
- SessionContext sessionContext = response.getSessionContext();
- assertNotNull(sessionContext);
- String sessionID = sessionContext.getSessionID();
- assertNotNull(sessionID);
- assertEquals(WSRPProducer.DEFAULT_SESSION_EXPIRATION_TIME, sessionContext.getExpires());
- return sessionID;
+ // checking session
+ ProducerSessionInformation sessionInfo = RequestHeaderClientHandler.getCurrentProducerSessionInformation();
+ assertNotNull(sessionInfo);
+ assertTrue(sessionInfo.getUserCookie().lastIndexOf("JSESSIONID") != -1);
}
public void testPerformBlockingInteractionNoRedirect() throws Exception
@@ -299,25 +286,12 @@
undeploy(sessionPortletArchive);
}
- public void testInitCookie() throws Exception
+ /*public void testReleaseSessions() throws Exception
{
- InitCookie initCookie = new InitCookie();
- producer.initCookie(initCookie);
-
- // initCookie must send Set-Cookie header at the HTTP transport level
- // fix-me: find a way to access response
-// HttpServletResponse response = ServletAccess.getResponse("testInitCookie");
-// assertTrue(response.containsHeader("Set-Cookie"));
- }
-
- public void testReleaseSessions() throws Exception
- {
undeploy(DEFAULT_MARKUP_PORTLET_WAR);
String sessionPortletArchive = "test-session-portlet.war";
deploy(sessionPortletArchive);
- // need to get the handle before we init the registration otherwise we won't get any offered portlets!
- String handle = getHandleForPortletDeployedIn(sessionPortletArchive);
initRegistrationInfo();
RegistrationContext rc = registerConsumer();
@@ -354,7 +328,7 @@
undeploy(sessionPortletArchive);
resetRegistrationInfo();
- }
+ }*/
public void testGetMarkupWithDispatcherPortlet() throws Exception
{
Modified: branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/NeedPortletHandleTest.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/NeedPortletHandleTest.java 2006-09-13 20:09:38 UTC (rev 5194)
+++ branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/NeedPortletHandleTest.java 2006-09-13 21:51:39 UTC (rev 5195)
@@ -43,6 +43,7 @@
{
private String portletWARFileName;
private Map warFileName2handle = new HashMap();
+ private String currentlyDeployedArchiveName;
public NeedPortletHandleTest(String portletWARFileName)
throws Exception
@@ -75,6 +76,11 @@
return getHandleForPortletDeployedIn(null);
}
+ protected String getHandleForCurrentlyDeployedArchive() throws RemoteException, InvalidRegistrationFault, OperationFailedFault
+ {
+ return getHandleForPortletDeployedIn(currentlyDeployedArchiveName);
+ }
+
/**
* Each time we deploy a new archive, check to see if the service description has changed and add any new portlet
* handles found.
@@ -85,6 +91,7 @@
protected void deploy(String archiveName) throws Exception
{
super.deploy(archiveName);
+ currentlyDeployedArchiveName = archiveName;
GetServiceDescription getServiceDescription = WSRPTypeFactory.createGetServiceDescription();
ServiceDescription serviceDescription = serviceDescriptionService.getServiceDescription(getServiceDescription);
PortletDescription[] offered = serviceDescription.getOfferedPortlets();
@@ -128,6 +135,7 @@
{
warFileName2handle.remove(archiveName);
}
+ currentlyDeployedArchiveName = null;
// printMappings("undeploy");
}
Modified: branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/handler/RequestHeaderClientHandler.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/handler/RequestHeaderClientHandler.java 2006-09-13 20:09:38 UTC (rev 5194)
+++ branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/handler/RequestHeaderClientHandler.java 2006-09-13 21:51:39 UTC (rev 5195)
@@ -29,7 +29,6 @@
import javax.xml.namespace.QName;
import javax.xml.rpc.Stub;
import javax.xml.rpc.handler.GenericHandler;
-import javax.xml.rpc.handler.HandlerInfo;
import javax.xml.rpc.handler.MessageContext;
import javax.xml.rpc.handler.soap.SOAPMessageContext;
import javax.xml.soap.MimeHeaders;
@@ -115,7 +114,14 @@
{
if (cookieValues.length > 1)
{
- throw new IllegalArgumentException("Too many cookieValues headers!");
+ StringBuffer sb = new StringBuffer(128);
+ sb.append("Cookie headers:\n");
+ for (int i = 0; i < cookieValues.length; i++)
+ {
+ sb.append("\t").append(i).append(":\t").append(cookieValues[i]).append("\n");
+
+ }
+ throw new IllegalArgumentException("Too many cookie headers!\n" + sb.toString());
}
Cookie[] cookies = extractCookies((String)msgContext.getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY), cookieValues);
@@ -165,10 +171,10 @@
{
String host = hostURL.getHost();
int port = hostURL.getPort();
- if(port == -1)
+ if (port == -1)
{
port = 80; // if the port is not set in the endpoint address, assume it's 80.
- }
+ }
String path = hostURL.getPath();
boolean secure = hostURL.getProtocol().endsWith("s"); // todo: is that correct?
Modified: branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPActionContext.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPActionContext.java 2006-09-13 20:09:38 UTC (rev 5194)
+++ branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPActionContext.java 2006-09-13 21:51:39 UTC (rev 5195)
@@ -24,8 +24,8 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
-import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.Parameters;
+import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.spi.ActionContext;
import org.jboss.portal.portlet.spi.InstanceContext;
import org.jboss.portal.portlet.spi.PortalContext;
@@ -54,13 +54,12 @@
private String contentType;
private StateString interactionState;
- public WSRPActionContext(String sessionId, StateString navigationalState,
- SecurityContext securityContext, HTTPStreamInfo streamInfo, PortalContext portalContext,
- UserContext userContext, InstanceContext instanceContext, WindowContext windowContext,
- StateString interactionState, Mode mode, WindowState windowState,
+ public WSRPActionContext(StateString navigationalState, SecurityContext securityContext, HTTPStreamInfo streamInfo,
+ PortalContext portalContext, UserContext userContext, InstanceContext instanceContext,
+ WindowContext windowContext, StateString interactionState, Mode mode, WindowState windowState,
Parameters formParameters, String characterEncoding, String contentType)
{
- super(sessionId, navigationalState, securityContext, streamInfo, portalContext, userContext, instanceContext,
+ super(navigationalState, securityContext, streamInfo, portalContext, userContext, instanceContext,
windowContext, mode, windowState);
this.formParameters = formParameters;
this.request = ServletAccess.getRequest();
Modified: branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPInvocationContext.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPInvocationContext.java 2006-09-13 20:09:38 UTC (rev 5194)
+++ branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPInvocationContext.java 2006-09-13 21:51:39 UTC (rev 5195)
@@ -24,9 +24,9 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.portlet.PortletURL;
+import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.impl.spi.AbstractInvocationContext;
import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.spi.InstanceContext;
import org.jboss.portal.portlet.spi.InvocationContext;
import org.jboss.portal.portlet.spi.PortalContext;
@@ -61,7 +61,7 @@
private Mode mode;
private WindowContext windowContext;
- public WSRPInvocationContext(String sessionId, StateString navigationalState, SecurityContext securityContext,
+ public WSRPInvocationContext(StateString navigationalState, SecurityContext securityContext,
HTTPStreamInfo streamInfo, PortalContext portalContext, UserContext userContext,
InstanceContext instanceContext, WindowContext windowContext, Mode mode, WindowState windowState)
{
@@ -72,7 +72,7 @@
this.userContext = userContext;
this.instanceContext = instanceContext;
this.windowContext = windowContext;
- this.requestContext = new WSRPRequestContext(sessionId);
+ this.requestContext = new WSRPRequestContext();
this.mode = mode;
this.windowState = windowState;
}
Modified: branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPRenderContext.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPRenderContext.java 2006-09-13 20:09:38 UTC (rev 5194)
+++ branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPRenderContext.java 2006-09-13 21:51:39 UTC (rev 5195)
@@ -39,11 +39,11 @@
public class WSRPRenderContext extends WSRPInvocationContext implements RenderContext
{
- public WSRPRenderContext(String sessionId, StateString navigationalState, SecurityContext securityContext,
+ public WSRPRenderContext(StateString navigationalState, SecurityContext securityContext,
HTTPStreamInfo streamInfo, PortalContext portalContext, UserContext userContext,
InstanceContext instanceContext, WindowContext windowContext, Mode mode, WindowState windowState)
{
- super(sessionId, navigationalState, securityContext, streamInfo, portalContext, userContext, instanceContext,
+ super(navigationalState, securityContext, streamInfo, portalContext, userContext, instanceContext,
windowContext, mode, windowState);
}
}
Modified: branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPRequestContext.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPRequestContext.java 2006-09-13 20:09:38 UTC (rev 5194)
+++ branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPRequestContext.java 2006-09-13 21:51:39 UTC (rev 5195)
@@ -21,56 +21,18 @@
*/
package org.jboss.portal.wsrp.invocation;
-import org.jboss.portal.portlet.spi.RequestContext;
import org.jboss.portal.portlet.impl.spi.AbstractRequestContext;
-import org.jboss.portal.server.servlet.ProxyRequest;
-import org.jboss.portal.server.servlet.ProxyResponse;
+import org.jboss.portal.portlet.spi.RequestContext;
import org.jboss.portal.wsrp.servlet.ServletAccess;
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletException;
-import java.io.IOException;
-
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
* @version $Revision$
*/
public class WSRPRequestContext extends AbstractRequestContext implements RequestContext
{
-
- /** The session id to force. */
- private String sessionId;
-
- public WSRPRequestContext(String sessionId)
+ public WSRPRequestContext()
{
super(ServletAccess.getRequest(), ServletAccess.getResponse());
- this.sessionId = sessionId;
}
-
- public String getScheme()
- {
- return null;
- }
-
- public String getServerName()
- {
- return null;
- }
-
- public int getServerPort()
- {
- return 0;
- }
-
- public String getContextPath()
- {
- return null;
- }
-
- public void include(RequestDispatcher rd) throws IOException, ServletException
- {
- ProxyRequest preq = new ProxyRequest(getClientRequest(), sessionId);
- ProxyResponse presp = new ProxyResponse(getClientResponse());
- rd.include(preq, presp);
- }
}
Modified: branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java 2006-09-13 20:09:38 UTC (rev 5194)
+++ branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java 2006-09-13 21:51:39 UTC (rev 5195)
@@ -51,7 +51,6 @@
import org.jboss.portal.server.util.HTTPStreamInfo;
import org.jboss.portal.wsrp.UserContextConverter;
import org.jboss.portal.wsrp.WSRPConstants;
-import org.jboss.portal.wsrp.WSRPProducer;
import org.jboss.portal.wsrp.WSRPRewritingConstants;
import org.jboss.portal.wsrp.WSRPTypeFactory;
import org.jboss.portal.wsrp.WSRPUtils;
@@ -81,7 +80,6 @@
import org.jboss.portal.wsrp.core.ReleaseSessions;
import org.jboss.portal.wsrp.core.ReturnAny;
import org.jboss.portal.wsrp.core.RuntimeContext;
-import org.jboss.portal.wsrp.core.SessionContext;
import org.jboss.portal.wsrp.core.StateChange;
import org.jboss.portal.wsrp.core.UnsupportedLocaleFault;
import org.jboss.portal.wsrp.core.UnsupportedMimeTypeFault;
@@ -97,7 +95,6 @@
import javax.activation.MimeTypeParseException;
import javax.portlet.PortletModeException;
import javax.portlet.WindowStateException;
-import javax.servlet.http.HttpSession;
import java.rmi.RemoteException;
import java.security.Principal;
import java.util.Arrays;
@@ -144,7 +141,6 @@
// get session information and deal with it
final RuntimeContext runtimeContext = getMarkup.getRuntimeContext();
WSRPUtils.throwMissingParametersFaultIfValueIsMissing(runtimeContext, "RuntimeContext", GET_MARKUP);
- String sessionId = checkSessionId(runtimeContext);
// get markup parameters
final MarkupParams params = getMarkup.getMarkupParams();
@@ -189,7 +185,7 @@
WindowContext windowContext = createWindowContext(runtimeContext);
// prepare the invocation
- WSRPRenderContext renderContext = new WSRPRenderContext(sessionId, navigationalState, securityContext, streamInfo,
+ WSRPRenderContext renderContext = new WSRPRenderContext(navigationalState, securityContext, streamInfo,
portalContext, userContext, instanceContext, windowContext,
WSRPUtils.getJSR168PortletModeFromWSRPName(markupRequest.getMode()),
WSRPUtils.getJSR168WindowStateFromWSRPName(markupRequest.getWindowState()));
@@ -250,14 +246,7 @@
}
}
- sessionId = (String)render.getAttribute(WSRPProducer.SESSION_ID_ATTRIBUTE);
- SessionContext sessionContext = null;
- if (sessionId != null)
- {
- sessionContext = WSRPTypeFactory.createSessionContext(sessionId, producer.getSessionExpirationTime());
- producer.addSession((HttpSession)render.getAttribute(WSRPProducer.SESSION_ATTRIBUTE));
- }
- return new MarkupResponse(markupContext, sessionContext, null);
+ return new MarkupResponse(markupContext, null, null);
}
/**
@@ -304,7 +293,6 @@
RuntimeContext runtimeContext = performBlockingInteraction.getRuntimeContext();
WSRPUtils.throwMissingParametersFaultIfValueIsMissing(runtimeContext, "RuntimeContext", PBI);
- String sessionID = checkSessionId(runtimeContext);
org.jboss.portal.wsrp.core.UserContext wsrpUserContext = performBlockingInteraction.getUserContext();
checkUserContext(wsrpUserContext);
@@ -383,7 +371,7 @@
StateString interactionState = createNavigationalState(interactionParams.getInteractionState());
- WSRPActionContext context = new WSRPActionContext(sessionID, navigationalState, securityContext, streamInfo,
+ WSRPActionContext context = new WSRPActionContext(navigationalState, securityContext, streamInfo,
portalContext, userContext, instanceContext, windowContext,
interactionState, WSRPUtils.getJSR168PortletModeFromWSRPName(markupRequest.getMode()),
WSRPUtils.getJSR168WindowStateFromWSRPName(markupRequest.getWindowState()), parameters,
Modified: branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2006-09-13 20:09:38 UTC (rev 5194)
+++ branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2006-09-13 21:51:39 UTC (rev 5195)
@@ -25,10 +25,10 @@
import org.jboss.invocation.Invocation;
import org.jboss.logging.Logger;
import org.jboss.portal.common.system.AbstractJBossService;
+import org.jboss.portal.portlet.NoSuchPortletException;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.NoSuchPortletException;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.wsrp.ResponseDebugFactory;
import org.jboss.portal.wsrp.WSRPProducer;
@@ -77,8 +77,6 @@
import org.jboss.portal.wsrp.core.UnsupportedWindowStateFault;
import org.jboss.portal.wsrp.servlet.ServletAccess;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.lang.reflect.Method;
import java.rmi.RemoteException;
@@ -95,34 +93,22 @@
*/
public class WSRPProducerImpl extends AbstractJBossService implements WSRPProducer
{
- /**
- * logger used for logging ;)
- */
+ /** logger used for logging ;) */
private final Logger log = Logger.getLogger(getClass());
- /**
- * The invoker used to retrieve portlet information and invoke methods.
- */
+ /** The invoker used to retrieve portlet information and invoke methods. */
private PortletInvoker invoker;
- /**
- * Handles Markup interface calls.
- */
+ /** Handles Markup interface calls. */
private MarkupHandler markupHandler;
- /**
- * Handles ServiceDescription interface calls.
- */
+ /** Handles ServiceDescription interface calls. */
private ServiceDescriptionHandler serviceDescriptionHandler;
- /**
- * Handles Registration interface calls.
- */
+ /** Handles Registration interface calls. */
private RegistrationHandler registrationHandler;
- /**
- * Handles Portlet Management interface calls.
- */
+ /** Handles Portlet Management interface calls. */
private PortletManagementHandler portletManagementHandler;
/**
@@ -144,19 +130,13 @@
private CookieProtocol requiresInitCookie = CookieProtocol.none;
- /**
- * Supported locales.
- */
+ /** Supported locales. */
private String[] supportedLocales = new String[]{"en", "en-US"};
- /**
- * Required registration information to be provided by consumers to access this Producer's information and services.
- */
+ /** Required registration information to be provided by consumers to access this Producer's information and services. */
private ModelDescription requiredRegistrationInfo;
- /**
- * Manages the sessions.
- */
+ /** Manages the sessions. */
private SessionManager sessionManager;
public WSRPProducerImpl()
@@ -194,9 +174,6 @@
}
}
- HttpServletResponse resp = ServletAccess.getResponse();
- resp.addCookie(new Cookie("myresponsecookie", "myresponsecookievalue"));
-
return sd;
}
@@ -351,6 +328,11 @@
sessionManager.addSession(session);
}
+ HttpSession getSession()
+ {
+ return ServletAccess.getRequest().getSession(false);
+ }
+
public void releaseSession(String sessionID) throws IllegalStateException
{
sessionManager.invalidateSession(sessionID);
@@ -435,9 +417,7 @@
// Contract with Invoker implementation *****************************************************************************
- /**
- * Dispatch the invocation to the target by reflection
- */
+ /** Dispatch the invocation to the target by reflection */
public Object invoke(Invocation invocation) throws Exception
{
log.debug("invoke() invoked");
Modified: branches/JBoss_Portal_Branch_2_4/wsrp/src/resources/portal-wsrp-client-jar/META-INF/application-client.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_4/wsrp/src/resources/portal-wsrp-client-jar/META-INF/application-client.xml 2006-09-13 20:09:38 UTC (rev 5194)
+++ branches/JBoss_Portal_Branch_2_4/wsrp/src/resources/portal-wsrp-client-jar/META-INF/application-client.xml 2006-09-13 21:51:39 UTC (rev 5195)
@@ -26,10 +26,10 @@
<param-value>true</param-value>
</init-param>
</handler>
- <!--<handler>
+ <handler>
<handler-name>RequestHeaderHandler</handler-name>
<handler-class>org.jboss.portal.wsrp.handler.RequestHeaderClientHandler</handler-class>
- </handler>-->
+ </handler>
</service-ref>
<service-ref>
@@ -82,10 +82,10 @@
<param-value>true</param-value>
</init-param>
</handler>
- <!--<handler>
+ <handler>
<handler-name>RequestHeaderHandler</handler-name>
<handler-class>org.jboss.portal.wsrp.handler.RequestHeaderClientHandler</handler-class>
- </handler>-->
+ </handler>
</service-ref>
<service-ref>
@@ -110,9 +110,9 @@
<param-value>true</param-value>
</init-param>
</handler>
- <!--<handler>
+ <handler>
<handler-name>RequestHeaderHandler</handler-name>
<handler-class>org.jboss.portal.wsrp.handler.RequestHeaderClientHandler</handler-class>
- </handler>-->
+ </handler>
</service-ref>
</application-client>
Modified: branches/JBoss_Portal_Branch_2_4/wsrp/src/resources/test-wsrp-producer-client/META-INF/application-client.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_4/wsrp/src/resources/test-wsrp-producer-client/META-INF/application-client.xml 2006-09-13 20:09:38 UTC (rev 5194)
+++ branches/JBoss_Portal_Branch_2_4/wsrp/src/resources/test-wsrp-producer-client/META-INF/application-client.xml 2006-09-13 21:51:39 UTC (rev 5195)
@@ -14,6 +14,10 @@
<port-component-ref>
<service-endpoint-interface>org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType</service-endpoint-interface>
</port-component-ref>
+ <handler>
+ <handler-name>RequestHeaderHandler</handler-name>
+ <handler-class>org.jboss.portal.wsrp.handler.RequestHeaderClientHandler</handler-class>
+ </handler>
</service-ref>
<service-ref>
@@ -24,6 +28,10 @@
<port-component-ref>
<service-endpoint-interface>org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType</service-endpoint-interface>
</port-component-ref>
+ <handler>
+ <handler-name>RequestHeaderHandler</handler-name>
+ <handler-class>org.jboss.portal.wsrp.handler.RequestHeaderClientHandler</handler-class>
+ </handler>
</service-ref>
<service-ref>
@@ -34,6 +42,10 @@
<port-component-ref>
<service-endpoint-interface>org.jboss.portal.wsrp.core.WSRP_v1_Registration_PortType</service-endpoint-interface>
</port-component-ref>
+ <handler>
+ <handler-name>RequestHeaderHandler</handler-name>
+ <handler-class>org.jboss.portal.wsrp.handler.RequestHeaderClientHandler</handler-class>
+ </handler>
</service-ref>
<service-ref>
@@ -44,5 +56,9 @@
<port-component-ref>
<service-endpoint-interface>org.jboss.portal.wsrp.core.WSRP_v1_PortletManagement_PortType</service-endpoint-interface>
</port-component-ref>
+ <handler>
+ <handler-name>RequestHeaderHandler</handler-name>
+ <handler-class>org.jboss.portal.wsrp.handler.RequestHeaderClientHandler</handler-class>
+ </handler>
</service-ref>
</application-client>
More information about the jboss-svn-commits
mailing list