Diff of /cocoon/blocks/supported/portal/trunk/java/org/apache/cocoon/portlet/CocoonPortlet.java
Parent Directory
| Revision Log
| Patch
--- cocoon/blocks/supported/portal/trunk/java/org/apache/cocoon/portlet/CocoonPortlet.java 2005/04/22 11:01:43 164218
+++ cocoon/blocks/supported/portal/trunk/java/org/apache/cocoon/portlet/CocoonPortlet.java 2005/04/22 11:03:32 164219
@@ -102,12 +102,6 @@ public class CocoonPortlet extends Gener
*/
protected Exception exception;
- /**
- * Avalon application context
- */
- protected org.apache.avalon.framework.context.Context appContext;
-
-
private String containerEncoding;
protected javax.portlet.PortletContext portletContext;
@@ -162,6 +156,8 @@ public class CocoonPortlet extends Gener
/** Settings */
protected Settings settings;
+ protected Context environmentContext;
+
/**
* Initialize this <code>CocoonPortlet</code> instance.
*
@@ -238,7 +234,7 @@ public class CocoonPortlet extends Gener
try {
this.coreUtil = new CoreUtil(env);
- this.appContext = coreUtil.getCore().getContext();
+ this.environmentContext = env.getEnvironmentContext();
this.log = env.logger;
} catch (Exception e) {
if ( e instanceof PortletException ) {
@@ -392,8 +388,7 @@ public class CocoonPortlet extends Gener
// Add a unique request id (threadName + currentTime
ctxMap.set("request-id", threadName + System.currentTimeMillis());
- if (this.cocoon.process(env)) {
- } else {
+ if (!this.cocoon.process(env)) {
// We reach this when there is nothing in the processing change that matches
// the request. For example, no matcher matches.
getLogger().fatalError("The Cocoon engine failed to process the request.");
@@ -757,7 +752,7 @@ public class CocoonPortlet extends Gener
req,
res,
this.portletContext,
- (PortletContext) this.appContext.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT),
+ this.environmentContext,
this.containerEncoding,
formEncoding,
this.defaultSessionScope);
@@ -786,7 +781,7 @@ public class CocoonPortlet extends Gener
req,
res,
this.portletContext,
- (PortletContext) this.appContext.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT),
+ this.environmentContext,
this.containerEncoding,
formEncoding,
this.defaultSessionScope);
@@ -852,6 +847,7 @@ public class CocoonPortlet extends Gener
private final File writeableContextPath;
private final String contextPath;
public Logger logger;
+ private final Context environmentContext;
public PortletBootstrapEnvironment(PortletConfig config,
ClassLoader cl,
@@ -865,6 +861,7 @@ public class CocoonPortlet extends Gener
this.writeableContextPath = new File(writeablePath);
}
this.contextPath = path;
+ this.environmentContext = new PortletContext(this.config.getPortletContext());
}
/**
@@ -918,7 +915,7 @@ public class CocoonPortlet extends Gener
* @see org.apache.cocoon.core.BootstrapEnvironment#getEnvironmentContext()
*/
public Context getEnvironmentContext() {
- return new PortletContext(this.config.getPortletContext());
+ return this.environmentContext;
}
/**