Author: chris.laprun(a)jboss.com
Date: 2009-07-29 09:08:20 -0400 (Wed, 29 Jul 2009)
New Revision: 13618
Modified:
jbossexo/modules/portlet/trunk/exo/pom.xml
jbossexo/modules/portlet/trunk/exo/src/main/java/org/jboss/portal/portlet/exo/ExoKernelIntegration.java
jbossexo/modules/portlet/trunk/federation/src/main/java/org/jboss/portal/portlet/federation/impl/FederatingPortletInvokerService.java
jbossexo/modules/portlet/trunk/portal/pom.xml
jbossexo/modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java
Log:
- Use FederatingPortletInvoker so that other PIs (WSRP consumers) can be registered and
used.
- Inject ServletContainer directly in ContextDispatcherInterceptor to avoid dependency on
ExoContainer.
- Added dependencies in POM files so that things compile...
Modified: jbossexo/modules/portlet/trunk/exo/pom.xml
===================================================================
--- jbossexo/modules/portlet/trunk/exo/pom.xml 2009-07-29 12:38:44 UTC (rev 13617)
+++ jbossexo/modules/portlet/trunk/exo/pom.xml 2009-07-29 13:08:20 UTC (rev 13618)
@@ -1,3 +1,26 @@
+<!--
+ ~ JBoss, a division of Red Hat
+ ~ Copyright 2009, 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.
+ -->
+
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
@@ -24,6 +47,24 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.portal.portlet</groupId>
+ <artifactId>portlet-federation</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.portal.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.container</artifactId>
+ <version>${version.exo.kernel}</version>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
Modified:
jbossexo/modules/portlet/trunk/exo/src/main/java/org/jboss/portal/portlet/exo/ExoKernelIntegration.java
===================================================================
---
jbossexo/modules/portlet/trunk/exo/src/main/java/org/jboss/portal/portlet/exo/ExoKernelIntegration.java 2009-07-29
12:38:44 UTC (rev 13617)
+++
jbossexo/modules/portlet/trunk/exo/src/main/java/org/jboss/portal/portlet/exo/ExoKernelIntegration.java 2009-07-29
13:08:20 UTC (rev 13618)
@@ -1,33 +1,31 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2009, 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. *
- ******************************************************************************/
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2009, 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.exo;
-import javax.servlet.http.HttpServlet;
-
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
+import org.jboss.portal.portlet.PortletInvokerInterceptor;
import org.jboss.portal.portlet.api.PortletInvoker;
-import org.jboss.portal.portlet.PortletInvokerInterceptor;
import org.jboss.portal.portlet.aspects.portlet.CCPPInterceptor;
import org.jboss.portal.portlet.aspects.portlet.ConsumerCacheInterceptor;
import org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor;
@@ -39,14 +37,17 @@
import org.jboss.portal.portlet.aspects.portlet.ValveInterceptor;
import org.jboss.portal.portlet.container.ContainerPortletDispatcher;
import org.jboss.portal.portlet.container.ContainerPortletInvoker;
+import org.jboss.portal.portlet.federation.FederatingPortletInvoker;
+import org.jboss.portal.portlet.federation.impl.FederatingPortletInvokerService;
import org.jboss.portal.portlet.impl.state.StateConverterV0;
import org.jboss.portal.portlet.impl.state.StateManagementPolicyService;
import
org.jboss.portal.portlet.impl.state.producer.PortletStatePersistenceManagerService;
import org.jboss.portal.portlet.mc.PortletApplicationDeployer;
import org.jboss.portal.portlet.state.producer.ProducerPortletInvoker;
import org.jboss.portal.web.ServletContainer;
-import org.picocontainer.Startable;
+import javax.servlet.http.HttpServlet;
+
/**
* @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
* @version $Revision$
@@ -55,33 +56,34 @@
{
protected PortletApplicationDeployer portletApplicationRegistry;
-
+ private static final String LOCAL_PORTLET_INVOKER_ID = "local";
+
public void init()
{
ExoContainer container = ExoContainerContext.getCurrentContainer();
-
+
// The producer persistence manager
PortletStatePersistenceManagerService producerPersistanceManager = new
PortletStatePersistenceManagerService();
-
+
// The producer state management policy
StateManagementPolicyService producerStateManagementPolicy = new
StateManagementPolicyService();
producerStateManagementPolicy.setPersistLocally(true);
-
+
// The producer state converter
- StateConverterV0 producerStateConverter = new StateConverterV0();
-
+ StateConverterV0 producerStateConverter = new StateConverterV0();
+
// The portlet container invoker
ContainerPortletInvoker containerPortletInvoker = new ContainerPortletInvoker();
// continued below
-
+
// The portlet application deployer
portletApplicationRegistry = new PortletApplicationDeployer();
portletApplicationRegistry.setContainerPortletInvoker(containerPortletInvoker);
// ServletContainer servletContainer =
(ServletContainer)container.getComponentInstance(ServletContainer.class);
// servletContainer.addWebAppListener(portletApplicationRegistry);
-
+
//Container Stack
ContainerPortletDispatcher portletContainerDispatcher = new
ContainerPortletDispatcher();
EventPayloadInterceptor eventPayloadInterceptor = new EventPayloadInterceptor();
@@ -99,27 +101,36 @@
ValveInterceptor valveInterceptor = new ValveInterceptor();
valveInterceptor.setPortletApplicationRegistry(portletApplicationRegistry);
valveInterceptor.setNext(secureTransportInterceptor);
-
-
+
+ // inject ServletContainer in objects that need it
ServletContainer servletContainer =
(ServletContainer)container.getComponentInstance(ServletContainer.class);
portletApplicationRegistry.setServletContainer(servletContainer);
+ contextDispatcherInterceptor.setServletContainer(servletContainer);
+
// portletApplicationRegistry.start();
//servletContainer.addWebAppListener(portletApplicationRegistry);
-
+
// The portlet container invoker continued
containerPortletInvoker.setNext(valveInterceptor);
+
+ // Federating portlet invoker
+ FederatingPortletInvoker federatingPortletInvoker = new
FederatingPortletInvokerService();
+
+ // register local portlet invoker with federating portlet invoker
+ federatingPortletInvoker.registerInvoker(LOCAL_PORTLET_INVOKER_ID,
containerPortletInvoker);
+
/* register with container */
- container.registerComponentInstance(PortletInvoker.class,
containerPortletInvoker);
-
-
+ container.registerComponentInstance(PortletInvoker.class,
federatingPortletInvoker);
+
+
// The producer portlet invoker
ProducerPortletInvoker producerPortletInvoker = new ProducerPortletInvoker();
producerPortletInvoker.setNext(containerPortletInvoker);
producerPortletInvoker.setPersistenceManager(producerPersistanceManager);
producerPortletInvoker.setStateManagementPolicy(producerStateManagementPolicy);
producerPortletInvoker.setStateConverter(producerStateConverter);
-
-
+
+
// The consumer portlet invoker
PortletCustomizationInterceptor portletCustomizationInterceptor = new
PortletCustomizationInterceptor();
portletCustomizationInterceptor.setNext(producerPortletInvoker);
@@ -127,13 +138,13 @@
consumerCacheInterceptor.setNext(portletCustomizationInterceptor);
PortletInvokerInterceptor consumerPortletInvoker = new
PortletInvokerInterceptor();
consumerPortletInvoker.setNext(consumerCacheInterceptor);
-
+
container.registerComponentInstance(PortletInvokerInterceptor.class,
consumerPortletInvoker);
-
+
portletApplicationRegistry.start();
}
-
+
public void destroy()
{
if (portletApplicationRegistry != null)
Modified:
jbossexo/modules/portlet/trunk/federation/src/main/java/org/jboss/portal/portlet/federation/impl/FederatingPortletInvokerService.java
===================================================================
---
jbossexo/modules/portlet/trunk/federation/src/main/java/org/jboss/portal/portlet/federation/impl/FederatingPortletInvokerService.java 2009-07-29
12:38:44 UTC (rev 13617)
+++
jbossexo/modules/portlet/trunk/federation/src/main/java/org/jboss/portal/portlet/federation/impl/FederatingPortletInvokerService.java 2009-07-29
13:08:20 UTC (rev 13618)
@@ -1,41 +1,42 @@
-/******************************************************************************
- * 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. *
- ******************************************************************************/
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2009, 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.federation.impl;
+import org.apache.log4j.Logger;
+import org.jboss.portal.common.util.ParameterValidation;
import org.jboss.portal.portlet.api.InvokerUnavailableException;
import org.jboss.portal.portlet.api.NoSuchPortletException;
import org.jboss.portal.portlet.api.Portlet;
import org.jboss.portal.portlet.api.PortletContext;
-import org.jboss.portal.portlet.api.PortletInvokerException;
import org.jboss.portal.portlet.api.PortletInvoker;
-import org.jboss.portal.portlet.api.state.PropertyMap;
-import org.jboss.portal.portlet.federation.FederatedPortletInvoker;
-import org.jboss.portal.portlet.federation.FederatingPortletInvoker;
+import org.jboss.portal.portlet.api.PortletInvokerException;
import org.jboss.portal.portlet.api.invocation.PortletInvocation;
import org.jboss.portal.portlet.api.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.api.state.PropertyChange;
import org.jboss.portal.portlet.api.state.DestroyCloneFailure;
-import org.apache.log4j.Logger;
+import org.jboss.portal.portlet.api.state.PropertyChange;
+import org.jboss.portal.portlet.api.state.PropertyMap;
+import org.jboss.portal.portlet.federation.FederatedPortletInvoker;
+import org.jboss.portal.portlet.federation.FederatingPortletInvoker;
import java.util.Collection;
import java.util.Collections;
@@ -65,14 +66,8 @@
public synchronized FederatedPortletInvoker registerInvoker(String federatedId,
PortletInvoker federatedInvoker)
{
- if (federatedId == null)
- {
- throw new IllegalArgumentException("No null id");
- }
- if (federatedInvoker == null)
- {
- throw new IllegalArgumentException("No null invoker");
- }
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(federatedId,
"Federated PortletInvoker id", null);
+ ParameterValidation.throwIllegalArgExceptionIfNull(federatedInvoker,
"Federated PortletInvoker");
if (registry.containsKey(federatedId))
{
throw new IllegalArgumentException("Attempting dual registration of "
+ federatedId);
@@ -86,10 +81,7 @@
public synchronized void unregisterInvoker(String federatedId)
{
- if (federatedId == null)
- {
- throw new IllegalArgumentException("No null id accepted");
- }
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(federatedId,
"Federated PortletInvoker id", null);
if (!registry.containsKey(federatedId))
{
throw new IllegalArgumentException("Attempting to unregister unknown
invoker " + federatedId);
@@ -101,10 +93,7 @@
public FederatedPortletInvoker getFederatedInvoker(String federatedId) throws
IllegalArgumentException
{
- if (federatedId == null)
- {
- throw new IllegalArgumentException("No null id provided");
- }
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(federatedId,
"Federated PortletInvoker id", null);
return registry.get(federatedId);
}
@@ -211,14 +200,11 @@
* @param compoundPortletContext the portlet context for which the invoker is to be
retrieved
* @return the portlet invoker associated with the specified compound portlet id
* @throws IllegalArgumentException if the compound portlet id is not well formed or
null
- * @throws NoSuchPortletException if not such portlet exist
+ * @throws NoSuchPortletException if not such portlet exist
*/
private FederatedPortletInvoker getFederatedPortletInvokerFor(PortletContext
compoundPortletContext) throws IllegalArgumentException, NoSuchPortletException
{
- if (compoundPortletContext == null)
- {
- throw new IllegalArgumentException("No null portlet id accepted");
- }
+ ParameterValidation.throwIllegalArgExceptionIfNull(compoundPortletContext,
"Portlet id");
//
String compoundPortletId = compoundPortletContext.getId();
Modified: jbossexo/modules/portlet/trunk/portal/pom.xml
===================================================================
--- jbossexo/modules/portlet/trunk/portal/pom.xml 2009-07-29 12:38:44 UTC (rev 13617)
+++ jbossexo/modules/portlet/trunk/portal/pom.xml 2009-07-29 13:08:20 UTC (rev 13618)
@@ -1,3 +1,26 @@
+<!--
+ ~ JBoss, a division of Red Hat
+ ~ Copyright 2009, 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.
+ -->
+
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
@@ -96,6 +119,14 @@
<groupId>apache-taglibs</groupId>
<artifactId>standard</artifactId>
</dependency>
+
+
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.container</artifactId>
+ <version>${version.exo.kernel}</version>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
<build>
Modified:
jbossexo/modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java
===================================================================
---
jbossexo/modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java 2009-07-29
12:38:44 UTC (rev 13617)
+++
jbossexo/modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java 2009-07-29
13:08:20 UTC (rev 13618)
@@ -1,45 +1,42 @@
-/******************************************************************************
- * 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. *
- ******************************************************************************/
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2009, 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.aspects.portlet;
-import org.exoplatform.container.ExoContainer;
-import org.exoplatform.container.ExoContainerContext;
+import org.jboss.portal.portlet.PortletInvokerInterceptor;
+import org.jboss.portal.portlet.api.PortletInvokerException;
+import org.jboss.portal.portlet.api.invocation.PortletInvocation;
+import org.jboss.portal.portlet.api.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.api.spi.ServerContext;
+import org.jboss.portal.portlet.container.ContainerPortletInvoker;
import org.jboss.portal.portlet.container.PortletApplication;
import org.jboss.portal.portlet.container.PortletContainer;
-import org.jboss.portal.portlet.container.ContainerPortletInvoker;
import org.jboss.portal.web.RequestDispatchCallback;
import org.jboss.portal.web.ServletContainer;
-import org.jboss.portal.web.ServletContainerFactory;
-import org.jboss.portal.portlet.api.invocation.PortletInvocation;
-import org.jboss.portal.portlet.PortletInvokerInterceptor;
-import org.jboss.portal.portlet.api.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.api.spi.ServerContext;
-import org.jboss.portal.portlet.api.PortletInvokerException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
@@ -55,29 +52,20 @@
public static final String REQ_ATT_COMPONENT_INVOCATION =
"org.jboss.portal.attribute.component_invocation";
/** . */
- private ServletContainerFactory servletContainerFactory;
+ private ServletContainer servletContainer;
- public ServletContainerFactory getServletContainerFactory()
+ public void setServletContainer(ServletContainer servletContainer)
{
- return servletContainerFactory;
+ this.servletContainer = servletContainer;
}
- public void setServletContainerFactory(ServletContainerFactory
servletContainerFactory)
- {
- this.servletContainerFactory = servletContainerFactory;
- }
-
public PortletInvocationResponse invoke(PortletInvocation invocation) throws
IllegalArgumentException, PortletInvokerException
{
PortletContainer container =
(PortletContainer)invocation.getAttribute(ContainerPortletInvoker.PORTLET_CONTAINER);
PortletApplication portletApplication = container.getPortletApplication();
ServerContext reqCtx = invocation.getServerContext();
ServletContext targetCtx = portletApplication.getContext().getServletContext();
-
- ExoContainer exoContainer = ExoContainerContext.getCurrentContainer();
- ServletContainer servletContainer = (ServletContainer)
exoContainer.getComponentInstance(ServletContainer.class);
-
- //ServletContainer servletContainer =
servletContainerFactory.getServletContainer();
+
try
{
return (PortletInvocationResponse)reqCtx.dispatch(servletContainer, targetCtx,
callback, invocation);