Author: julien(a)jboss.com
Date: 2008-01-21 08:25:38 -0500 (Mon, 21 Jan 2008)
New Revision: 9545
Added:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractServerContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/ServerContext.java
Removed:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractRequestContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/RequestContext.java
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInvocation.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletController.java
Log:
- renamed RequestContext to ServerContext as it is more suitable (and I am going to use
RequestContext for a more suitable other purpose)
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java 2008-01-21
09:18:51 UTC (rev 9544)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java 2008-01-21
13:25:38 UTC (rev 9545)
@@ -31,7 +31,7 @@
import org.jboss.portal.web.ServletContainerFactory;
import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.spi.RequestContext;
+import org.jboss.portal.portlet.spi.ServerContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -68,7 +68,7 @@
{
PortletContainer container =
(PortletContainer)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE,
PortletContainerInvoker.PORTLET_CONTAINER);
PortletApplication portletApplication = container.getApplication();
- RequestContext reqCtx = invocation.getRequestContext();
+ ServerContext reqCtx = invocation.getServerContext();
ServletContext targetCtx = portletApplication.getContext().getServletContext();
ServletContainer servletContainer = servletContainerFactory.getServletContainer();
try
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java 2008-01-21
09:18:51 UTC (rev 9544)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java 2008-01-21
13:25:38 UTC (rev 9545)
@@ -37,7 +37,7 @@
import org.jboss.portal.portlet.impl.info.ContainerNavigationInfo;
import org.jboss.portal.portlet.impl.info.ContainerPortletInfo;
import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.spi.RequestContext;
+import org.jboss.portal.portlet.spi.ServerContext;
import org.jboss.portal.portlet.spi.SecurityContext;
import org.jboss.portal.portlet.spi.UserContext;
import org.jboss.portal.portlet.spi.WindowContext;
@@ -79,7 +79,7 @@
protected PortletInvocation invocation;
protected UserContext userContext;
protected SecurityContext securityContext;
- protected RequestContext requestContext;
+ protected ServerContext serverContext;
protected WindowContext windowContext;
protected PortletPreferences preferences;
protected PortletContainerImpl container;
@@ -110,7 +110,7 @@
this.invocation = invocation;
this.userContext = userContext;
this.securityContext = invocation.getSecurityContext();
- this.requestContext = invocation.getRequestContext();
+ this.serverContext = invocation.getServerContext();
this.windowContext = invocation.getWindowContext();
this.container = container;
this.dreq = invocation.getDispatchedRequest();
@@ -449,17 +449,17 @@
public String getScheme()
{
- return requestContext.getScheme();
+ return serverContext.getScheme();
}
public String getServerName()
{
- return requestContext.getServerName();
+ return serverContext.getServerName();
}
public int getServerPort()
{
- return requestContext.getServerPort();
+ return serverContext.getServerPort();
}
public PortletPreferences getPreferences()
Deleted:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractRequestContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractRequestContext.java 2008-01-21
09:18:51 UTC (rev 9544)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractRequestContext.java 2008-01-21
13:25:38 UTC (rev 9545)
@@ -1,83 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, 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.portal.portlet.impl.spi;
-
-import org.jboss.portal.portlet.spi.RequestContext;
-import org.jboss.portal.web.RequestDispatchCallback;
-import org.jboss.portal.web.ServletContainer;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.ServletContext;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 6929 $
- */
-public class AbstractRequestContext implements RequestContext
-{
-
- /** . */
- private HttpServletRequest req;
-
- /** . */
- private HttpServletResponse resp;
-
- /** . */
- private String scheme;
-
- /** . */
- private String serverName;
-
- /** . */
- private int serverPort;
-
- public AbstractRequestContext(HttpServletRequest req, HttpServletResponse resp)
- {
- this.req = req;
- this.resp = resp;
- this.scheme = req.getScheme();
- this.serverName = req.getServerName();
- this.serverPort = req.getServerPort();
- }
-
- public String getScheme()
- {
- return scheme;
- }
-
- public String getServerName()
- {
- return serverName;
- }
-
- public int getServerPort()
- {
- return serverPort;
- }
-
- public Object dispatch(ServletContainer servletContainer, ServletContext
targetServletContext, RequestDispatchCallback callback, Object handback) throws Exception
- {
- return servletContainer.include(targetServletContext, req, resp, callback,
handback);
- }
-}
Copied:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractServerContext.java
(from rev 9544,
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractRequestContext.java)
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractServerContext.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractServerContext.java 2008-01-21
13:25:38 UTC (rev 9545)
@@ -0,0 +1,71 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.portal.portlet.impl.spi;
+
+import org.jboss.portal.portlet.spi.ServerContext;
+import org.jboss.portal.web.RequestDispatchCallback;
+import org.jboss.portal.web.ServletContainer;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletContext;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6929 $
+ */
+public class AbstractServerContext implements ServerContext
+{
+
+ /** . */
+ private HttpServletRequest clientRequest;
+
+ /** . */
+ private HttpServletResponse clientResponse;
+
+ public AbstractServerContext(HttpServletRequest clientRequest, HttpServletResponse
clientResponse)
+ {
+ this.clientRequest = clientRequest;
+ this.clientResponse = clientResponse;
+ }
+
+ public String getScheme()
+ {
+ return clientRequest.getScheme();
+ }
+
+ public String getServerName()
+ {
+ return clientRequest.getServerName();
+ }
+
+ public int getServerPort()
+ {
+ return clientRequest.getServerPort();
+ }
+
+ public Object dispatch(ServletContainer servletContainer, ServletContext
targetServletContext, RequestDispatchCallback callback, Object handback) throws Exception
+ {
+ return servletContainer.include(targetServletContext, clientRequest,
clientResponse, callback, handback);
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractServerContext.java
___________________________________________________________________
Name: svn:executable
+
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInvocation.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInvocation.java 2008-01-21
09:18:51 UTC (rev 9544)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInvocation.java 2008-01-21
13:25:38 UTC (rev 9545)
@@ -28,7 +28,7 @@
import org.jboss.portal.portlet.spi.InstanceContext;
import org.jboss.portal.portlet.spi.PortalContext;
import org.jboss.portal.portlet.spi.PortletInvocationContext;
-import org.jboss.portal.portlet.spi.RequestContext;
+import org.jboss.portal.portlet.spi.ServerContext;
import org.jboss.portal.portlet.spi.SecurityContext;
import org.jboss.portal.portlet.spi.UserContext;
import org.jboss.portal.portlet.spi.WindowContext;
@@ -67,8 +67,8 @@
/** The portal context. */
protected PortalContext portalContext;
- /** The request context. */
- protected RequestContext requestContext;
+ /** The server context. */
+ protected ServerContext serverContext;
/** The security context. */
protected SecurityContext securityContext;
@@ -187,14 +187,14 @@
this.portalContext = portalContext;
}
- public RequestContext getRequestContext()
+ public ServerContext getServerContext()
{
- return requestContext;
+ return serverContext;
}
- public void setRequestContext(RequestContext requestContext)
+ public void setServerContext(ServerContext serverContext)
{
- this.requestContext = requestContext;
+ this.serverContext = serverContext;
}
public SecurityContext getSecurityContext()
Deleted:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/RequestContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/RequestContext.java 2008-01-21
09:18:51 UTC (rev 9544)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/RequestContext.java 2008-01-21
13:25:38 UTC (rev 9545)
@@ -1,72 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, 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.portal.portlet.spi;
-
-import org.jboss.portal.web.RequestDispatchCallback;
-import org.jboss.portal.web.ServletContainer;
-
-import javax.servlet.ServletContext;
-
-/**
- * Defines the request context contract. It's usage is related to the Servlet
Container operational
- * environment.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 6929 $
- */
-public interface RequestContext
-{
- /**
- * Return the scheme value.
- *
- * @return the scheme
- */
- String getScheme();
-
- /**
- * Return the server name value.
- *
- * @return the server name
- */
- String getServerName();
-
- /**
- * Return the server port value.
- *
- * @return the server port
- */
- int getServerPort();
-
- /**
- * Delegate to the request context the dispatching to the target servlet context using
the specified spi elements.
- *
- * @param servletContainer the servlet container spi
- * @param targetServletContext the target servlet context
- * @param callback the call back to be done after dispatch
- * @param handback the hand back object to provide after dispatch to the call back
- * @return the call back returned object
- * @throws Exception any exception
- */
- Object dispatch(ServletContainer servletContainer, ServletContext
targetServletContext, RequestDispatchCallback callback, Object handback) throws
Exception;
-
-}
Copied:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/ServerContext.java
(from rev 9544,
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/RequestContext.java)
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/ServerContext.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/ServerContext.java 2008-01-21
13:25:38 UTC (rev 9545)
@@ -0,0 +1,72 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.portal.portlet.spi;
+
+import org.jboss.portal.web.RequestDispatchCallback;
+import org.jboss.portal.web.ServletContainer;
+
+import javax.servlet.ServletContext;
+
+/**
+ * Defines the request context contract. It's usage is related to the Servlet
Container operational
+ * environment.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6929 $
+ */
+public interface ServerContext
+{
+ /**
+ * Return the scheme value.
+ *
+ * @return the scheme
+ */
+ String getScheme();
+
+ /**
+ * Return the server name value.
+ *
+ * @return the server name
+ */
+ String getServerName();
+
+ /**
+ * Return the server port value.
+ *
+ * @return the server port
+ */
+ int getServerPort();
+
+ /**
+ * Delegate to the request context the dispatching to the target servlet context using
the specified spi elements.
+ *
+ * @param servletContainer the servlet container spi
+ * @param targetServletContext the target servlet context
+ * @param callback the call back to be done after dispatch
+ * @param handback the hand back object to provide after dispatch to the call back
+ * @return the call back returned object
+ * @throws Exception any exception
+ */
+ Object dispatch(ServletContainer servletContainer, ServletContext
targetServletContext, RequestDispatchCallback callback, Object handback) throws
Exception;
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/ServerContext.java
___________________________________________________________________
Name: svn:executable
+
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletController.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletController.java 2008-01-21
09:18:51 UTC (rev 9544)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletController.java 2008-01-21
13:25:38 UTC (rev 9545)
@@ -23,14 +23,13 @@
package org.jboss.portal.portlet.test;
import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.ParametersStateString;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.info.EventInfo;
import org.jboss.portal.portlet.info.ParameterInfo;
import org.jboss.portal.portlet.info.NavigationInfo;
-import org.jboss.portal.portlet.impl.spi.AbstractRequestContext;
+import org.jboss.portal.portlet.impl.spi.AbstractServerContext;
import org.jboss.portal.portlet.impl.spi.AbstractUserContext;
import org.jboss.portal.portlet.impl.spi.AbstractWindowContext;
import org.jboss.portal.portlet.impl.spi.AbstractPortalContext;
@@ -170,7 +169,7 @@
ActionInvocation actionInvocation = new ActionInvocation(actionContext);
//
- actionInvocation.setRequestContext(new AbstractRequestContext(req, resp));
+ actionInvocation.setServerContext(new AbstractServerContext(req, resp));
actionInvocation.setInstanceContext(instanceContext);
actionInvocation.setUserContext(new AbstractUserContext(req));
actionInvocation.setWindowContext(new
AbstractWindowContext(portlet.getContext().getId()));
@@ -224,7 +223,7 @@
EventInvocation eventInvocation = new EventInvocation(actionContext);
//
- eventInvocation.setRequestContext(new AbstractRequestContext(req, resp));
+ eventInvocation.setServerContext(new AbstractServerContext(req, resp));
eventInvocation.setInstanceContext(instanceContext);
eventInvocation.setUserContext(new AbstractUserContext(req));
eventInvocation.setWindowContext(new
AbstractWindowContext(portlet.getContext().getId()));
@@ -434,7 +433,7 @@
RenderInvocation render = new RenderInvocation(renderContext);
//
- render.setRequestContext(new AbstractRequestContext(req, resp));
+ render.setServerContext(new AbstractServerContext(req, resp));
render.setInstanceContext(instanceContext);
render.setUserContext(new AbstractUserContext(req));
render.setWindowContext(new
AbstractWindowContext(portlet.getContext().getId()));