Author: chris.laprun(a)jboss.com
Date: 2011-09-15 12:15:09 -0400 (Thu, 15 Sep 2011)
New Revision: 7441
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducerImpl.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/ServiceDescriptionHandler.java
Log:
- GTNWSRP-240: only process remotable portlets in onEvent.
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducerImpl.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducerImpl.java 2011-09-15
11:35:56 UTC (rev 7440)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducerImpl.java 2011-09-15
16:15:09 UTC (rev 7441)
@@ -520,9 +520,7 @@
private boolean isRemotable(Portlet portlet)
{
Map<String, RuntimeOptionInfo> runtimeOptions =
portlet.getInfo().getRuntimeOptionsInfo();
- RuntimeOptionInfo runtimeOptionInfo =
runtimeOptions.get(RuntimeOptionInfo.REMOTABLE_RUNTIME_OPTION);
-
- return runtimeOptionInfo != null &&
"true".equals(runtimeOptionInfo.getValues().get(0));
+ return serviceDescriptionHandler.isRemotable(runtimeOptions);
}
public List<String> getSupportedLocales()
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/ServiceDescriptionHandler.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/ServiceDescriptionHandler.java 2011-09-15
11:35:56 UTC (rev 7440)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/ServiceDescriptionHandler.java 2011-09-15
16:15:09 UTC (rev 7441)
@@ -36,6 +36,7 @@
import org.gatein.pc.api.info.NavigationInfo;
import org.gatein.pc.api.info.ParameterInfo;
import org.gatein.pc.api.info.PortletInfo;
+import org.gatein.pc.api.info.RuntimeOptionInfo;
import org.gatein.pc.api.info.SecurityInfo;
import org.gatein.pc.api.info.WindowStateInfo;
import org.gatein.pc.portlet.container.managed.LifeCycleStatus;
@@ -169,23 +170,29 @@
if (managedObject instanceof ManagedPortletContainer)
{
ManagedPortletContainer portletContainer =
(ManagedPortletContainer)managedObject;
- String applicationId =
portletContainer.getManagedPortletApplication().getId();
- String containerId = portletContainer.getId();
+ final PortletInfo info = portletContainer.getInfo();
- org.gatein.pc.api.PortletContext pc =
org.gatein.pc.api.PortletContext.createPortletContext(applicationId, containerId);
+ // only process portlet if it's remotable
+ if (isRemotable(info.getRuntimeOptionsInfo()))
+ {
+ String applicationId =
portletContainer.getManagedPortletApplication().getId();
+ String containerId = portletContainer.getId();
- if (managedObjectEvent instanceof ManagedObjectLifeCycleEvent)
- {
- ManagedObjectLifeCycleEvent lifeCycleEvent =
(ManagedObjectLifeCycleEvent)managedObjectEvent;
- LifeCycleStatus status = lifeCycleEvent.getStatus();
- if (LifeCycleStatus.STARTED.equals(status))
+ org.gatein.pc.api.PortletContext pc =
org.gatein.pc.api.PortletContext.createPortletContext(applicationId, containerId);
+
+ if (managedObjectEvent instanceof ManagedObjectLifeCycleEvent)
{
- serviceDescription.addPortletDescription(pc,
portletContainer.getInfo());
+ ManagedObjectLifeCycleEvent lifeCycleEvent =
(ManagedObjectLifeCycleEvent)managedObjectEvent;
+ LifeCycleStatus status = lifeCycleEvent.getStatus();
+ if (LifeCycleStatus.STARTED.equals(status))
+ {
+ serviceDescription.addPortletDescription(pc, info);
+ }
+ else
+ {
+ serviceDescription.removePortletDescription(pc);
+ }
}
- else
- {
- serviceDescription.removePortletDescription(pc);
- }
}
}
}
@@ -231,6 +238,13 @@
serviceDescription = new ServiceDescriptionInfo();
}
+ public boolean isRemotable(Map<String, RuntimeOptionInfo> runtimeOptions)
+ {
+ RuntimeOptionInfo runtimeOptionInfo =
runtimeOptions.get(RuntimeOptionInfo.REMOTABLE_RUNTIME_OPTION);
+
+ return runtimeOptionInfo != null &&
"true".equals(runtimeOptionInfo.getValues().get(0));
+ }
+
private class ServiceDescriptionInfo
{
private long lastGenerated;
Show replies by date