Author: chris.laprun(a)jboss.com
Date: 2007-06-29 16:25:28 -0400 (Fri, 29 Jun 2007)
New Revision: 7649
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java
Log:
- JBPORTAL-1394: Do not attempt to close the valve if the container didn't properly
start.
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java 2007-06-29
20:23:10 UTC (rev 7648)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java 2007-06-29
20:25:28 UTC (rev 7649)
@@ -23,47 +23,47 @@
package org.jboss.portal.portlet.impl.jsr168;
import org.jboss.logging.Logger;
+import org.jboss.portal.common.concurrent.Valve;
+import org.jboss.portal.common.i18n.ResourceBundleManager;
+import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor;
+import org.jboss.portal.portlet.container.PortletApplication;
+import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.container.PortletInitializationException;
+import org.jboss.portal.portlet.impl.jsr168.api.ActionRequestImpl;
+import org.jboss.portal.portlet.impl.jsr168.api.ActionResponseImpl;
import org.jboss.portal.portlet.impl.jsr168.api.PortletConfigImpl;
-import org.jboss.portal.portlet.impl.jsr168.api.ActionResponseImpl;
+import org.jboss.portal.portlet.impl.jsr168.api.RenderRequestImpl;
import org.jboss.portal.portlet.impl.jsr168.api.RenderResponseImpl;
-import org.jboss.portal.portlet.impl.jsr168.api.RenderRequestImpl;
-import org.jboss.portal.portlet.impl.jsr168.api.ActionRequestImpl;
-import org.jboss.portal.portlet.container.PortletInitializationException;
-import org.jboss.portal.portlet.container.PortletApplication;
-import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.impl.jsr168.metadata.ParameterMetaData;
import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
import org.jboss.portal.portlet.impl.jsr168.metadata.PortletPreferencesMetaData;
import org.jboss.portal.portlet.impl.jsr168.metadata.SecurityRoleRefMetaData;
-import org.jboss.portal.portlet.impl.jsr168.metadata.ParameterMetaData;
import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory;
-import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.invocation.ActionInvocation;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.RenderInvocation;
+import org.jboss.portal.portlet.invocation.response.ErrorResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.invocation.response.ErrorResponse;
import org.jboss.portal.portlet.invocation.response.SecurityErrorResponse;
import org.jboss.portal.portlet.invocation.response.UnavailableResponse;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.invocation.ActionInvocation;
-import org.jboss.portal.portlet.invocation.RenderInvocation;
-import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor;
-import org.jboss.portal.common.concurrent.Valve;
-import org.jboss.portal.common.invocation.InvocationException;
-import org.jboss.portal.common.i18n.ResourceBundleManager;
+import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
+import javax.portlet.Portlet;
import javax.portlet.PortletConfig;
-import javax.portlet.Portlet;
-import javax.portlet.PreferencesValidator;
import javax.portlet.PortletException;
import javax.portlet.PortletSecurityException;
+import javax.portlet.PreferencesValidator;
import javax.portlet.UnavailableException;
import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
import java.util.Map;
import java.util.Set;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Collections;
-import java.io.IOException;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -271,20 +271,20 @@
public void stop()
{
- // Wait at most 60 seconds before all invocations are done
- log.debug("Trying to close the valve");
- boolean done = valve.closing(60000);
- if (!done)
+ // if the portlet is not started, we shouldn't be trying to stop it...
+ if (started)
{
- log.warn("The valve is still holding invocations, continue anyway");
- }
+ // Wait at most 60 seconds before all invocations are done
+ log.debug("Trying to close the valve");
+ boolean done = valve.closing(60000);
+ if (!done)
+ {
+ log.warn("The valve is still holding invocations, continue
anyway");
+ }
- //
- valve.closed();
+ //
+ valve.closed();
- //
- if (started)
- {
//
started = false;
Show replies by date