taylor 2004/08/19 10:29:22
Modified: commons/src/java/org/apache/jetspeed/container
JetspeedContainerServlet.java
ContainerConstants.java
commons/src/java/org/apache/jetspeed/factory
JetspeedPortletFactoryProxy.java
Log:
moved portletdefinition out of request attributes and into thread local
webloic was trying to serialize any object put in the request attribute that
originated from a different class loader
the portlet def is a pretty deep tree of objects, and even if we did make it
serializable, for performance reasons its best not to serialize/deserialize these
objects on a per request basis
CVS: ----------------------------------------------------------------------
CVS: PR:
CVS: If this change addresses a PR in the problem report tracking
CVS: database, then enter the PR number(s) here.
CVS: Obtained from:
CVS: If this change has been taken from another system, such as NCSA,
CVS: then name the system in this line, otherwise delete it.
CVS: Submitted by:
CVS: If this code has been contributed to Apache by someone else; i.e.,
CVS: they sent us a patch or a new module, then include their name/email
CVS: address here. If this is your work then delete this line.
CVS: Reviewed by:
CVS: If we are doing pre-commit code reviews and someone else has
CVS: reviewed your changes, include their name(s) here.
CVS: If you have not had it reviewed then delete this line.
Revision Changes Path
1.16 +8 -5
jakarta-jetspeed-2/commons/src/java/org/apache/jetspeed/container/JetspeedContainerServlet.java
Index: JetspeedContainerServlet.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/commons/src/java/org/apache/jetspeed/container/JetspeedContainerServlet.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- JetspeedContainerServlet.java 18 Aug 2004 01:13:27 -0000 1.15
+++ JetspeedContainerServlet.java 19 Aug 2004 17:29:22 -0000 1.16
@@ -201,15 +201,18 @@
}
// infuseClasspath();
-
- PortletDefinition portletDefinition = (PortletDefinition)
request.getAttribute(ContainerConstants.PORTLET_ENTITY);
- Portlet portlet =
JetspeedPortletFactoryProxy.getPortlet(this.getServletConfig(), portletDefinition);
- portletName = portletDefinition.getName();
+
Integer method = (Integer)
request.getAttribute(ContainerConstants.METHOD_ID);
if (method == ContainerConstants.METHOD_NOOP)
{
return;
}
+
+ PortletDefinition portletDefinition =
JetspeedPortletFactoryProxy.getCurrentPortletDefinition();
+System.out.println("Got thread local PD = " + portletDefinition);
+
+ Portlet portlet =
JetspeedPortletFactoryProxy.getPortlet(this.getServletConfig(), portletDefinition);
+ portletName = portletDefinition.getName();
// log.debug("Rendering: Portlet Class = " +
portletDefinition.getClassName());
1.4 +1 -4
jakarta-jetspeed-2/commons/src/java/org/apache/jetspeed/container/ContainerConstants.java
Index: ContainerConstants.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/commons/src/java/org/apache/jetspeed/container/ContainerConstants.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ContainerConstants.java 8 Mar 2004 00:41:26 -0000 1.3
+++ ContainerConstants.java 19 Aug 2004 17:29:22 -0000 1.4
@@ -32,7 +32,4 @@
public final static Integer METHOD_RENDER = new Integer(1);
public final static Integer METHOD_ACTION = new Integer(3);
public final static Integer METHOD_NOOP = new Integer(5);
-
- public final static String PORTLET_ENTITY = "org.apache.jetspeed.portlet";
-
}
1.2 +12 -1
jakarta-jetspeed-2/commons/src/java/org/apache/jetspeed/factory/JetspeedPortletFactoryProxy.java
Index: JetspeedPortletFactoryProxy.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/commons/src/java/org/apache/jetspeed/factory/JetspeedPortletFactoryProxy.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- JetspeedPortletFactoryProxy.java 1 Aug 2004 15:37:59 -0000 1.1
+++ JetspeedPortletFactoryProxy.java 19 Aug 2004 17:29:22 -0000 1.2
@@ -32,6 +32,17 @@
{
private static PortletFactory portletFactory;
+ private static ThreadLocal tlData = new ThreadLocal();
+
+ public static void setCurrentPortletDefinition(PortletDefinition pd)
+ {
+ tlData.set(pd);
+ }
+
+ public static PortletDefinition getCurrentPortletDefinition()
+ {
+ return (PortletDefinition)tlData.get();
+ }
public JetspeedPortletFactoryProxy(PortletFactory portletFactory)
{
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]