JBoss Portal SVN: r10033 - in modules/web/trunk: web and 2 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-19 13:37:25 -0500 (Tue, 19 Feb 2008)
New Revision: 10033
Modified:
modules/web/trunk/pom.xml
modules/web/trunk/web/pom.xml
modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/tomcat/TC6ServletContainerContext.java
modules/web/trunk/web/src/test/build.xml
Log:
hopefully now it's right
Modified: modules/web/trunk/pom.xml
===================================================================
--- modules/web/trunk/pom.xml 2008-02-19 18:09:37 UTC (rev 10032)
+++ modules/web/trunk/pom.xml 2008-02-19 18:37:25 UTC (rev 10033)
@@ -5,7 +5,7 @@
<artifactId>module-aggregator</artifactId>
<packaging>pom</packaging>
<name>JBoss Portal Web Module</name>
- <version>1.2.0-Beta1</version>
+ <version>1.2.0-SNAPSHOT</version>
<url>http://labs.jboss.com/jbossportal</url>
<dependencies/>
Modified: modules/web/trunk/web/pom.xml
===================================================================
--- modules/web/trunk/web/pom.xml 2008-02-19 18:09:37 UTC (rev 10032)
+++ modules/web/trunk/web/pom.xml 2008-02-19 18:37:25 UTC (rev 10033)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.web</groupId>
<artifactId>module-parent</artifactId>
- <version>1.2.0-Beta1</version>
+ <version>1.2.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/tomcat/TC6ServletContainerContext.java
===================================================================
--- modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/tomcat/TC6ServletContainerContext.java 2008-02-19 18:09:37 UTC (rev 10032)
+++ modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/tomcat/TC6ServletContainerContext.java 2008-02-19 18:37:25 UTC (rev 10033)
@@ -226,7 +226,7 @@
Container[] childrenContainers = host.findChildren();
for (Container childContainer : childrenContainers)
{
- if (childContainer instanceof Context)
+ if (childContainer instanceof StandardContext)
{
StandardContext context = (StandardContext)childContainer;
unregisterContext(context);
@@ -259,7 +259,7 @@
monitoredContexts.remove(context.getName());
//
- if (context.getAvailable())
+ if (context.getState() == 1)
{
stop(context);
}
Modified: modules/web/trunk/web/src/test/build.xml
===================================================================
--- modules/web/trunk/web/src/test/build.xml 2008-02-19 18:09:37 UTC (rev 10032)
+++ modules/web/trunk/web/src/test/build.xml 2008-02-19 18:37:25 UTC (rev 10033)
@@ -190,9 +190,6 @@
<path refid="mc.trove"/>
<path refid="mc.xerces"/>
<path refid="mc.javassist"/>
- <path refid="mc.jboss_common_logging_spi"/>
- <path refid="mc.jboss_common_logging_jdk"/>
- <path refid="mc.jboss_common_logging_log4j"/>
<path refid="mc.jboss_common_core"/>
<path refid="mc.jboss_vfs"/>
<path refid="mc.jboss_xb"/>
@@ -215,9 +212,6 @@
<path refid="mc.trove"/>
<path refid="mc.xerces"/>
<path refid="mc.javassist"/>
- <path refid="mc.jboss_common_logging_spi"/>
- <path refid="mc.jboss_common_logging_jdk"/>
- <path refid="mc.jboss_common_logging_log4j"/>
<path refid="mc.jboss_common_core"/>
<path refid="mc.jboss_vfs"/>
<path refid="mc.jboss_xb"/>
@@ -241,9 +235,6 @@
<path refid="mc.trove"/>
<path refid="mc.xerces"/>
<path refid="mc.javassist"/>
- <path refid="mc.jboss_common_logging_spi"/>
- <path refid="mc.jboss_common_logging_jdk"/>
- <path refid="mc.jboss_common_logging_log4j"/>
<path refid="mc.jboss_common_core"/>
<path refid="mc.jboss_vfs"/>
<path refid="mc.jboss_xb"/>
@@ -262,9 +253,6 @@
<path refid="mc.portal-test-generic"/>
<path refid="mc.trove"/>
<path refid="mc.javassist"/>
- <path refid="mc.jboss_common_logging_spi"/>
- <path refid="mc.jboss_common_logging_jdk"/>
- <path refid="mc.jboss_common_logging_log4j"/>
<path refid="mc.jboss_common_core"/>
<path refid="mc.jboss_vfs"/>
<path refid="mc.jboss_xb"/>
@@ -283,9 +271,6 @@
<path refid="mc.portal-test-generic"/>
<path refid="mc.trove"/>
<path refid="mc.javassist"/>
- <path refid="mc.jboss_common_logging_spi"/>
- <path refid="mc.jboss_common_logging_jdk"/>
- <path refid="mc.jboss_common_logging_log4j"/>
<path refid="mc.jboss_common_core"/>
<path refid="mc.jboss_vfs"/>
<path refid="mc.jboss_xb"/>
@@ -398,6 +383,7 @@
action="start"
wait="${cargo.wait}">
<sharedClasspath>
+
<path location="${dependency.portal-common.jar}"/>
<path location="${dependency.jboss-unit.jar}"/>
<path location="${dependency.jboss-unit-remote.jar}"/>
@@ -508,6 +494,11 @@
action="start"
wait="${cargo.wait}">
<sharedClasspath>
+
+ <path refid="mc.jboss_common_logging_spi"/>
+ <path refid="mc.jboss_common_logging_jdk"/>
+ <path refid="mc.jboss_common_logging_log4j"/>
+
<path location="${dependency.log4j.jar}"/>
<path location="${dependency.concurrent.jar}"/>
<path location="${dependency.portal-common.jar}"/>
18 years, 2 months
JBoss Portal SVN: r10032 - modules/web/trunk/build.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-19 13:09:37 -0500 (Tue, 19 Feb 2008)
New Revision: 10032
Modified:
modules/web/trunk/build/pom.xml
Log:
it's rather SNAPSHOT than 1.2.Beta1
Modified: modules/web/trunk/build/pom.xml
===================================================================
--- modules/web/trunk/build/pom.xml 2008-02-19 18:03:31 UTC (rev 10031)
+++ modules/web/trunk/build/pom.xml 2008-02-19 18:09:37 UTC (rev 10032)
@@ -18,7 +18,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.portal.web</groupId>
<artifactId>module-parent</artifactId>
- <version>1.2.0-Beta1</version>
+ <version>1.2.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>JBoss Portal Test Module</name>
<url>http://www.jboss.com/products/jbossmc</url>
18 years, 2 months
JBoss Portal SVN: r10031 - in modules/web/trunk/web/src: test and 4 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-19 13:03:31 -0500 (Tue, 19 Feb 2008)
New Revision: 10031
Modified:
modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/tomcat/TC6ServletContainerContext.java
modules/web/trunk/web/src/test/build.xml
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/WebAppRegistry.java
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/spi/SPITestCase.java
modules/web/trunk/web/src/test/resources/support/jboss-4.2-generic/server-war/WEB-INF/web.xml
modules/web/trunk/web/src/test/resources/support/tomcat-6.0-generic/server-war/WEB-INF/web.xml
Log:
JBPORTAL-1903 : The web application containing the integration SPI does not participate in the life cycle of the web SPI
Modified: modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/tomcat/TC6ServletContainerContext.java
===================================================================
--- modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/tomcat/TC6ServletContainerContext.java 2008-02-19 14:07:50 UTC (rev 10030)
+++ modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/tomcat/TC6ServletContainerContext.java 2008-02-19 18:03:31 UTC (rev 10031)
@@ -36,6 +36,7 @@
import org.jboss.portal.web.command.CommandDispatcher;
import org.jboss.portal.web.impl.DefaultServletContainerFactory;
import org.jboss.portal.web.spi.ServletContainerContext;
+import org.apache.catalina.core.StandardContext;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@@ -59,10 +60,10 @@
private final CommandDispatcher dispatcher = new CommandDispatcher();
/** The monitored hosts. */
- private final Set monitoredHosts = new HashSet();
+ private final Set<String> monitoredHosts = new HashSet<String>();
/** The monitored contexts. */
- private final Set monitoredContexts = new HashSet();
+ private final Set<String> monitoredContexts = new HashSet<String>();
/** . */
private final Engine engine;
@@ -111,9 +112,9 @@
unregisterHost(host);
}
}
- else if (event.getData() instanceof Context)
+ else if (event.getData() instanceof StandardContext)
{
- Context context = (Context)event.getData();
+ StandardContext context = (StandardContext)event.getData();
//
if (Container.ADD_CHILD_EVENT.equals(event.getType()))
@@ -151,9 +152,8 @@
//
Container[] childrenContainers = engine.findChildren();
- for (int i = 0; i < childrenContainers.length; i++)
+ for (Container childContainer : childrenContainers)
{
- Container childContainer = childrenContainers[i];
if (childContainer instanceof Host)
{
Host host = (Host)childContainer;
@@ -171,9 +171,8 @@
//
Container[] childrenContainers = engine.findChildren();
- for (int i = 0; i < childrenContainers.length; i++)
+ for (Container childContainer : childrenContainers)
{
- Container childContainer = childrenContainers[i];
if (childContainer instanceof Host)
{
Host host = (Host)childContainer;
@@ -197,12 +196,11 @@
if (!monitoredHosts.contains(host.getName()))
{
Container[] childrenContainers = host.findChildren();
- for (int i = 0; i < childrenContainers.length; i++)
+ for (Container childContainer : childrenContainers)
{
- Container childContainer = childrenContainers[i];
- if (childContainer instanceof Context)
+ if (childContainer instanceof StandardContext)
{
- Context context = (Context)childContainer;
+ StandardContext context = (StandardContext)childContainer;
registerContext(context);
}
}
@@ -226,29 +224,25 @@
//
Container[] childrenContainers = host.findChildren();
- for (int i = 0; i < childrenContainers.length; i++)
+ for (Container childContainer : childrenContainers)
{
- Container childContainer = childrenContainers[i];
if (childContainer instanceof Context)
{
- Context context = (Context)childContainer;
+ StandardContext context = (StandardContext)childContainer;
unregisterContext(context);
}
}
}
}
- private void registerContext(Context context)
+ private void registerContext(StandardContext context)
{
if (!monitoredContexts.contains(context.getName()))
{
- if (context instanceof Lifecycle)
- {
- ((Lifecycle)context).addLifecycleListener(this);
- }
+ context.addLifecycleListener(this);
//
- if (context.getAvailable())
+ if (context.getState() == 1)
{
start(context);
}
@@ -258,7 +252,7 @@
}
}
- private void unregisterContext(Context context)
+ private void unregisterContext(StandardContext context)
{
if (monitoredContexts.contains(context.getName()))
{
@@ -271,10 +265,7 @@
}
//
- if (context instanceof Lifecycle)
- {
- ((Lifecycle)context).removeLifecycleListener(this);
- }
+ context.removeLifecycleListener(this);
}
}
Modified: modules/web/trunk/web/src/test/build.xml
===================================================================
--- modules/web/trunk/web/src/test/build.xml 2008-02-19 14:07:50 UTC (rev 10030)
+++ modules/web/trunk/web/src/test/build.xml 2008-02-19 18:03:31 UTC (rev 10031)
@@ -572,21 +572,21 @@
<param name="test.id" value="Tomcat-6_0-spi-container-servlet"/>
<param name="test.tomcat-6.name" value="RemoteTomcat_6_0"/>
<param name="test.tomcat-6.home" value="${TOMCAT_6_0_HOME}"/>
- <param name="test.tomcat-6.home.variable-name" value="OMCAT_6_0_HOME"/>
+ <param name="test.tomcat-6.home.variable-name" value="TOMCAT_6_0_HOME"/>
<param name="test.archive.path" value="${test.temp.lib}/tomcat-6.0-container-servlet/test-spi-server.war"/>
</antcall>
<antcall target="tests.tomcat-6.generic">
<param name="test.id" value="Tomcat-6_0-spi-generic"/>
<param name="test.tomcat-6.name" value="RemoteTomcat_6_0"/>
<param name="test.tomcat-6.home" value="${TOMCAT_6_0_HOME}"/>
- <param name="test.tomcat-6.home.variable-name" value="OMCAT_6_0_HOME"/>
+ <param name="test.tomcat-6.home.variable-name" value="TOMCAT_6_0_HOME"/>
<param name="test.archive.path" value="${test.temp.lib}/tomcat-6.0-generic/test-spi-server.war"/>
</antcall>
<antcall target="tests.tomcat-6.container-servlet">
<param name="test.id" value="Tomcat-6_0-request-container-servlet"/>
<param name="test.tomcat-6.name" value="RemoteTomcat_6_0"/>
<param name="test.tomcat-6.home" value="${TOMCAT_6_0_HOME}"/>
- <param name="test.tomcat-6.home.variable-name" value="OMCAT_6_0_HOME"/>
+ <param name="test.tomcat-6.home.variable-name" value="TOMCAT_6_0_HOME"/>
<param name="test.archive.path" value="${test.temp.lib}/tomcat-6.0-container-servlet/test-request-server.war"/>
</antcall>
</target>
Modified: modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/WebAppRegistry.java
===================================================================
--- modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/WebAppRegistry.java 2008-02-19 14:07:50 UTC (rev 10030)
+++ modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/WebAppRegistry.java 2008-02-19 18:03:31 UTC (rev 10031)
@@ -39,7 +39,7 @@
{
/** . */
- final Map map = new HashMap();
+ final Map<String, WebApp> map = new HashMap<String, WebApp>();
public void onEvent(WebAppEvent event)
{
@@ -64,10 +64,10 @@
{
throw new IllegalArgumentException();
}
- return (WebApp)map.get(key);
+ return map.get(key);
}
- public Set getKeys()
+ public Set<String> getKeys()
{
return map.keySet();
}
Modified: modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/spi/SPITestCase.java
===================================================================
--- modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/spi/SPITestCase.java 2008-02-19 14:07:50 UTC (rev 10030)
+++ modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/spi/SPITestCase.java 2008-02-19 18:03:31 UTC (rev 10031)
@@ -48,7 +48,6 @@
import java.io.IOException;
import java.util.Set;
import java.util.HashSet;
-import java.util.Collection;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -70,6 +69,13 @@
{
if (getRequestCount() == 1)
{
+ // Check that this web app is here
+ String key = req.getContextPath();
+ if (!keys.contains(key))
+ {
+ fail("The current test web app with key " + key + " is not seen as deployed among " + keys);
+ }
+
// Should try
ServletContext appContext = testServlet.getServletContext().getContext("/test-spi-app");
@@ -147,7 +153,7 @@
// Register and save the deployed web apps
registry = new WebAppRegistry();
container.addWebAppListener(registry);
- keys = new HashSet<String>((Collection<? extends String>)registry.getKeys());
+ keys = new HashSet<String>(registry.getKeys());
// Deploy the application web app
return new DeployResponse("test-spi-app.war");
@@ -155,7 +161,7 @@
else if (getRequestCount() == 0)
{
// Compute the difference with the previous deployed web apps
- Set diff = new HashSet<String>((Collection<? extends String>)registry.getKeys());
+ Set diff = new HashSet<String>(registry.getKeys());
diff.removeAll(keys);
// It should be 1
Modified: modules/web/trunk/web/src/test/resources/support/jboss-4.2-generic/server-war/WEB-INF/web.xml
===================================================================
--- modules/web/trunk/web/src/test/resources/support/jboss-4.2-generic/server-war/WEB-INF/web.xml 2008-02-19 14:07:50 UTC (rev 10030)
+++ modules/web/trunk/web/src/test/resources/support/jboss-4.2-generic/server-war/WEB-INF/web.xml 2008-02-19 18:03:31 UTC (rev 10031)
@@ -42,8 +42,17 @@
<servlet-class>org.jboss.portal.test.web.TestServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
+ <servlet>
+ <servlet-name>BootstrapServlet</servlet-name>
+ <servlet-class>org.jboss.portal.web.impl.generic.PortletContainerBootstrapServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
<servlet-mapping>
<servlet-name>TestServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>BootstrapServlet</servlet-name>
+ <url-pattern>/jbossportlet</url-pattern>
+ </servlet-mapping>
</web-app>
Modified: modules/web/trunk/web/src/test/resources/support/tomcat-6.0-generic/server-war/WEB-INF/web.xml
===================================================================
--- modules/web/trunk/web/src/test/resources/support/tomcat-6.0-generic/server-war/WEB-INF/web.xml 2008-02-19 14:07:50 UTC (rev 10030)
+++ modules/web/trunk/web/src/test/resources/support/tomcat-6.0-generic/server-war/WEB-INF/web.xml 2008-02-19 18:03:31 UTC (rev 10031)
@@ -42,8 +42,17 @@
<servlet-class>org.jboss.portal.test.web.TestServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
+ <servlet>
+ <servlet-name>BootstrapServlet</servlet-name>
+ <servlet-class>org.jboss.portal.web.impl.generic.PortletContainerBootstrapServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
<servlet-mapping>
<servlet-name>TestServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>BootstrapServlet</servlet-name>
+ <url-pattern>/jbossportlet</url-pattern>
+ </servlet-mapping>
</web-app>
18 years, 2 months
JBoss Portal SVN: r10030 - in modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet: container and 2 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-19 09:07:50 -0500 (Tue, 19 Feb 2008)
New Revision: 10030
Added:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/object/
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/object/PortletApplicationObject.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/object/PortletContainerObject.java
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplication.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletContainer.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletContainerInvoker.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java
Log:
- move wiring / service concerns of application/containers to dedicated interfaces
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java 2008-02-19 13:23:47 UTC (rev 10029)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java 2008-02-19 14:07:50 UTC (rev 10030)
@@ -22,12 +22,10 @@
******************************************************************************/
package org.jboss.portal.portlet.aspects.portlet;
-import org.jboss.portal.common.concurrent.Valve;
import org.jboss.portal.common.invocation.InvocationException;
-import org.jboss.portal.portlet.container.PortletApplication;
-import org.jboss.portal.portlet.container.PortletApplicationContext;
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.container.PortletContainerInvoker;
+import org.jboss.portal.portlet.container.PortletContainerContext;
import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
@@ -45,47 +43,27 @@
*/
public class ValveInterceptor extends PortletInterceptor
{
+
protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
-/*
- PortletContainer container = (PortletContainer)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER);
- Valve valve = container.getValve();
+ PortletInvocationResponse response = (PortletInvocationResponse)invocation.invokeNext();
- // Try to aquire the valve
- if (valve.beforeInvocation())
+ // Stop the container if necessary
+ if (response instanceof UnavailableResponse)
{
- PortletInvocationResponse response = null;
+ // This call will wait until all the current threads have exited the component valve.
+ // Perhaps this should be done asynchronously as it may lead to a long delay ?
+ // It could be made parametrizable too, so the deployer can choose what mode is preferable
+ PortletContainer container = (PortletContainer)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER);
- try
- {
- response = (PortletInvocationResponse)invocation.invokeNext();
- }
- finally
- {
- // Release the valve
- valve.afterInvocation();
- }
+ // Get the context
+ PortletContainerContext context = container.getContext();
- // Stop the container if necessary
- if (response instanceof UnavailableResponse)
- {
- // This call will wait until all the current threads have exited the component valve.
- // Perhaps this should be done asynchronously as it may lead to a long delay ?
- // It could be made parametrizable too, so the deployer can choose what mode is preferable
- PortletApplication application = container.getApplication();
- PortletApplicationContext applicationContext = application.getContext();
- applicationContext.stopPortletContainer(container.getId());
- }
-
- //
- return response;
+ // Invoke stop
+ context.invokeStop();
}
- else
- {
- return new UnavailableResponse();
- }
-*/
- return invocation.invokeNext();
+ //
+ return response;
}
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplication.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplication.java 2008-02-19 13:23:47 UTC (rev 10029)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplication.java 2008-02-19 14:07:50 UTC (rev 10030)
@@ -22,6 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.container;
+import javax.servlet.ServletContext;
import java.util.Collection;
/**
@@ -40,34 +41,6 @@
String getId();
/**
- * Set the context required by that application.
- *
- * @param context the context
- */
- void setContext(PortletApplicationContext context);
-
- /**
- * Returns the context related to this application.
- *
- * @return the context
- */
- PortletApplicationContext getContext();
-
- /**
- * Wire a container.
- *
- * @param container the container
- */
- void addContainer(PortletContainer container);
-
- /**
- * Unwire a container.
- *
- * @param container the container
- */
- void removeContainer(PortletContainer container);
-
- /**
* Returns the set of related portlet containers.
*
* @return the portlet containers
@@ -82,15 +55,7 @@
*/
PortletContainer getPortletContainer(String containerId);
- /**
- * Starts the application only. It does not take care of starting its components.
- *
- * @throws Exception any exception preventing the start
- */
- void start() throws Exception;
+ PortletApplicationContext getContext();
- /**
- * Stops the application only. It does not take care of stopping its components.
- */
- void stop();
+
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletContainer.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletContainer.java 2008-02-19 13:23:47 UTC (rev 10029)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletContainer.java 2008-02-19 14:07:50 UTC (rev 10030)
@@ -22,7 +22,6 @@
******************************************************************************/
package org.jboss.portal.portlet.container;
-import org.jboss.portal.common.concurrent.Valve;
import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.info.PortletInfo;
@@ -51,27 +50,6 @@
PortletInfo getInfo();
/**
- * Wire the application.
- *
- * @param application the related application
- */
- void setApplication(PortletApplication application);
-
- /**
- * Returns the wired application.
- *
- * @return the application
- */
- PortletApplication getApplication();
-
- /**
- * Wire the portlet container context.
- *
- * @param context the context
- */
- void setContext(PortletContainerContext context);
-
- /**
* Invoke the portlet container.
*
* @param invocation the portlet invocation
@@ -82,14 +60,11 @@
PortletInvocationResponse dispatch(PortletInvocation invocation) throws PortletInvokerException, InvocationException;
/**
- * Starts the portlet container.
+ * Returns the wired application.
*
- * @throws Exception any exception preventing the start
+ * @return the application
*/
- void start() throws Exception;
+ PortletApplication getApplication();
- /**
- * Stops the portlet container.
- */
- void stop();
+ PortletContainerContext getContext();
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletContainerInvoker.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletContainerInvoker.java 2008-02-19 13:23:47 UTC (rev 10029)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletContainerInvoker.java 2008-02-19 14:07:50 UTC (rev 10030)
@@ -119,11 +119,11 @@
this.portlets = portlets;
}
- public synchronized void start() throws Exception
+ public void start() throws Exception
{
}
- public synchronized void stop() throws Exception
+ public void stop() throws Exception
{
}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/object/PortletApplicationObject.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/object/PortletApplicationObject.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/object/PortletApplicationObject.java 2008-02-19 14:07:50 UTC (rev 10030)
@@ -0,0 +1,77 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.container.object;
+
+import org.jboss.portal.portlet.container.PortletApplicationContext;
+import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.container.PortletApplication;
+
+/**
+ * Contains life cycle and wiring details for the kernel environment.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface PortletApplicationObject extends PortletApplication
+{
+
+ /**
+ * Set the context required by that application.
+ *
+ * @param context the context
+ */
+ void setContext(PortletApplicationContext context);
+
+ /**
+ * Returns the context related to this application.
+ *
+ * @return the context
+ */
+ PortletApplicationContext getContext();
+
+ /**
+ * Wire a container.
+ *
+ * @param container the container
+ */
+ void addContainer(PortletContainer container);
+
+ /**
+ * Unwire a container.
+ *
+ * @param container the container
+ */
+ void removeContainer(PortletContainer container);
+
+ /**
+ * Starts the application only. It does not take care of starting its components.
+ *
+ * @throws Exception any exception preventing the start
+ */
+ void start() throws Exception;
+
+ /**
+ * Stops the application only. It does not take care of stopping its components.
+ */
+ void stop();
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/object/PortletContainerObject.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/object/PortletContainerObject.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/object/PortletContainerObject.java 2008-02-19 14:07:50 UTC (rev 10030)
@@ -0,0 +1,63 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.container.object;
+
+import org.jboss.portal.portlet.container.PortletApplication;
+import org.jboss.portal.portlet.container.PortletContainerContext;
+import org.jboss.portal.portlet.container.PortletContainer;
+
+/**
+ * Contains life cycle and wiring details for the kernel environment.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface PortletContainerObject extends PortletContainer
+{
+
+ /**
+ * Wire the application.
+ *
+ * @param application the related application
+ */
+ void setApplication(PortletApplication application);
+
+ /**
+ * Wire the portlet container context.
+ *
+ * @param context the context
+ */
+ void setContext(PortletContainerContext context);
+
+ /**
+ * Starts the portlet container.
+ *
+ * @throws Exception any exception preventing the start
+ */
+ void start() throws Exception;
+
+ /**
+ * Stops the portlet container.
+ */
+ void stop();
+}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java 2008-02-19 13:23:47 UTC (rev 10029)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java 2008-02-19 14:07:50 UTC (rev 10030)
@@ -35,6 +35,7 @@
import org.jboss.portal.portlet.container.PortletApplicationContext;
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.container.PortletInitializationException;
+import org.jboss.portal.portlet.container.object.PortletApplicationObject;
import org.jboss.portal.portlet.LifeCyclePhase;
import org.apache.log4j.Logger;
@@ -59,7 +60,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 7226 $
*/
-public class PortletApplicationImpl implements PortletApplication
+public class PortletApplicationImpl implements PortletApplicationObject
{
private static final EnumMap<LifeCyclePhase, Class<? extends PortletFilter>> phaseToType =
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java 2008-02-19 13:23:47 UTC (rev 10029)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java 2008-02-19 14:07:50 UTC (rev 10030)
@@ -28,9 +28,9 @@
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.container.PortletContainerContext;
+import org.jboss.portal.portlet.container.object.PortletContainerObject;
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;
@@ -91,7 +91,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 6365 $
*/
-public class PortletContainerImpl implements PortletContainer
+public class PortletContainerImpl implements PortletContainerObject
{
/** Logger. */
@@ -164,6 +164,11 @@
this.context = context;
}
+ public PortletContainerContext getContext()
+ {
+ return context;
+ }
+
public ContainerPortletInfo getInfo()
{
if (started)
@@ -428,6 +433,26 @@
public PortletInvocationResponse dispatch(PortletInvocation invocation) throws PortletInvokerException, InvocationException
{
+ if (valve.beforeInvocation())
+ {
+ try
+ {
+ return invokeDispatch(invocation);
+ }
+ finally
+ {
+ // Release the valve
+ valve.afterInvocation();
+ }
+ }
+ else
+ {
+ return new UnavailableResponse();
+ }
+ }
+
+ private PortletInvocationResponse invokeDispatch(PortletInvocation invocation) throws PortletInvokerException, InvocationException
+ {
HttpServletRequest dreq = invocation.getDispatchedRequest();
HttpServletResponse dresp = invocation.getDispatchedResponse();
18 years, 2 months
JBoss Portal SVN: r10029 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl/container and 4 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-19 08:23:47 -0500 (Tue, 19 Feb 2008)
New Revision: 10029
Removed:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/PortletApplicationRegistrationContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/PortletApplicationRegistryListener.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationRegistryImpl.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/ManagedPortletApplication.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/ManagedPortletContainer.java
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedPortletApplication.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedPortletContainer.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/PortletApplicationRegistry.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/CacheInfoTest.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/CapabilitiesInfoTest.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/MetaInfoTest.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/ModeInfoTest.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/PortletInfoTest.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/PreferenceInfoTest.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/SecurityInfoTest.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/SessionInfoTest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletApplication.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletContainer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployer.java
modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/jboss-beans.xml
Log:
consolidate the portlet application registry with the managed objects
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedPortletApplication.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedPortletApplication.java 2008-02-19 12:14:38 UTC (rev 10028)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedPortletApplication.java 2008-02-19 13:23:47 UTC (rev 10029)
@@ -39,4 +39,6 @@
Collection<? extends ManagedPortletContainer> getManagedPortletContainers();
+ ManagedPortletContainer getManagedPortletContainer(String portletContainerId);
+
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedPortletContainer.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedPortletContainer.java 2008-02-19 12:14:38 UTC (rev 10028)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedPortletContainer.java 2008-02-19 13:23:47 UTC (rev 10029)
@@ -33,7 +33,7 @@
String getId();
- PortletInfo getPortletInfo();
+ PortletInfo getInfo();
ManagedPortletApplication getManagedPortletApplication();
Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/PortletApplicationRegistrationContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/PortletApplicationRegistrationContext.java 2008-02-19 12:14:38 UTC (rev 10028)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/PortletApplicationRegistrationContext.java 2008-02-19 13:23:47 UTC (rev 10029)
@@ -1,49 +0,0 @@
-/******************************************************************************
- * 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. *
- ******************************************************************************/
-package org.jboss.portal.portlet.container.managed;
-
-import org.jboss.portal.portlet.container.PortletContainer;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface PortletApplicationRegistrationContext
-{
-
- /**
- * Register a portlet.
- *
- * @param portletContainer the portlet container
- */
- void registerPortlet(PortletContainer portletContainer);
-
- /**
- * Unregister a portlet.
- *
- * @param portletContainer the portlet container
- */
- void unregisterPortlet(PortletContainer portletContainer);
-
-
-}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/PortletApplicationRegistry.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/PortletApplicationRegistry.java 2008-02-19 12:14:38 UTC (rev 10028)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/PortletApplicationRegistry.java 2008-02-19 13:23:47 UTC (rev 10029)
@@ -22,8 +22,6 @@
******************************************************************************/
package org.jboss.portal.portlet.container.managed;
-import org.jboss.portal.portlet.container.PortletApplication;
-
import java.util.Collection;
/**
@@ -33,39 +31,20 @@
*/
public interface PortletApplicationRegistry
{
- /**
- * Register a portlet application.
- *
- * @param portletApplication the portlet application to register
- * @throws IllegalArgumentException if the portlet application is null or already registered
- */
- PortletApplicationRegistrationContext registerPortletApplication(PortletApplication portletApplication) throws IllegalArgumentException;
/**
- * Unregister a portlet application.
+ * Return an immutable list all the known portlet application in the registry.
*
- * @param portletApplication the portlet application to unregister
- * @throws IllegalArgumentException if the portlet application is null or not registered
+ * @return the registered portlet applications
*/
- void unregisterPortletApplication(PortletApplication portletApplication) throws IllegalArgumentException;
+ Collection<? extends ManagedPortletApplication> getManagedPortletApplications();
- /** Return an immutable list all the known portlet application in the registry. */
- Collection<PortletApplication> getPortletApplications();
-
- /** Return a portlet app using its id or null if it does not exist. */
- PortletApplication getPortletApplication(String id);
-
/**
- * Adds a portlet container registry listener.
+ * Return a portlet app using its id or null if it does not exist.
*
- * @param listener
+ * @param id the portlet application id
+ * @return a specified registered portlet application
*/
- void addListener(PortletApplicationRegistryListener listener);
+ ManagedPortletApplication getManagedPortletApplication(String id);
- /**
- * Removes a portlet container registry listener.
- *
- * @param listener
- */
- void removeListener(PortletApplicationRegistryListener listener);
}
Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/PortletApplicationRegistryListener.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/PortletApplicationRegistryListener.java 2008-02-19 12:14:38 UTC (rev 10028)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/PortletApplicationRegistryListener.java 2008-02-19 13:23:47 UTC (rev 10029)
@@ -1,43 +0,0 @@
-/******************************************************************************
- * 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. *
- ******************************************************************************/
-package org.jboss.portal.portlet.container.managed;
-
-import org.jboss.portal.portlet.container.PortletContainer;
-
-/**
- * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
- */
-public interface PortletApplicationRegistryListener
-{
-
- /**
- * A portlet container has been registered.
- */
- void portletContainerRegistered(PortletContainer portletContainer);
-
- /**
- * A portlet container has been unregistered.
- */
- void portletContainerUnregistered(PortletContainer portletContainer);
-
-}
Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationRegistryImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationRegistryImpl.java 2008-02-19 12:14:38 UTC (rev 10028)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationRegistryImpl.java 2008-02-19 13:23:47 UTC (rev 10029)
@@ -1,249 +0,0 @@
-/******************************************************************************
- * 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. *
- ******************************************************************************/
-package org.jboss.portal.portlet.impl.container;
-
-import org.jboss.portal.portlet.container.managed.PortletApplicationRegistry;
-import org.jboss.portal.portlet.container.managed.PortletApplicationRegistrationContext;
-import org.jboss.portal.portlet.container.PortletApplication;
-import org.jboss.portal.portlet.container.managed.PortletApplicationRegistryListener;
-import org.jboss.portal.portlet.container.PortletContainer;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
- * @version $Revision: 6720 $
- */
-public class PortletApplicationRegistryImpl implements PortletApplicationRegistry
-{
-
- /** . */
- private Map<String, PortletApplication> portletApplications = new HashMap<String, PortletApplication>();
-
- /** . */
- private Map<ContainerKey, PortletContainer> portletContainers = new HashMap<ContainerKey, PortletContainer>();
-
- /** . */
- private List<PortletApplicationRegistryListener> listeners = new ArrayList<PortletApplicationRegistryListener>();
-
- public PortletApplicationRegistrationContext registerPortletApplication(PortletApplication portletApplication)
- {
- if (portletApplication == null)
- {
- throw new IllegalArgumentException("No null portlet app accepted");
- }
- synchronized (this)
- {
- String key = portletApplication.getId();
- if (portletApplications.containsKey(key))
- {
- throw new IllegalArgumentException("This portlet app is already registered: " + key);
- }
- PortletApplicationRegistrationContext ctx = new PortletApplicationRegistrationContextImpl(portletApplication);
- Map<String, PortletApplication> webAppsCopy = new HashMap<String, PortletApplication>(portletApplications);
- webAppsCopy.put(key, portletApplication);
- portletApplications = webAppsCopy;
- return ctx;
- }
- }
-
- public void unregisterPortletApplication(PortletApplication portletApplication)
- {
- if (portletApplication == null)
- {
- throw new IllegalArgumentException("No null portlet app accepted");
- }
- synchronized (this)
- {
- String key = portletApplication.getId();
- if (!portletApplications.containsKey(key))
- {
- throw new IllegalArgumentException("This portlet app does not exist here: " + key);
- }
- Map<String, PortletApplication> webAppsCopy = new HashMap<String, PortletApplication>(portletApplications);
- webAppsCopy.remove(key);
- portletApplications = webAppsCopy;
- }
- }
-
- public Collection<PortletApplication> getPortletApplications()
- {
- return Collections.unmodifiableCollection(portletApplications.values());
- }
-
- public PortletApplication getPortletApplication(String id)
- {
- return portletApplications.get(id);
- }
-
- public void addListener(PortletApplicationRegistryListener listener)
- {
- if (listener == null)
- {
- throw new IllegalArgumentException("No null listener accepted");
- }
- else
- {
- synchronized (this)
- {
- listeners.add(listener);
- }
- }
- }
-
- public void removeListener(PortletApplicationRegistryListener listener)
- {
- if (listener == null)
- {
- throw new IllegalArgumentException("No null listener accepted");
- }
- else
- {
- synchronized (this)
- {
- listeners.remove(listener);
- }
- }
- }
-
- private void fireRegisterPortletContainerEvent(PortletContainer portlet)
- {
- for (PortletApplicationRegistryListener listener : listeners)
- {
- listener.portletContainerRegistered(portlet);
- }
- }
-
- private void fireUnregisterPortletContainerEvent(PortletContainer portlet)
- {
- for (PortletApplicationRegistryListener listener : listeners)
- {
- listener.portletContainerUnregistered(portlet);
- }
- }
-
- private static class ContainerKey
- {
- /** . */
- private final String applicationId;
-
- /** . */
- private final String containerId;
-
- public ContainerKey(PortletContainer container)
- {
- this.applicationId = container.getApplication().getId();
- this.containerId = container.getId();
- }
-
- public boolean equals(Object obj)
- {
- if (obj == this)
- {
- return true;
- }
- if (obj instanceof ContainerKey)
- {
- ContainerKey that = (ContainerKey)obj;
- return applicationId.equals(that.applicationId) && containerId.equals(containerId);
- }
- return false;
- }
-
- public int hashCode()
- {
- return applicationId.hashCode() & containerId.hashCode();
- }
- }
-
- private class PortletApplicationRegistrationContextImpl implements PortletApplicationRegistrationContext
- {
-
- /** . */
- private PortletApplication portletApplication;
-
- /** . */
- private boolean active;
-
- public PortletApplicationRegistrationContextImpl(PortletApplication portletApplication)
- {
- this.portletApplication = portletApplication;
- this.active = true;
- }
-
- public void registerPortlet(PortletContainer portletContainer)
- {
- if (portletContainer == null)
- {
- throw new IllegalArgumentException("No null portlet accepted");
- }
- if (portletContainer.getApplication() != portletApplication)
- {
- throw new IllegalArgumentException("The container does not belong to the application owning the registration");
- }
- if (!active)
- {
- throw new IllegalStateException("Not anymore active");
- }
- synchronized (this)
- {
- Map<ContainerKey, PortletContainer> componentsCopy = new HashMap<ContainerKey, PortletContainer>(portletContainers);
- componentsCopy.put(new ContainerKey(portletContainer), portletContainer);
- portletContainers = componentsCopy;
-
- //
- fireRegisterPortletContainerEvent(portletContainer);
- }
- }
-
- public void unregisterPortlet(PortletContainer portletContainer)
- {
- if (portletContainer == null)
- {
- throw new IllegalArgumentException("No null portlet accepted");
- }
- if (portletContainer.getApplication() != portletApplication)
- {
- throw new IllegalArgumentException("The container does not belong to the application owning the registration");
- }
- if (!active)
- {
- throw new IllegalStateException("Not anymore active");
- }
- synchronized (this)
- {
- Map<ContainerKey, PortletContainer> componentsCopy = new HashMap<ContainerKey, PortletContainer>(portletContainers);
- ContainerKey key = new ContainerKey(portletContainer);
- componentsCopy.remove(key);
- portletContainers = componentsCopy;
- fireUnregisterPortletContainerEvent(portletContainer);
- }
- }
- }
-}
Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/CacheInfoTest.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/CacheInfoTest.java 2008-02-19 12:14:38 UTC (rev 10028)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/CacheInfoTest.java 2008-02-19 13:23:47 UTC (rev 10029)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.info;
-import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.container.managed.ManagedPortletContainer;
import org.jboss.portal.portlet.info.CacheInfo;
import org.jboss.portal.portlet.info.PortletInfo;
@@ -42,7 +42,7 @@
public void execute()
{
- PortletContainer container = registry.getPortletApplication("/test-info").getPortletContainer("CachePortlet");
+ ManagedPortletContainer container = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("CachePortlet");
PortletInfo info = container.getInfo();
CacheInfo cacheInfo = info.getCache();
assertEquals(65, cacheInfo.getExpirationSecs());
Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/CapabilitiesInfoTest.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/CapabilitiesInfoTest.java 2008-02-19 12:14:38 UTC (rev 10028)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/CapabilitiesInfoTest.java 2008-02-19 13:23:47 UTC (rev 10029)
@@ -25,7 +25,7 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
-import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.container.managed.ManagedPortletContainer;
import org.jboss.portal.portlet.info.CapabilitiesInfo;
import org.jboss.portal.portlet.info.ModeInfo;
import org.jboss.portal.portlet.info.PortletInfo;
@@ -52,7 +52,7 @@
public void execute()
{
- PortletContainer container = registry.getPortletApplication("/test-info").getPortletContainer("CapabilitiesPortlet");
+ ManagedPortletContainer container = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("CapabilitiesPortlet");
PortletInfo info = container.getInfo();
CapabilitiesInfo capInfo = info.getCapabilities();
Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/MetaInfoTest.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/MetaInfoTest.java 2008-02-19 12:14:38 UTC (rev 10028)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/MetaInfoTest.java 2008-02-19 13:23:47 UTC (rev 10029)
@@ -23,7 +23,7 @@
package org.jboss.portal.test.portlet.info;
import org.jboss.portal.common.i18n.LocalizedString;
-import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.container.managed.ManagedPortletContainer;
import org.jboss.portal.portlet.info.MetaInfo;
import org.jboss.portal.portlet.info.PortletInfo;
@@ -45,7 +45,7 @@
public void execute()
{
- PortletContainer container = registry.getPortletApplication("/test-info").getPortletContainer("NoBundlePortlet");
+ ManagedPortletContainer container = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("NoBundlePortlet");
PortletInfo info = container.getInfo();
MetaInfo metaInfo = info.getMeta();
Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/ModeInfoTest.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/ModeInfoTest.java 2008-02-19 12:14:38 UTC (rev 10028)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/ModeInfoTest.java 2008-02-19 13:23:47 UTC (rev 10029)
@@ -23,7 +23,7 @@
package org.jboss.portal.test.portlet.info;
import org.jboss.portal.Mode;
-import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.container.managed.ManagedPortletContainer;
import org.jboss.portal.portlet.info.CapabilitiesInfo;
import org.jboss.portal.portlet.info.ModeInfo;
@@ -47,8 +47,8 @@
public void execute()
{
- PortletContainer container1 = registry.getPortletApplication("/test-info").getPortletContainer("ModePortlet1");
- PortletContainer container2 = registry.getPortletApplication("/test-info").getPortletContainer("ModePortlet2");
+ ManagedPortletContainer container1 = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("ModePortlet1");
+ ManagedPortletContainer container2 = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("ModePortlet2");
CapabilitiesInfo capaInfo = container1.getInfo().getCapabilities();
//Portlet 1 with VIEW, EDIT, HELP
Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/PortletInfoTest.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/PortletInfoTest.java 2008-02-19 12:14:38 UTC (rev 10028)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/PortletInfoTest.java 2008-02-19 13:23:47 UTC (rev 10029)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.info;
-import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.container.managed.ManagedPortletContainer;
import org.jboss.portal.portlet.info.PortletInfo;
import static org.jboss.unit.api.Assert.*;
@@ -42,7 +42,7 @@
public void execute()
{
//This asserts only .isRemotable() as rest is checked in other tests
- PortletContainer container = registry.getPortletApplication("/test-info").getPortletContainer("RemotablePortlet1");
+ ManagedPortletContainer container = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("RemotablePortlet1");
PortletInfo info = container.getInfo();
assertEquals(Boolean.TRUE, info.isRemotable());
@@ -54,11 +54,11 @@
assertNotNull(info.getSecurity());
assertNotNull(info.getSession());
- container = registry.getPortletApplication("/test-info").getPortletContainer("RemotablePortlet2");
+ container = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("RemotablePortlet2");
info = container.getInfo();
assertEquals(Boolean.FALSE, info.isRemotable());
- container = registry.getPortletApplication("/test-info").getPortletContainer("RemotablePortlet3");
+ container = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("RemotablePortlet3");
info = container.getInfo();
assertEquals(Boolean.TRUE, info.isRemotable());
}
Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/PreferenceInfoTest.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/PreferenceInfoTest.java 2008-02-19 12:14:38 UTC (rev 10028)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/PreferenceInfoTest.java 2008-02-19 13:23:47 UTC (rev 10029)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.info;
-import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.container.managed.ManagedPortletContainer;
import org.jboss.portal.portlet.impl.info.ContainerPreferenceInfo;
import org.jboss.portal.portlet.impl.info.ContainerPreferencesInfo;
import org.jboss.portal.portlet.info.PortletInfo;
@@ -46,7 +46,7 @@
public void execute()
{
- PortletContainer container = registry.getPortletApplication("/test-info").getPortletContainer("PreferenceInfoPortlet");
+ ManagedPortletContainer container = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("PreferenceInfoPortlet");
//
PortletInfo info = container.getInfo();
Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/SecurityInfoTest.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/SecurityInfoTest.java 2008-02-19 12:14:38 UTC (rev 10028)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/SecurityInfoTest.java 2008-02-19 13:23:47 UTC (rev 10029)
@@ -23,7 +23,7 @@
package org.jboss.portal.test.portlet.info;
import org.jboss.portal.portlet.TransportGuarantee;
-import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.container.managed.ManagedPortletContainer;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.info.SecurityInfo;
@@ -45,7 +45,7 @@
{
//This asserts only .isRemotable() as rest is checked in other tests
- PortletContainer container = registry.getPortletApplication("/test-info").getPortletContainer("SecuredPortlet1");
+ ManagedPortletContainer container = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("SecuredPortlet1");
PortletInfo info = container.getInfo();
SecurityInfo secInfo = info.getSecurity();
@@ -56,7 +56,7 @@
assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.NONE));
- container = registry.getPortletApplication("/test-info").getPortletContainer("SecuredPortlet2");
+ container = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("SecuredPortlet2");
info = container.getInfo();
secInfo = info.getSecurity();
@@ -66,7 +66,7 @@
assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.NONE));
- container = registry.getPortletApplication("/test-info").getPortletContainer("SecuredPortlet3");
+ container = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("SecuredPortlet3");
info = container.getInfo();
secInfo = info.getSecurity();
assertEquals(2, secInfo.getTransportGuarantees().size());
Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/SessionInfoTest.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/SessionInfoTest.java 2008-02-19 12:14:38 UTC (rev 10028)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/SessionInfoTest.java 2008-02-19 13:23:47 UTC (rev 10029)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.info;
-import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.container.managed.ManagedPortletContainer;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.info.SessionInfo;
@@ -42,7 +42,7 @@
public void execute()
{
- PortletContainer container = registry.getPortletApplication("/test-info").getPortletContainer("DistributedPortlet1");
+ ManagedPortletContainer container = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("DistributedPortlet1");
PortletInfo info = container.getInfo();
SessionInfo sessionInfo = info.getSession();
assertNotNull(sessionInfo);
@@ -50,7 +50,7 @@
assertEquals(Boolean.TRUE, distributed);
- container = registry.getPortletApplication("/test-info").getPortletContainer("DistributedPortlet2");
+ container = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("DistributedPortlet2");
info = container.getInfo();
sessionInfo = info.getSession();
assertNotNull(sessionInfo);
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletApplication.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletApplication.java 2008-02-19 12:14:38 UTC (rev 10028)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletApplication.java 2008-02-19 13:23:47 UTC (rev 10029)
@@ -133,4 +133,9 @@
{
return kernelPortletContainers.values();
}
+
+ public ManagedPortletContainer getManagedPortletContainer(String portletContainerId)
+ {
+ return kernelPortletContainers.get(portletContainerId);
+ }
}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletContainer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletContainer.java 2008-02-19 12:14:38 UTC (rev 10028)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletContainer.java 2008-02-19 13:23:47 UTC (rev 10029)
@@ -94,7 +94,7 @@
return kernelPortletApplication;
}
- public PortletInfo getPortletInfo()
+ public PortletInfo getInfo()
{
return portletContainer.getInfo();
}
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/ManagedPortletApplication.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/ManagedPortletApplication.java 2008-02-19 12:14:38 UTC (rev 10028)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/ManagedPortletApplication.java 2008-02-19 13:23:47 UTC (rev 10029)
@@ -1,111 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, 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.test;
-
-import org.jboss.portal.portlet.container.PortletApplicationContext;
-import org.jboss.portal.portlet.container.PortletApplication;
-import org.jboss.portal.web.WebApp;
-import org.jboss.portal.common.NotYetImplemented;
-
-import javax.servlet.ServletContext;
-import java.util.Map;
-import java.util.HashMap;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class ManagedPortletApplication implements PortletApplicationContext
-{
-
- /** . */
- private final WebApp webApp;
-
- /** . */
- private PortletApplication portletApplication;
-
- /** . */
- private final Map<String, ManagedPortletContainer> managedPortletContainers;
-
- public ManagedPortletApplication(WebApp webApp)
- {
- this.webApp = webApp;
- this.portletApplication = null;
- this.managedPortletContainers = new HashMap<String, ManagedPortletContainer>();
- }
-
- public void addManagedPortletContainer(ManagedPortletContainer managedPortletContainer)
- {
- managedPortletContainers.put(managedPortletContainer.getPortletContainer().getId(), managedPortletContainer);
- }
-
- public void removeManagedPortletContainer(ManagedPortletContainer managedPortletContainer)
- {
- managedPortletContainers.remove(managedPortletContainer.getPortletContainer().getId());
- }
-
- public PortletApplication getPortletApplication()
- {
- return portletApplication;
- }
-
- public void setPortletApplication(PortletApplication portletApplication)
- {
- this.portletApplication = portletApplication;
- }
-
- public void start() throws Exception
- {
- }
-
- public void stop()
- {
- }
-
- // PortletApplicationContext ****************************************************************************************
-
- public ServletContext getServletContext()
- {
- return webApp.getServletContext();
- }
-
- public String getContextPath()
- {
- return webApp.getContextPath();
- }
-
- public ClassLoader getClassLoader()
- {
- return webApp.getClassLoader();
- }
-
- public void invokeStart() throws Exception
- {
- throw new NotYetImplemented();
- }
-
- public void invokeStop()
- {
- throw new NotYetImplemented();
- }
-}
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/ManagedPortletContainer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/ManagedPortletContainer.java 2008-02-19 12:14:38 UTC (rev 10028)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/ManagedPortletContainer.java 2008-02-19 13:23:47 UTC (rev 10029)
@@ -1,81 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, 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.test;
-
-import org.jboss.portal.portlet.container.PortletContainerContext;
-import org.jboss.portal.portlet.container.PortletContainer;
-import org.jboss.portal.common.NotYetImplemented;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class ManagedPortletContainer implements PortletContainerContext
-{
-
- /** . */
- private PortletContainer portletContainer;
-
- /** . */
- private ManagedPortletApplication managedPortletApplication;
-
- public ManagedPortletApplication getManagedPortletApplication()
- {
- return managedPortletApplication;
- }
-
- public void setManagedPortletApplication(ManagedPortletApplication managedPortletApplication)
- {
- this.managedPortletApplication = managedPortletApplication;
- }
-
- public PortletContainer getPortletContainer()
- {
- return portletContainer;
- }
-
- public void setPortletContainer(PortletContainer portletContainer)
- {
- this.portletContainer = portletContainer;
- }
-
- public void start() throws Exception
- {
- }
-
- public void stop()
- {
- }
-
- //
-
- public void invokeStart() throws Exception
- {
- throw new NotYetImplemented();
- }
-
- public void invokeStop()
- {
- throw new NotYetImplemented();
- }
-}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployer.java 2008-02-19 12:14:38 UTC (rev 10028)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployer.java 2008-02-19 13:23:47 UTC (rev 10029)
@@ -27,10 +27,8 @@
import org.jboss.kernel.spi.dependency.KernelControllerContext;
import org.jboss.kernel.spi.dependency.KernelControllerContextAware;
import org.jboss.portal.common.io.IOTools;
-import org.jboss.portal.portlet.container.PortletApplication;
-import org.jboss.portal.portlet.container.managed.PortletApplicationRegistrationContext;
import org.jboss.portal.portlet.container.managed.PortletApplicationRegistry;
-import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.container.managed.ManagedPortletApplication;
import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
import static org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants.PORTLET_JSR_168_NS;
import static org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants.PORTLET_JSR_286_NS;
@@ -54,12 +52,13 @@
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
+import java.util.Collection;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class PortletApplicationDeployer implements WebAppListener, KernelControllerContextAware
+public class PortletApplicationDeployer implements WebAppListener, KernelControllerContextAware, PortletApplicationRegistry
{
static
@@ -100,8 +99,7 @@
private ClassLoader classLoader;
/** . */
- private final Map<KernelPortletApplication, PortletApplicationRegistrationContext> registrationContextMap =
- new HashMap<KernelPortletApplication, PortletApplicationRegistrationContext>();
+ private final Map<String, KernelPortletApplication> applications = new HashMap<String, KernelPortletApplication>();
public PortletApplicationRegistry getRegistry()
{
@@ -269,36 +267,53 @@
return null;
}
- /** Called by MC to install application. */
- public void addManagedPortletApplication(KernelPortletApplication kernelPortletApplication)
+ /**
+ * Called by MC to install application.
+ *
+ * @param kernelPortletApplication kernel portlet application
+ */
+ public void addKernelPortletApplication(KernelPortletApplication kernelPortletApplication)
{
- PortletApplication portletApplication = kernelPortletApplication.getPortletApplication();
- PortletApplicationRegistrationContext context = registry.registerPortletApplication(portletApplication);
- registrationContextMap.put(kernelPortletApplication, context);
+ applications.put(kernelPortletApplication.getId(), kernelPortletApplication);
}
- /** Called by MC to install container. */
- public void addManagedPortletContainer(KernelPortletContainer kernelPortletContainer)
+ /**
+ * Called by MC to uninstall application.
+ *
+ * @param kernelPortletApplication kernel portlet application
+ */
+ public void removeKernelPortletApplication(KernelPortletApplication kernelPortletApplication)
{
- KernelPortletApplication kernelPortletApplication = kernelPortletContainer.getKernelPortletApplication();
- PortletApplicationRegistrationContext context = registrationContextMap.get(kernelPortletApplication);
- PortletContainer portletContainer = kernelPortletContainer.getPortletContainer();
- context.registerPortlet(portletContainer);
+ applications.remove(kernelPortletApplication.getId());
}
- /** Called by MC to uninstall application. */
- public void removeManagedPortletApplication(KernelPortletApplication kernelPortletApplication)
+ /**
+ * Called by MC to install application.
+ *
+ * @param kernelPortletContainer kernel portlet container
+ */
+ public void addKernelPortletContainer(KernelPortletContainer kernelPortletContainer)
{
- PortletApplication portletApplication = kernelPortletApplication.getPortletApplication();
- registry.unregisterPortletApplication(portletApplication);
+ // To be used for life cycle events
}
- /** Called by MC to uninstall container. */
- public void removeManagedPortletContainer(KernelPortletContainer kernelPortletContainer)
+ /**
+ * Called by MC to uninstall application.
+ *
+ * @param kernelPortletContainer kernel portlet container
+ */
+ public void removeKernelPortletContainer(KernelPortletContainer kernelPortletContainer)
{
- KernelPortletApplication kernelPortletApplication = kernelPortletContainer.getKernelPortletApplication();
- PortletApplicationRegistrationContext context = registrationContextMap.get(kernelPortletApplication);
- PortletContainer portletContainer = kernelPortletContainer.getPortletContainer();
- context.unregisterPortlet(portletContainer);
+ // To be used for life cycle events
}
+
+ public Collection<? extends ManagedPortletApplication> getManagedPortletApplications()
+ {
+ return applications.values();
+ }
+
+ public ManagedPortletApplication getManagedPortletApplication(String id)
+ {
+ return applications.get(id);
+ }
}
Modified: modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml
===================================================================
--- modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml 2008-02-19 12:14:38 UTC (rev 10028)
+++ modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml 2008-02-19 13:23:47 UTC (rev 10029)
@@ -34,18 +34,13 @@
</constructor>
</bean>
- <!-- An application registry mainly for listeners -->
- <bean name="PortletApplicationRegistry"
- class="org.jboss.portal.portlet.impl.container.PortletApplicationRegistryImpl"/>
-
<bean name="PortletApplicationDeployer" class="org.jboss.portal.portlet.test.TestPortletApplicationDeployer">
- <property name="registry"><inject bean="PortletApplicationRegistry"/></property>
<property name="servletContainer"><inject bean="ServletContainer"/></property>
<property name="driver"><inject bean="TestDriverServer"/></property>
- <incallback method="addManagedPortletApplication"/>
- <uncallback method="removeManagedPortletApplication"/>
- <incallback method="addManagedPortletContainer"/>
- <uncallback method="removeManagedPortletContainer"/>
+ <incallback method="addKernelPortletApplication"/>
+ <uncallback method="removeKernelPortletApplication"/>
+ <incallback method="addKernelPortletContainer"/>
+ <uncallback method="removeKernelPortletContainer"/>
</bean>
<bean name="PortletAPIFactory" class="org.jboss.portal.portlet.impl.jsr168.PortletAPIFactoryImpl"/>
Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/jboss-beans.xml
===================================================================
--- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/jboss-beans.xml 2008-02-19 12:14:38 UTC (rev 10028)
+++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/jboss-beans.xml 2008-02-19 13:23:47 UTC (rev 10029)
@@ -23,17 +23,12 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<deployment xmlns="urn:jboss:bean-deployer:2.0">
- <!-- An application registry mainly for listeners -->
- <bean name="PortletApplicationRegistry"
- class="org.jboss.portal.portlet.impl.container.PortletApplicationRegistryImpl"/>
-
<bean name="PortletApplicationDeployer" class="org.jboss.portal.portlet.test.PortletApplicationDeployer">
- <property name="registry"><inject bean="PortletApplicationRegistry"/></property>
<property name="servletContainer"><inject bean="ServletContainer"/></property>
- <incallback method="addManagedPortletApplication"/>
- <uncallback method="removeManagedPortletApplication"/>
- <incallback method="addManagedPortletContainer"/>
- <uncallback method="removeManagedPortletContainer"/>
+ <incallback method="addKernelPortletApplication"/>
+ <uncallback method="removeKernelPortletApplication"/>
+ <incallback method="addKernelPortletContainer"/>
+ <uncallback method="removeKernelPortletContainer"/>
</bean>
<bean name="PortletAPIFactory" class="org.jboss.portal.portlet.impl.jsr168.PortletAPIFactoryImpl"/>
18 years, 2 months
JBoss Portal SVN: r10028 - modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-19 07:14:38 -0500 (Tue, 19 Feb 2008)
New Revision: 10028
Removed:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java
Log:
remove very obsolete class
Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java 2008-02-19 12:08:48 UTC (rev 10027)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java 2008-02-19 12:14:38 UTC (rev 10028)
@@ -1,204 +0,0 @@
-/******************************************************************************
- * 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. *
- ******************************************************************************/
-package org.jboss.portal.portlet.impl.container;
-
-import org.jboss.portal.portlet.container.PortletApplicationContext;
-import org.jboss.portal.portlet.container.managed.PortletApplicationRegistrationContext;
-import org.jboss.portal.portlet.container.managed.PortletApplicationRegistry;
-import org.jboss.portal.portlet.container.PortletContainer;
-import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl;
-import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory;
-import org.jboss.portal.portlet.impl.jsr168.spi.PortletInfoFactory;
-import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
-import org.jboss.portal.portlet.metadata.JBossApplicationMetaData;
-import org.jboss.portal.common.FixMe;
-
-import javax.servlet.ServletContext;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 6697 $
- */
-public class PortletApplicationContextImpl implements PortletApplicationContext
-{
-
- /** . */
- private final PortletAPIFactory portletAPIFactory;
-
- /** . */
- private final PortletApplication10MetaData portletAppMD;
-
- /** . */
- private final JBossApplicationMetaData jbossAppMD;
-
- /** . */
- private final ServletContext servletContext;
-
- /** . */
- private final ClassLoader classLoader;
-
- /** . */
- private PortletApplicationImpl portletApp;
-
- /** . */
- private PortletApplicationRegistry registry;
-
- /** . */
- private PortletApplicationRegistrationContext registrationContext;
-
- /** . */
- private String contextPath;
-
- public PortletApplicationContextImpl(
- PortletApplicationRegistry registry,
- PortletAPIFactory portletAPIFactory,
- PortletInfoFactory portletInfoFactory,
- PortletApplication10MetaData portletAppMD,
- JBossApplicationMetaData jbossAppMD,
- ServletContext servletContext,
- ClassLoader classLoader,
- String contextPath)
- {
- this.registry = registry;
- this.portletAPIFactory = portletAPIFactory;
- this.portletAppMD = portletAppMD;
- this.jbossAppMD = jbossAppMD;
- this.servletContext = servletContext;
- this.classLoader = classLoader;
- this.contextPath = contextPath;
- }
-
- public PortletApplicationImpl getPortletApplication()
- {
- return portletApp;
- }
-
- // PortletApplicationContext implementation *************************************************************************
-
- public void invokeStart() throws Exception
- {
- throw new FixMe("Not used anymore for now, check or reimplement in 2.6");
-/*
- portletApp = new PortletApplicationImpl(portletAppMD, jbossAppMD, this, portletAPIFactory);
- portletApp.start();
-
- //
- registrationContext = registry.registerPortletApplication(portletApp);
-
- // Fixme here need the web App
- ContainerInfoBuilderContext builderContext = new ContainerInfoBuilderContextImpl(portletAppMD, null);
- ContainerInfoBuilder builder = new ContainerInfoBuilder(portletAppMD, builderContext);
- builder.build();
-
- //
- for (ContainerPortletInfo containerInfo : builder.getPortlets())
- {
-// JBossPortletMetaData jBossPortletMD = null;
-// if (jbossAppMD != null)
-// {
-// jBossPortletMD = (JBossPortletMetaData)jbossAppMD.getPortlets().get(portletMD.getName());
-// }
-
-
- //
- PortletContainerImpl container = new PortletContainerImpl(containerInfo);
-
- //
- container.setApplication(portletApp);
- portletApp.addContainer(container);
-
- //
- try
- {
- container.start();
- registrationContext.registerPortlet(container);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-*/
- }
-
- public void invokeStop()
- {
- // if the portlet application wasn't properly started, we shouldn't be trying to stop it
- if (portletApp != null)
- {
- for (PortletContainer container : portletApp.getPortletContainers())
- {
- try
- {
- registrationContext.unregisterPortlet(container);
- container.stop();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
-
- //
- portletApp.removeContainer(container);
- container.setApplication(null);
- }
-
- //
- registry.unregisterPortletApplication(portletApp);
- portletApp.stop();
-
- //
- portletApp = null;
- registrationContext = null;
- }
- }
-
- public void startPortletContainer(String portletName) throws Exception
- {
- PortletContainer container = portletApp.getPortletContainer(portletName);
- container.start();
- registrationContext.registerPortlet(container);
- }
-
- public void stopPortletContainer(String portletName)
- {
- PortletContainer container = portletApp.getPortletContainer(portletName);
- registrationContext.unregisterPortlet(container);
- container.stop();
- }
-
- public ServletContext getServletContext()
- {
- return servletContext;
- }
-
- public String getContextPath()
- {
- return contextPath;
- }
-
- public ClassLoader getClassLoader()
- {
- return classLoader;
- }
-}
18 years, 2 months
JBoss Portal SVN: r10027 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/container/managed and 3 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-19 07:08:48 -0500 (Tue, 19 Feb 2008)
New Revision: 10027
Added:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedPortletApplication.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedPortletContainer.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/PortletApplicationRegistrationContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/PortletApplicationRegistry.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/PortletApplicationRegistryListener.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletApplication.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletContainer.java
Removed:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplicationRegistrationContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplicationRegistry.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplicationRegistryListener.java
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationRegistryImpl.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/AbstractInfoTest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
Log:
start to revamp the container registry to something more managed
Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplicationRegistrationContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplicationRegistrationContext.java 2008-02-19 11:39:23 UTC (rev 10026)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplicationRegistrationContext.java 2008-02-19 12:08:48 UTC (rev 10027)
@@ -1,47 +0,0 @@
-/******************************************************************************
- * 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. *
- ******************************************************************************/
-package org.jboss.portal.portlet.container;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface PortletApplicationRegistrationContext
-{
-
- /**
- * Register a portlet.
- *
- * @param portletContainer the portlet container
- */
- void registerPortlet(PortletContainer portletContainer);
-
- /**
- * Unregister a portlet.
- *
- * @param portletContainer the portlet container
- */
- void unregisterPortlet(PortletContainer portletContainer);
-
-
-}
Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplicationRegistry.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplicationRegistry.java 2008-02-19 11:39:23 UTC (rev 10026)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplicationRegistry.java 2008-02-19 12:08:48 UTC (rev 10027)
@@ -1,69 +0,0 @@
-/******************************************************************************
- * 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. *
- ******************************************************************************/
-package org.jboss.portal.portlet.container;
-
-import java.util.Collection;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
- * @version $Revision: 6699 $
- */
-public interface PortletApplicationRegistry
-{
- /**
- * Register a portlet application.
- *
- * @param portletApplication the portlet application to register
- * @throws IllegalArgumentException if the portlet application is null or already registered
- */
- PortletApplicationRegistrationContext registerPortletApplication(PortletApplication portletApplication) throws IllegalArgumentException;
-
- /**
- * Unregister a portlet application.
- *
- * @param portletApplication the portlet application to unregister
- * @throws IllegalArgumentException if the portlet application is null or not registered
- */
- void unregisterPortletApplication(PortletApplication portletApplication) throws IllegalArgumentException;
-
- /** Return an immutable list all the known portlet application in the registry. */
- Collection<PortletApplication> getPortletApplications();
-
- /** Return a portlet app using its id or null if it does not exist. */
- PortletApplication getPortletApplication(String id);
-
- /**
- * Adds a portlet container registry listener.
- *
- * @param listener
- */
- void addListener(PortletApplicationRegistryListener listener);
-
- /**
- * Removes a portlet container registry listener.
- *
- * @param listener
- */
- void removeListener(PortletApplicationRegistryListener listener);
-}
Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplicationRegistryListener.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplicationRegistryListener.java 2008-02-19 11:39:23 UTC (rev 10026)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplicationRegistryListener.java 2008-02-19 12:08:48 UTC (rev 10027)
@@ -1,41 +0,0 @@
-/******************************************************************************
- * 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. *
- ******************************************************************************/
-package org.jboss.portal.portlet.container;
-
-/**
- * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
- */
-public interface PortletApplicationRegistryListener
-{
-
- /**
- * A portlet container has been registered.
- */
- void portletContainerRegistered(PortletContainer portletContainer);
-
- /**
- * A portlet container has been unregistered.
- */
- void portletContainerUnregistered(PortletContainer portletContainer);
-
-}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedPortletApplication.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedPortletApplication.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedPortletApplication.java 2008-02-19 12:08:48 UTC (rev 10027)
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.container.managed;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface ManagedPortletApplication
+{
+
+ String getId();
+
+ void managedStart() throws Exception;
+
+ void managedStop();
+
+ Collection<? extends ManagedPortletContainer> getManagedPortletContainers();
+
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedPortletContainer.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedPortletContainer.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedPortletContainer.java 2008-02-19 12:08:48 UTC (rev 10027)
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.container.managed;
+
+import org.jboss.portal.portlet.info.PortletInfo;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface ManagedPortletContainer
+{
+
+ String getId();
+
+ PortletInfo getPortletInfo();
+
+ ManagedPortletApplication getManagedPortletApplication();
+
+ void managedStart() throws Exception;
+
+ void managedStop();
+
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/PortletApplicationRegistrationContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/PortletApplicationRegistrationContext.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/PortletApplicationRegistrationContext.java 2008-02-19 12:08:48 UTC (rev 10027)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.container.managed;
+
+import org.jboss.portal.portlet.container.PortletContainer;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface PortletApplicationRegistrationContext
+{
+
+ /**
+ * Register a portlet.
+ *
+ * @param portletContainer the portlet container
+ */
+ void registerPortlet(PortletContainer portletContainer);
+
+ /**
+ * Unregister a portlet.
+ *
+ * @param portletContainer the portlet container
+ */
+ void unregisterPortlet(PortletContainer portletContainer);
+
+
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/PortletApplicationRegistry.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/PortletApplicationRegistry.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/PortletApplicationRegistry.java 2008-02-19 12:08:48 UTC (rev 10027)
@@ -0,0 +1,71 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.container.managed;
+
+import org.jboss.portal.portlet.container.PortletApplication;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision: 6699 $
+ */
+public interface PortletApplicationRegistry
+{
+ /**
+ * Register a portlet application.
+ *
+ * @param portletApplication the portlet application to register
+ * @throws IllegalArgumentException if the portlet application is null or already registered
+ */
+ PortletApplicationRegistrationContext registerPortletApplication(PortletApplication portletApplication) throws IllegalArgumentException;
+
+ /**
+ * Unregister a portlet application.
+ *
+ * @param portletApplication the portlet application to unregister
+ * @throws IllegalArgumentException if the portlet application is null or not registered
+ */
+ void unregisterPortletApplication(PortletApplication portletApplication) throws IllegalArgumentException;
+
+ /** Return an immutable list all the known portlet application in the registry. */
+ Collection<PortletApplication> getPortletApplications();
+
+ /** Return a portlet app using its id or null if it does not exist. */
+ PortletApplication getPortletApplication(String id);
+
+ /**
+ * Adds a portlet container registry listener.
+ *
+ * @param listener
+ */
+ void addListener(PortletApplicationRegistryListener listener);
+
+ /**
+ * Removes a portlet container registry listener.
+ *
+ * @param listener
+ */
+ void removeListener(PortletApplicationRegistryListener listener);
+}
Property changes on: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/PortletApplicationRegistry.java
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/PortletApplicationRegistryListener.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/PortletApplicationRegistryListener.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/PortletApplicationRegistryListener.java 2008-02-19 12:08:48 UTC (rev 10027)
@@ -0,0 +1,43 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.container.managed;
+
+import org.jboss.portal.portlet.container.PortletContainer;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ */
+public interface PortletApplicationRegistryListener
+{
+
+ /**
+ * A portlet container has been registered.
+ */
+ void portletContainerRegistered(PortletContainer portletContainer);
+
+ /**
+ * A portlet container has been unregistered.
+ */
+ void portletContainerUnregistered(PortletContainer portletContainer);
+
+}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java 2008-02-19 11:39:23 UTC (rev 10026)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java 2008-02-19 12:08:48 UTC (rev 10027)
@@ -23,8 +23,8 @@
package org.jboss.portal.portlet.impl.container;
import org.jboss.portal.portlet.container.PortletApplicationContext;
-import org.jboss.portal.portlet.container.PortletApplicationRegistrationContext;
-import org.jboss.portal.portlet.container.PortletApplicationRegistry;
+import org.jboss.portal.portlet.container.managed.PortletApplicationRegistrationContext;
+import org.jboss.portal.portlet.container.managed.PortletApplicationRegistry;
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl;
import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory;
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationRegistryImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationRegistryImpl.java 2008-02-19 11:39:23 UTC (rev 10026)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationRegistryImpl.java 2008-02-19 12:08:48 UTC (rev 10027)
@@ -22,10 +22,10 @@
******************************************************************************/
package org.jboss.portal.portlet.impl.container;
-import org.jboss.portal.portlet.container.PortletApplicationRegistry;
-import org.jboss.portal.portlet.container.PortletApplicationRegistrationContext;
+import org.jboss.portal.portlet.container.managed.PortletApplicationRegistry;
+import org.jboss.portal.portlet.container.managed.PortletApplicationRegistrationContext;
import org.jboss.portal.portlet.container.PortletApplication;
-import org.jboss.portal.portlet.container.PortletApplicationRegistryListener;
+import org.jboss.portal.portlet.container.managed.PortletApplicationRegistryListener;
import org.jboss.portal.portlet.container.PortletContainer;
import java.util.ArrayList;
Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/AbstractInfoTest.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/AbstractInfoTest.java 2008-02-19 11:39:23 UTC (rev 10026)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/info/AbstractInfoTest.java 2008-02-19 12:08:48 UTC (rev 10027)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.info;
-import org.jboss.portal.portlet.container.PortletApplicationRegistry;
+import org.jboss.portal.portlet.container.managed.PortletApplicationRegistry;
import org.jboss.unit.info.TestInfo;
import org.jboss.unit.info.impl.SimpleTestSuiteInfo;
import org.jboss.unit.remote.driver.RemoteTestDriver;
Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletApplication.java (from rev 10026, modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/ManagedPortletApplication.java)
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletApplication.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletApplication.java 2008-02-19 12:08:48 UTC (rev 10027)
@@ -0,0 +1,136 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.test;
+
+import org.jboss.portal.portlet.container.PortletApplicationContext;
+import org.jboss.portal.portlet.container.PortletApplication;
+import org.jboss.portal.portlet.container.managed.ManagedPortletApplication;
+import org.jboss.portal.portlet.container.managed.ManagedPortletContainer;
+import org.jboss.portal.web.WebApp;
+import org.jboss.portal.common.NotYetImplemented;
+
+import javax.servlet.ServletContext;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class KernelPortletApplication implements PortletApplicationContext, ManagedPortletApplication
+{
+
+ /** . */
+ private final WebApp webApp;
+
+ /** . */
+ private PortletApplication portletApplication;
+
+ /** . */
+ private final Map<String, KernelPortletContainer> kernelPortletContainers;
+
+ public KernelPortletApplication(WebApp webApp)
+ {
+ this.webApp = webApp;
+ this.portletApplication = null;
+ this.kernelPortletContainers = new HashMap<String, KernelPortletContainer>();
+ }
+
+ public void addKernelPortletContainer(KernelPortletContainer kernelPortletContainer)
+ {
+ kernelPortletContainers.put(kernelPortletContainer.getPortletContainer().getId(), kernelPortletContainer);
+ }
+
+ public void removeKernelPortletContainer(KernelPortletContainer kernelPortletContainer)
+ {
+ kernelPortletContainers.remove(kernelPortletContainer.getPortletContainer().getId());
+ }
+
+ public PortletApplication getPortletApplication()
+ {
+ return portletApplication;
+ }
+
+ public void setPortletApplication(PortletApplication portletApplication)
+ {
+ this.portletApplication = portletApplication;
+ }
+
+ public void start() throws Exception
+ {
+ }
+
+ public void stop()
+ {
+ }
+
+ // PortletApplicationContext ****************************************************************************************
+
+ public ServletContext getServletContext()
+ {
+ return webApp.getServletContext();
+ }
+
+ public String getContextPath()
+ {
+ return webApp.getContextPath();
+ }
+
+ public ClassLoader getClassLoader()
+ {
+ return webApp.getClassLoader();
+ }
+
+ public void invokeStart() throws Exception
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void invokeStop()
+ {
+ throw new NotYetImplemented();
+ }
+
+ //
+
+ public String getId()
+ {
+ return portletApplication.getId();
+ }
+
+ public void managedStart() throws Exception
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void managedStop()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public Collection<? extends ManagedPortletContainer> getManagedPortletContainers()
+ {
+ return kernelPortletContainers.values();
+ }
+}
Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletContainer.java (from rev 10026, modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/ManagedPortletContainer.java)
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletContainer.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletContainer.java 2008-02-19 12:08:48 UTC (rev 10027)
@@ -0,0 +1,111 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.test;
+
+import org.jboss.portal.portlet.container.PortletContainerContext;
+import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.container.managed.ManagedPortletContainer;
+import org.jboss.portal.portlet.container.managed.ManagedPortletApplication;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.common.NotYetImplemented;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class KernelPortletContainer implements PortletContainerContext, ManagedPortletContainer
+{
+
+ /** . */
+ private PortletContainer portletContainer;
+
+ /** . */
+ private KernelPortletApplication kernelPortletApplication;
+
+ public KernelPortletApplication getKernelPortletApplication()
+ {
+ return kernelPortletApplication;
+ }
+
+ public void setKernelPortletApplication(KernelPortletApplication kernelPortletApplication)
+ {
+ this.kernelPortletApplication = kernelPortletApplication;
+ }
+
+ public PortletContainer getPortletContainer()
+ {
+ return portletContainer;
+ }
+
+ public void setPortletContainer(PortletContainer portletContainer)
+ {
+ this.portletContainer = portletContainer;
+ }
+
+ public void start() throws Exception
+ {
+ }
+
+ public void stop()
+ {
+ }
+
+ //
+
+ public void invokeStart() throws Exception
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void invokeStop()
+ {
+ throw new NotYetImplemented();
+ }
+
+ //
+
+ public String getId()
+ {
+ return portletContainer.getId();
+ }
+
+ public ManagedPortletApplication getManagedPortletApplication()
+ {
+ return kernelPortletApplication;
+ }
+
+ public PortletInfo getPortletInfo()
+ {
+ return portletContainer.getInfo();
+ }
+
+ public void managedStart() throws Exception
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void managedStop()
+ {
+ throw new NotYetImplemented();
+ }
+}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployer.java 2008-02-19 11:39:23 UTC (rev 10026)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployer.java 2008-02-19 12:08:48 UTC (rev 10027)
@@ -28,8 +28,8 @@
import org.jboss.kernel.spi.dependency.KernelControllerContextAware;
import org.jboss.portal.common.io.IOTools;
import org.jboss.portal.portlet.container.PortletApplication;
-import org.jboss.portal.portlet.container.PortletApplicationRegistrationContext;
-import org.jboss.portal.portlet.container.PortletApplicationRegistry;
+import org.jboss.portal.portlet.container.managed.PortletApplicationRegistrationContext;
+import org.jboss.portal.portlet.container.managed.PortletApplicationRegistry;
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
import static org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants.PORTLET_JSR_168_NS;
@@ -100,8 +100,8 @@
private ClassLoader classLoader;
/** . */
- private final Map<ManagedPortletApplication, PortletApplicationRegistrationContext> registrationContextMap =
- new HashMap<ManagedPortletApplication, PortletApplicationRegistrationContext>();
+ private final Map<KernelPortletApplication, PortletApplicationRegistrationContext> registrationContextMap =
+ new HashMap<KernelPortletApplication, PortletApplicationRegistrationContext>();
public PortletApplicationRegistry getRegistry()
{
@@ -270,35 +270,35 @@
}
/** Called by MC to install application. */
- public void addManagedPortletApplication(ManagedPortletApplication managedPortletApplication)
+ public void addManagedPortletApplication(KernelPortletApplication kernelPortletApplication)
{
- PortletApplication portletApplication = managedPortletApplication.getPortletApplication();
+ PortletApplication portletApplication = kernelPortletApplication.getPortletApplication();
PortletApplicationRegistrationContext context = registry.registerPortletApplication(portletApplication);
- registrationContextMap.put(managedPortletApplication, context);
+ registrationContextMap.put(kernelPortletApplication, context);
}
/** Called by MC to install container. */
- public void addManagedPortletContainer(ManagedPortletContainer managedPortletContainer)
+ public void addManagedPortletContainer(KernelPortletContainer kernelPortletContainer)
{
- ManagedPortletApplication managedPortletApplication = managedPortletContainer.getManagedPortletApplication();
- PortletApplicationRegistrationContext context = registrationContextMap.get(managedPortletApplication);
- PortletContainer portletContainer = managedPortletContainer.getPortletContainer();
+ KernelPortletApplication kernelPortletApplication = kernelPortletContainer.getKernelPortletApplication();
+ PortletApplicationRegistrationContext context = registrationContextMap.get(kernelPortletApplication);
+ PortletContainer portletContainer = kernelPortletContainer.getPortletContainer();
context.registerPortlet(portletContainer);
}
/** Called by MC to uninstall application. */
- public void removeManagedPortletApplication(ManagedPortletApplication managedPortletApplication)
+ public void removeManagedPortletApplication(KernelPortletApplication kernelPortletApplication)
{
- PortletApplication portletApplication = managedPortletApplication.getPortletApplication();
+ PortletApplication portletApplication = kernelPortletApplication.getPortletApplication();
registry.unregisterPortletApplication(portletApplication);
}
/** Called by MC to uninstall container. */
- public void removeManagedPortletContainer(ManagedPortletContainer managedPortletContainer)
+ public void removeManagedPortletContainer(KernelPortletContainer kernelPortletContainer)
{
- ManagedPortletApplication managedPortletApplication = managedPortletContainer.getManagedPortletApplication();
- PortletApplicationRegistrationContext context = registrationContextMap.get(managedPortletApplication);
- PortletContainer portletContainer = managedPortletContainer.getPortletContainer();
+ KernelPortletApplication kernelPortletApplication = kernelPortletContainer.getKernelPortletApplication();
+ PortletApplicationRegistrationContext context = registrationContextMap.get(kernelPortletApplication);
+ PortletContainer portletContainer = kernelPortletContainer.getPortletContainer();
context.unregisterPortlet(portletContainer);
}
}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2008-02-19 11:39:23 UTC (rev 10026)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2008-02-19 12:08:48 UTC (rev 10027)
@@ -88,9 +88,9 @@
this.installed = new LinkedHashMap<String, KernelControllerContext>();
}
- public AbstractBeanMetaData createManagedPortletContainerMetaData(String managedPortletContainerId)
+ public AbstractBeanMetaData createKernelPortletContainerMetaData(String kernelPortletContainerId)
{
- AbstractBeanMetaData beanMD = new AbstractBeanMetaData(managedPortletContainerId, ManagedPortletContainer.class.getName());
+ AbstractBeanMetaData beanMD = new AbstractBeanMetaData(kernelPortletContainerId, KernelPortletContainer.class.getName());
//
AbstractConstructorMetaData ctorMD = new AbstractConstructorMetaData();
@@ -110,9 +110,9 @@
return beanMD;
}
- public AbstractBeanMetaData createManagedPortletApplicationMetaData(String managedPortletApplicationId)
+ public AbstractBeanMetaData createKernelPortletApplicationMetaData(String kernelPortletApplicationId)
{
- AbstractBeanMetaData beanMD = new AbstractBeanMetaData(managedPortletApplicationId, ManagedPortletApplication.class.getName());
+ AbstractBeanMetaData beanMD = new AbstractBeanMetaData(kernelPortletApplicationId, KernelPortletApplication.class.getName());
//
AbstractConstructorMetaData ctorMD = new AbstractConstructorMetaData();
@@ -192,7 +192,7 @@
String portletApplicationId = "PortletApplication[" + webApp.getContextPath() + "]";
//
- String managedPortletApplicationId = "ManagedPortletApplication[" + webApp.getContextPath() + "]";
+ String kernelPortletApplicationId = "KernelPortletApplication[" + webApp.getContextPath() + "]";
//
ContainerInfoBuilderContext builderContext = new ContainerInfoBuilderContextImpl(metaData, webApp);
@@ -207,21 +207,21 @@
{
//
String portletContainerId = "PortletContainer[" + webApp.getContextPath() + "," + containerInfo.getName() + "]";
- String managedPortletContainerId = "ManagedPortletContainer[" + webApp.getContextPath() + "," + containerInfo.getName() + "]";
+ String kernelPortletContainerId = "KernelPortletContainer[" + webApp.getContextPath() + "," + containerInfo.getName() + "]";
//
AbstractBeanMetaData portletContainerMD = createPortletContainerMetaData(portletContainerId, containerInfo);
- AbstractBeanMetaData managedPortletContainerMD = createManagedPortletContainerMetaData(managedPortletContainerId);
+ AbstractBeanMetaData kernelPortletContainerMD = createKernelPortletContainerMetaData(kernelPortletContainerId);
//
- AbstractDependencyValueMetaData portletContainerContextDependencyMD = new AbstractDependencyValueMetaData(managedPortletContainerId);
+ AbstractDependencyValueMetaData portletContainerContextDependencyMD = new AbstractDependencyValueMetaData(kernelPortletContainerId);
portletContainerContextDependencyMD.setDependentState(ControllerState.INSTANTIATED);
portletContainerMD.getProperties().add(new AbstractPropertyMetaData("context", portletContainerContextDependencyMD));
//
AbstractDependencyValueMetaData portletContainerDependencyMD = new AbstractDependencyValueMetaData(portletContainerId);
portletContainerDependencyMD.setDependentState(ControllerState.START);
- managedPortletContainerMD.getProperties().add(new AbstractPropertyMetaData("portletContainer", portletContainerDependencyMD));
+ kernelPortletContainerMD.getProperties().add(new AbstractPropertyMetaData("portletContainer", portletContainerDependencyMD));
//
AbstractDependencyValueMetaData portletApplicationDependencyMD = new AbstractDependencyValueMetaData(portletApplicationId);
@@ -242,51 +242,51 @@
uninstallPortletContainerMD.setParameters(Collections.singletonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData())));
uninstallPortletContainerMD.setMethodName("removeContainer");
uninstallPortletContainerMD.setDependentState(ControllerState.START);
- managedPortletContainerMD.getUninstalls().add(uninstallPortletContainerMD);
+ kernelPortletContainerMD.getUninstalls().add(uninstallPortletContainerMD);
- // Inject the managed portlet application in the managed portlet container
- AbstractDependencyValueMetaData managedPortletApplicationDependencyMD = new AbstractDependencyValueMetaData(managedPortletApplicationId);
- managedPortletApplicationDependencyMD.setDependentState(ControllerState.START);
- managedPortletContainerMD.getProperties().add(new AbstractPropertyMetaData("managedPortletApplication", managedPortletApplicationDependencyMD));
+ // Inject the kernel portlet application in the kernel portlet container
+ AbstractDependencyValueMetaData kernelPortletApplicationDependencyMD = new AbstractDependencyValueMetaData(kernelPortletApplicationId);
+ kernelPortletApplicationDependencyMD.setDependentState(ControllerState.START);
+ kernelPortletContainerMD.getProperties().add(new AbstractPropertyMetaData("kernelPortletApplication", kernelPortletApplicationDependencyMD));
- // Install the managed portlet container on the managed portlet application
- AbstractInstallMetaData installManagedPortletContainerMD = new AbstractInstallMetaData();
- installManagedPortletContainerMD.setBean(managedPortletApplicationId);
- installManagedPortletContainerMD.setParameters(Collections.singletonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData())));
- installManagedPortletContainerMD.setMethodName("addManagedPortletContainer");
- installManagedPortletContainerMD.setDependentState(ControllerState.START);
- managedPortletContainerMD.getInstalls().add(installManagedPortletContainerMD);
+ // Install the kernel portlet container on the kernel portlet application
+ AbstractInstallMetaData installKernelPortletContainerMD = new AbstractInstallMetaData();
+ installKernelPortletContainerMD.setBean(kernelPortletApplicationId);
+ installKernelPortletContainerMD.setParameters(Collections.singletonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData())));
+ installKernelPortletContainerMD.setMethodName("addKernelPortletContainer");
+ installKernelPortletContainerMD.setDependentState(ControllerState.START);
+ kernelPortletContainerMD.getInstalls().add(installKernelPortletContainerMD);
- // Uninstall the managed portlet container from the managed portlet application
- AbstractInstallMetaData uninstallManagedPortletContainerMD = new AbstractInstallMetaData();
- uninstallManagedPortletContainerMD.setBean(managedPortletApplicationId);
- uninstallManagedPortletContainerMD.setParameters(Collections.singletonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData())));
- uninstallManagedPortletContainerMD.setMethodName("removeManagedPortletContainer");
- uninstallManagedPortletContainerMD.setDependentState(ControllerState.START);
- managedPortletContainerMD.getUninstalls().add(uninstallManagedPortletContainerMD);
+ // Uninstall the kernel portlet container from the kernel portlet application
+ AbstractInstallMetaData uninstallKernelPortletContainerMD = new AbstractInstallMetaData();
+ uninstallKernelPortletContainerMD.setBean(kernelPortletApplicationId);
+ uninstallKernelPortletContainerMD.setParameters(Collections.singletonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData())));
+ uninstallKernelPortletContainerMD.setMethodName("removeKernelPortletContainer");
+ uninstallKernelPortletContainerMD.setDependentState(ControllerState.START);
+ kernelPortletContainerMD.getUninstalls().add(uninstallKernelPortletContainerMD);
//
toInstall.add(portletContainerMD);
- toInstall.add(managedPortletContainerMD);
+ toInstall.add(kernelPortletContainerMD);
}
//
AbstractBeanMetaData portletApplicationMD = createPortletApplicationMetaData(builder.getApplication(), portletApplicationId);
- AbstractBeanMetaData managedPortletApplicationMD = createManagedPortletApplicationMetaData(managedPortletApplicationId);
+ AbstractBeanMetaData kernelPortletApplicationMD = createKernelPortletApplicationMetaData(kernelPortletApplicationId);
//
- AbstractDependencyValueMetaData portletApplicationContextDependencyMD = new AbstractDependencyValueMetaData(managedPortletApplicationId);
+ AbstractDependencyValueMetaData portletApplicationContextDependencyMD = new AbstractDependencyValueMetaData(kernelPortletApplicationId);
portletApplicationContextDependencyMD.setDependentState(ControllerState.INSTANTIATED);
portletApplicationMD.getProperties().add(new AbstractPropertyMetaData("context", portletApplicationContextDependencyMD));
//
AbstractDependencyValueMetaData portletApplicationDependencyMD = new AbstractDependencyValueMetaData(portletApplicationId);
portletApplicationDependencyMD.setDependentState(ControllerState.START);
- managedPortletApplicationMD.getProperties().add(new AbstractPropertyMetaData("portletApplication", portletApplicationDependencyMD));
+ kernelPortletApplicationMD.getProperties().add(new AbstractPropertyMetaData("portletApplication", portletApplicationDependencyMD));
//
toInstall.add(portletApplicationMD);
- toInstall.add(managedPortletApplicationMD);
+ toInstall.add(kernelPortletApplicationMD);
// Install beans
for (AbstractBeanMetaData beanMetaData : toInstall)
18 years, 2 months
JBoss Portal SVN: r10026 - in modules/portlet/trunk: test/src/main/java/org/jboss/portal/portlet/test and 2 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-19 06:39:23 -0500 (Tue, 19 Feb 2008)
New Revision: 10026
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletContainerInvoker.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/ManagedPortletApplication.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/ManagedPortletContainer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/jboss-beans.xml
Log:
- better pojoisation of portlet container / portlet applications
- removed the usage of the contianer registry listener for updating the portlet container invoker
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletContainerInvoker.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletContainerInvoker.java 2008-02-19 10:58:39 UTC (rev 10025)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletContainerInvoker.java 2008-02-19 11:39:23 UTC (rev 10026)
@@ -54,20 +54,17 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 7226 $
*/
-public class PortletContainerInvoker implements PortletInvoker, PortletApplicationRegistryListener
+public class PortletContainerInvoker implements PortletInvoker
{
/** The key under which the portlet container is stored in the request scope of the invocation. */
public static final String PORTLET_CONTAINER = "PORTLET_CONTAINER";
/** . */
- private PortletApplicationRegistry registry;
-
- /** . */
private InterceptorStackFactory stackFactory;
/** . */
- private Map<String, Portlet> portlets;
+ private Map<String, Portlet> portlets = new HashMap<String, Portlet>();
/** . */
private InvocationHandler handler = new InvocationHandler()
@@ -92,16 +89,6 @@
}
};
- public PortletApplicationRegistry getRegistry()
- {
- return registry;
- }
-
- public void setRegistry(PortletApplicationRegistry registry)
- {
- this.registry = registry;
- }
-
public InterceptorStackFactory getStackFactory()
{
return stackFactory;
@@ -112,7 +99,7 @@
this.stackFactory = stackFactory;
}
- public synchronized void portletContainerRegistered(PortletContainer portletContainer)
+ public void addPortletContainer(PortletContainer portletContainer)
{
Map<String, Portlet> portlets = new HashMap<String, Portlet>(this.portlets);
PortletImpl portlet = new PortletImpl(portletContainer);
@@ -122,7 +109,7 @@
this.portlets = portlets;
}
- public synchronized void portletContainerUnregistered(PortletContainer portletContainer)
+ public void removePortletContainer(PortletContainer portletContainer)
{
Map<String, Portlet> portlets = new HashMap<String, Portlet>(this.portlets);
PortletImpl portlet = new PortletImpl(portletContainer);
@@ -134,29 +121,10 @@
public synchronized void start() throws Exception
{
- Map<String, Portlet> portlets = new HashMap<String, Portlet>();
- for (PortletApplication portletApplication : registry.getPortletApplications())
- {
- for (PortletContainer portletContainer : portletApplication.getPortletContainers())
- {
- PortletImpl portlet = new PortletImpl(portletContainer);
- portlets.put(portlet.getContext().getId(), portlet);
- }
- }
-
- //
- this.portlets = portlets;
-
- //
- registry.addListener(this);
}
public synchronized void stop() throws Exception
{
- registry.removeListener(this);
-
- //
- portlets = new HashMap<String, Portlet>();
}
public Set<Portlet> getPortlets()
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/ManagedPortletApplication.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/ManagedPortletApplication.java 2008-02-19 10:58:39 UTC (rev 10025)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/ManagedPortletApplication.java 2008-02-19 11:39:23 UTC (rev 10026)
@@ -23,11 +23,7 @@
package org.jboss.portal.portlet.test;
import org.jboss.portal.portlet.container.PortletApplicationContext;
-import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl;
-import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory;
-import org.jboss.portal.portlet.impl.info.ContainerPortletApplicationInfo;
-import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
-import org.jboss.portal.portlet.metadata.JBossApplicationMetaData;
+import org.jboss.portal.portlet.container.PortletApplication;
import org.jboss.portal.web.WebApp;
import org.jboss.portal.common.NotYetImplemented;
@@ -46,49 +42,44 @@
private final WebApp webApp;
/** . */
- final PortletApplicationImpl portletApplication;
+ private PortletApplication portletApplication;
/** . */
private final Map<String, ManagedPortletContainer> managedPortletContainers;
- public ManagedPortletApplication(
- ContainerPortletApplicationInfo portletApplicationInfo,
- PortletApplication10MetaData portletApplicationMetaData,
- JBossApplicationMetaData jbossApplicationMetaData,
- PortletAPIFactory portletAPIFactory,
- WebApp webApp)
+ public ManagedPortletApplication(WebApp webApp)
{
this.webApp = webApp;
- this.portletApplication = new PortletApplicationImpl(
- portletApplicationInfo,
- portletApplicationMetaData,
- jbossApplicationMetaData,
- portletAPIFactory);
+ this.portletApplication = null;
this.managedPortletContainers = new HashMap<String, ManagedPortletContainer>();
}
public void addManagedPortletContainer(ManagedPortletContainer managedPortletContainer)
{
- managedPortletContainers.put(managedPortletContainer.portletContainer.getId(), managedPortletContainer);
- portletApplication.addContainer(managedPortletContainer.portletContainer);
+ managedPortletContainers.put(managedPortletContainer.getPortletContainer().getId(), managedPortletContainer);
}
public void removeManagedPortletContainer(ManagedPortletContainer managedPortletContainer)
{
- portletApplication.removeContainer(managedPortletContainer.portletContainer);
- managedPortletContainers.remove(managedPortletContainer.portletContainer.getId());
+ managedPortletContainers.remove(managedPortletContainer.getPortletContainer().getId());
}
+ public PortletApplication getPortletApplication()
+ {
+ return portletApplication;
+ }
+
+ public void setPortletApplication(PortletApplication portletApplication)
+ {
+ this.portletApplication = portletApplication;
+ }
+
public void start() throws Exception
{
- portletApplication.setContext(this);
- portletApplication.start();
}
public void stop()
{
- portletApplication.stop();
- portletApplication.setContext(null);
}
// PortletApplicationContext ****************************************************************************************
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/ManagedPortletContainer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/ManagedPortletContainer.java 2008-02-19 10:58:39 UTC (rev 10025)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/ManagedPortletContainer.java 2008-02-19 11:39:23 UTC (rev 10026)
@@ -23,8 +23,7 @@
package org.jboss.portal.portlet.test;
import org.jboss.portal.portlet.container.PortletContainerContext;
-import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl;
-import org.jboss.portal.portlet.impl.info.ContainerPortletInfo;
+import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.common.NotYetImplemented;
/**
@@ -35,16 +34,11 @@
{
/** . */
- final PortletContainerImpl portletContainer;
+ private PortletContainer portletContainer;
/** . */
private ManagedPortletApplication managedPortletApplication;
- public ManagedPortletContainer(ContainerPortletInfo portletInfo)
- {
- portletContainer = new PortletContainerImpl(portletInfo);
- }
-
public ManagedPortletApplication getManagedPortletApplication()
{
return managedPortletApplication;
@@ -52,29 +46,25 @@
public void setManagedPortletApplication(ManagedPortletApplication managedPortletApplication)
{
- if (managedPortletApplication != null)
- {
- portletContainer.setApplication(managedPortletApplication.portletApplication);
- }
- else
- {
- portletContainer.setApplication(null);
- }
-
- //
this.managedPortletApplication = managedPortletApplication;
}
+ public PortletContainer getPortletContainer()
+ {
+ return portletContainer;
+ }
+
+ public void setPortletContainer(PortletContainer portletContainer)
+ {
+ this.portletContainer = portletContainer;
+ }
+
public void start() throws Exception
{
- portletContainer.setContext(this);
- portletContainer.start();
}
public void stop()
{
- portletContainer.stop();
- portletContainer.setContext(null);
}
//
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployer.java 2008-02-19 10:58:39 UTC (rev 10025)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployer.java 2008-02-19 11:39:23 UTC (rev 10026)
@@ -272,10 +272,9 @@
/** Called by MC to install application. */
public void addManagedPortletApplication(ManagedPortletApplication managedPortletApplication)
{
- PortletApplication portletApplication = managedPortletApplication.portletApplication;
+ PortletApplication portletApplication = managedPortletApplication.getPortletApplication();
PortletApplicationRegistrationContext context = registry.registerPortletApplication(portletApplication);
registrationContextMap.put(managedPortletApplication, context);
-
}
/** Called by MC to install container. */
@@ -283,14 +282,14 @@
{
ManagedPortletApplication managedPortletApplication = managedPortletContainer.getManagedPortletApplication();
PortletApplicationRegistrationContext context = registrationContextMap.get(managedPortletApplication);
- PortletContainer portletContainer = managedPortletContainer.portletContainer;
+ PortletContainer portletContainer = managedPortletContainer.getPortletContainer();
context.registerPortlet(portletContainer);
}
/** Called by MC to uninstall application. */
public void removeManagedPortletApplication(ManagedPortletApplication managedPortletApplication)
{
- PortletApplication portletApplication = managedPortletApplication.portletApplication;
+ PortletApplication portletApplication = managedPortletApplication.getPortletApplication();
registry.unregisterPortletApplication(portletApplication);
}
@@ -299,7 +298,7 @@
{
ManagedPortletApplication managedPortletApplication = managedPortletContainer.getManagedPortletApplication();
PortletApplicationRegistrationContext context = registrationContextMap.get(managedPortletApplication);
- PortletContainer portletContainer = managedPortletContainer.portletContainer;
+ PortletContainer portletContainer = managedPortletContainer.getPortletContainer();
context.unregisterPortlet(portletContainer);
}
}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2008-02-19 10:58:39 UTC (rev 10025)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2008-02-19 11:39:23 UTC (rev 10026)
@@ -44,6 +44,8 @@
import org.jboss.portal.portlet.impl.info.ContainerPortletApplicationInfo;
import org.jboss.portal.portlet.impl.info.ContainerPortletInfo;
import org.jboss.portal.portlet.impl.jsr168.ContainerInfoBuilderContextImpl;
+import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl;
+import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl;
import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory;
import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
import org.jboss.portal.portlet.metadata.JBossApplicationMetaData;
@@ -53,6 +55,7 @@
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
+import java.util.HashSet;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -76,14 +79,6 @@
/** . */
private final LinkedHashMap<String, KernelControllerContext> installed;
-// /** . */
-//// private KernelControllerContext portletApplicationControllerContext;
-//
-// /** . */
-//// private List<KernelControllerContext> portletContainerControllerContexts = new ArrayList<KernelControllerContext>();
-//
-// /** . */
-
public PortletApplicationDeployment(Kernel kernel, WebApp webApp, PortletApplication10MetaData metaData)
{
this.kernel = kernel;
@@ -93,16 +88,21 @@
this.installed = new LinkedHashMap<String, KernelControllerContext>();
}
- public AbstractBeanMetaData createManagedPortletContainerMetaData(String managedPortletContainerId, ContainerPortletInfo portletInfo)
+ public AbstractBeanMetaData createManagedPortletContainerMetaData(String managedPortletContainerId)
{
AbstractBeanMetaData beanMD = new AbstractBeanMetaData(managedPortletContainerId, ManagedPortletContainer.class.getName());
//
AbstractConstructorMetaData ctorMD = new AbstractConstructorMetaData();
- ctorMD.setParameters(Tools.toList((ParameterMetaData)new AbstractParameterMetaData(ContainerPortletInfo.class.getName(), portletInfo)));
+ ctorMD.setParameters(new ArrayList<ParameterMetaData>());
beanMD.setConstructor(ctorMD);
//
+ beanMD.setProperties(new HashSet<PropertyMetaData>());
+ beanMD.setInstalls(new ArrayList<InstallMetaData>());
+ beanMD.setUninstalls(new ArrayList<InstallMetaData>());
+
+ //
beanMD.setStart(new AbstractLifecycleMetaData("start"));
beanMD.setStop(new AbstractLifecycleMetaData("stop"));
@@ -110,21 +110,69 @@
return beanMD;
}
- public AbstractBeanMetaData createManagedPortletApplicationMetaData(ContainerPortletApplicationInfo portletApplicationInfo, String managedPortletApplicationId)
+ public AbstractBeanMetaData createManagedPortletApplicationMetaData(String managedPortletApplicationId)
{
AbstractBeanMetaData beanMD = new AbstractBeanMetaData(managedPortletApplicationId, ManagedPortletApplication.class.getName());
//
AbstractConstructorMetaData ctorMD = new AbstractConstructorMetaData();
+ ctorMD.setParameters(Tools.toList((ParameterMetaData)new AbstractParameterMetaData(WebApp.class.getName(), webApp)));
+ beanMD.setConstructor(ctorMD);
+
+ //
+ beanMD.setProperties(new HashSet<PropertyMetaData>());
+ beanMD.setInstalls(new ArrayList<InstallMetaData>());
+ beanMD.setUninstalls(new ArrayList<InstallMetaData>());
+
+ //
+ beanMD.setStart(new AbstractLifecycleMetaData("start"));
+ beanMD.setStop(new AbstractLifecycleMetaData("stop"));
+
+ //
+ return beanMD;
+ }
+
+ public AbstractBeanMetaData createPortletContainerMetaData(String portletContainerId, ContainerPortletInfo portletInfo)
+ {
+ AbstractBeanMetaData beanMD = new AbstractBeanMetaData(portletContainerId, PortletContainerImpl.class.getName());
+
+ //
+ AbstractConstructorMetaData ctorMD = new AbstractConstructorMetaData();
+ ctorMD.setParameters(Tools.toList((ParameterMetaData)new AbstractParameterMetaData(ContainerPortletInfo.class.getName(), portletInfo)));
+ beanMD.setConstructor(ctorMD);
+
+ //
+ beanMD.setProperties(new HashSet<PropertyMetaData>());
+ beanMD.setInstalls(new ArrayList<InstallMetaData>());
+ beanMD.setUninstalls(new ArrayList<InstallMetaData>());
+
+ //
+ beanMD.setStart(new AbstractLifecycleMetaData("start"));
+ beanMD.setStop(new AbstractLifecycleMetaData("stop"));
+
+ //
+ return beanMD;
+ }
+
+ public AbstractBeanMetaData createPortletApplicationMetaData(ContainerPortletApplicationInfo portletApplicationInfo, String portletApplicationId)
+ {
+ AbstractBeanMetaData beanMD = new AbstractBeanMetaData(portletApplicationId, PortletApplicationImpl.class.getName());
+
+ //
+ AbstractConstructorMetaData ctorMD = new AbstractConstructorMetaData();
ctorMD.setParameters(Tools.toList(
(ParameterMetaData)new AbstractParameterMetaData(ContainerPortletApplicationInfo.class.getName(), portletApplicationInfo),
new AbstractParameterMetaData(PortletApplication10MetaData.class.getName(), metaData),
new AbstractParameterMetaData(JBossApplicationMetaData.class.getName(), (Object)null),
- new AbstractParameterMetaData(PortletAPIFactory.class.getName(), new AbstractDependencyValueMetaData("PortletAPIFactory")),
- new AbstractParameterMetaData(WebApp.class.getName(), webApp)));
+ new AbstractParameterMetaData(PortletAPIFactory.class.getName(), new AbstractDependencyValueMetaData("PortletAPIFactory"))));
beanMD.setConstructor(ctorMD);
//
+ beanMD.setProperties(new HashSet<PropertyMetaData>());
+ beanMD.setInstalls(new ArrayList<InstallMetaData>());
+ beanMD.setUninstalls(new ArrayList<InstallMetaData>());
+
+ //
beanMD.setStart(new AbstractLifecycleMetaData("start"));
beanMD.setStop(new AbstractLifecycleMetaData("stop"));
@@ -158,109 +206,87 @@
for (ContainerPortletInfo containerInfo : builder.getPortlets())
{
//
+ String portletContainerId = "PortletContainer[" + webApp.getContextPath() + "," + containerInfo.getName() + "]";
String managedPortletContainerId = "ManagedPortletContainer[" + webApp.getContextPath() + "," + containerInfo.getName() + "]";
//
- AbstractBeanMetaData managedPortletContainerMD = createManagedPortletContainerMetaData(managedPortletContainerId, containerInfo);
+ AbstractBeanMetaData portletContainerMD = createPortletContainerMetaData(portletContainerId, containerInfo);
+ AbstractBeanMetaData managedPortletContainerMD = createManagedPortletContainerMetaData(managedPortletContainerId);
-/*
- // Inject the managed portlet container and the portlet application in the portlet container
+ //
AbstractDependencyValueMetaData portletContainerContextDependencyMD = new AbstractDependencyValueMetaData(managedPortletContainerId);
portletContainerContextDependencyMD.setDependentState(ControllerState.INSTANTIATED);
- AbstractDependencyValueMetaData portletApplicationDependencyMD = new AbstractDependencyValueMetaData(portletApplicationId);
- portletApplicationDependencyMD.setDependentState(ControllerState.INSTALLED);
- portletContainerMD.setProperties(Tools.toSet(
- (PropertyMetaData)new AbstractPropertyMetaData("context", portletContainerContextDependencyMD),
- new AbstractPropertyMetaData("application", portletApplicationDependencyMD)));
+ portletContainerMD.getProperties().add(new AbstractPropertyMetaData("context", portletContainerContextDependencyMD));
- // Inject the portlet container in the managed portlet container
+ //
AbstractDependencyValueMetaData portletContainerDependencyMD = new AbstractDependencyValueMetaData(portletContainerId);
- portletContainerDependencyMD.setDependentState(ControllerState.INSTALLED);
- managedPortletContainerMD.setProperties(Tools.toSet((PropertyMetaData)new AbstractPropertyMetaData("peer", portletContainerDependencyMD)));
+ portletContainerDependencyMD.setDependentState(ControllerState.START);
+ managedPortletContainerMD.getProperties().add(new AbstractPropertyMetaData("portletContainer", portletContainerDependencyMD));
- // Install the portlet container on the managed portlet container and on the portlet application
+ //
+ AbstractDependencyValueMetaData portletApplicationDependencyMD = new AbstractDependencyValueMetaData(portletApplicationId);
+ portletApplicationDependencyMD.setDependentState(ControllerState.START);
+ portletContainerMD.getProperties().add(new AbstractPropertyMetaData("application", portletApplicationDependencyMD));
+
+ // Install the portlet container on the portlet application
AbstractInstallMetaData installPortletContainerMD = new AbstractInstallMetaData();
installPortletContainerMD.setBean(portletApplicationId);
installPortletContainerMD.setParameters(Collections.singletonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData())));
installPortletContainerMD.setMethodName("addContainer");
- portletContainerMD.setInstalls(Tools.toList((InstallMetaData)installPortletContainerMD));
+ installPortletContainerMD.setDependentState(ControllerState.START);
+ portletContainerMD.getInstalls().add(installPortletContainerMD);
- // Uninstall the portlet container from the managed portlet container and from the portlet application
+ // Uninstall the portlet container from the portlet application
AbstractInstallMetaData uninstallPortletContainerMD = new AbstractInstallMetaData();
uninstallPortletContainerMD.setBean(portletApplicationId);
uninstallPortletContainerMD.setParameters(Collections.singletonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData())));
uninstallPortletContainerMD.setMethodName("removeContainer");
- portletContainerMD.setUninstalls(Tools.toList((InstallMetaData)uninstallPortletContainerMD));
+ uninstallPortletContainerMD.setDependentState(ControllerState.START);
+ managedPortletContainerMD.getUninstalls().add(uninstallPortletContainerMD);
- // Install the managed portlet container on the portlet application deployer
- AbstractInstallMetaData installManagedPortletContainerMD = new AbstractInstallMetaData();
- installManagedPortletContainerMD.setBean("PortletApplicationDeployer");
- installManagedPortletContainerMD.setParameters(Collections.singletonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData())));
- installManagedPortletContainerMD.setMethodName("installManagedPortletContainer");
- managedPortletContainerMD.setInstalls(Collections.singletonList((InstallMetaData)installManagedPortletContainerMD));
-
- // Uninstall the managed portlet container from the portlet application deployer
- AbstractInstallMetaData uninstallManagedPortletCotainerMD = new AbstractInstallMetaData();
- uninstallManagedPortletCotainerMD.setBean("PortletApplicationDeployer");
- uninstallManagedPortletCotainerMD.setParameters(Collections.singletonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData())));
- uninstallManagedPortletCotainerMD.setMethodName("uninstallManagedPortletContainer");
- managedPortletContainerMD.setUninstalls(Collections.singletonList((InstallMetaData)uninstallManagedPortletCotainerMD));
-*/
-
// Inject the managed portlet application in the managed portlet container
AbstractDependencyValueMetaData managedPortletApplicationDependencyMD = new AbstractDependencyValueMetaData(managedPortletApplicationId);
- managedPortletContainerMD.setProperties(Tools.toSet((PropertyMetaData)new AbstractPropertyMetaData("managedPortletApplication", managedPortletApplicationDependencyMD)));
+ managedPortletApplicationDependencyMD.setDependentState(ControllerState.START);
+ managedPortletContainerMD.getProperties().add(new AbstractPropertyMetaData("managedPortletApplication", managedPortletApplicationDependencyMD));
// Install the managed portlet container on the managed portlet application
AbstractInstallMetaData installManagedPortletContainerMD = new AbstractInstallMetaData();
installManagedPortletContainerMD.setBean(managedPortletApplicationId);
installManagedPortletContainerMD.setParameters(Collections.singletonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData())));
installManagedPortletContainerMD.setMethodName("addManagedPortletContainer");
- managedPortletContainerMD.setInstalls(Collections.singletonList((InstallMetaData)installManagedPortletContainerMD));
+ installManagedPortletContainerMD.setDependentState(ControllerState.START);
+ managedPortletContainerMD.getInstalls().add(installManagedPortletContainerMD);
// Uninstall the managed portlet container from the managed portlet application
AbstractInstallMetaData uninstallManagedPortletContainerMD = new AbstractInstallMetaData();
uninstallManagedPortletContainerMD.setBean(managedPortletApplicationId);
uninstallManagedPortletContainerMD.setParameters(Collections.singletonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData())));
uninstallManagedPortletContainerMD.setMethodName("removeManagedPortletContainer");
- managedPortletContainerMD.setUninstalls(Collections.singletonList((InstallMetaData)uninstallManagedPortletContainerMD));
+ uninstallManagedPortletContainerMD.setDependentState(ControllerState.START);
+ managedPortletContainerMD.getUninstalls().add(uninstallManagedPortletContainerMD);
//
+ toInstall.add(portletContainerMD);
toInstall.add(managedPortletContainerMD);
}
//
- AbstractBeanMetaData managedPortletApplicationMD = createManagedPortletApplicationMetaData(builder.getApplication(), managedPortletApplicationId);
+ AbstractBeanMetaData portletApplicationMD = createPortletApplicationMetaData(builder.getApplication(), portletApplicationId);
+ AbstractBeanMetaData managedPortletApplicationMD = createManagedPortletApplicationMetaData(managedPortletApplicationId);
-/*
- // Inject the managed portlet application in the portlet application
+ //
AbstractDependencyValueMetaData portletApplicationContextDependencyMD = new AbstractDependencyValueMetaData(managedPortletApplicationId);
portletApplicationContextDependencyMD.setDependentState(ControllerState.INSTANTIATED);
- portletApplicationMD.setProperties(Collections.singleton((PropertyMetaData)new AbstractPropertyMetaData("context", portletApplicationContextDependencyMD)));
+ portletApplicationMD.getProperties().add(new AbstractPropertyMetaData("context", portletApplicationContextDependencyMD));
- // Inject the portlet application managed portlet application
+ //
AbstractDependencyValueMetaData portletApplicationDependencyMD = new AbstractDependencyValueMetaData(portletApplicationId);
- portletApplicationDependencyMD.setDependentState(ControllerState.INSTALLED);
- managedPortletApplicationMD.setProperties(Tools.toSet((PropertyMetaData)new AbstractPropertyMetaData("peer", portletApplicationDependencyMD)));
+ portletApplicationDependencyMD.setDependentState(ControllerState.START);
+ managedPortletApplicationMD.getProperties().add(new AbstractPropertyMetaData("portletApplication", portletApplicationDependencyMD));
- // Install the managed portlet application on the portlet application deployer
- AbstractInstallMetaData installManagedPortletApplicationMD = new AbstractInstallMetaData();
- installManagedPortletApplicationMD.setBean("PortletApplicationDeployer");
- installManagedPortletApplicationMD.setParameters(Collections.singletonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData())));
- installManagedPortletApplicationMD.setMethodName("installManagedPortletApplication");
- managedPortletApplicationMD.setInstalls(Collections.singletonList((InstallMetaData)installManagedPortletApplicationMD));
-
- // Uninstall the managed portlet application from the portlet application deployer
- AbstractInstallMetaData uninstallManagedPortletApplicationMD = new AbstractInstallMetaData();
- uninstallManagedPortletApplicationMD.setBean("PortletApplicationDeployer");
- uninstallManagedPortletApplicationMD.setParameters(Collections.singletonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData())));
- uninstallManagedPortletApplicationMD.setMethodName("uninstallManagedPortletApplication");
- managedPortletApplicationMD.setUninstalls(Collections.singletonList((InstallMetaData)uninstallManagedPortletApplicationMD));
-*/
-
//
+ toInstall.add(portletApplicationMD);
toInstall.add(managedPortletApplicationMD);
-// toInstall.add(portletApplicationMD);
// Install beans
for (AbstractBeanMetaData beanMetaData : toInstall)
Modified: modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml
===================================================================
--- modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml 2008-02-19 10:58:39 UTC (rev 10025)
+++ modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml 2008-02-19 11:39:23 UTC (rev 10026)
@@ -103,7 +103,8 @@
<!-- The portlet container invoker -->
<bean name="PortletContainerInvoker" class="org.jboss.portal.portlet.container.PortletContainerInvoker">
<property name="stackFactory"><inject bean="ContainerStackFactory"/></property>
- <property name="registry"><inject bean="PortletApplicationRegistry"/></property>
+ <incallback method="addPortletContainer"/>
+ <uncallback method="removePortletContainer"/>
</bean>
<!-- The producer persistence manager -->
Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/jboss-beans.xml
===================================================================
--- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/jboss-beans.xml 2008-02-19 10:58:39 UTC (rev 10025)
+++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/jboss-beans.xml 2008-02-19 11:39:23 UTC (rev 10026)
@@ -91,7 +91,8 @@
<!-- The portlet container invoker -->
<bean name="PortletContainerInvoker" class="org.jboss.portal.portlet.container.PortletContainerInvoker">
<property name="stackFactory"><inject bean="ContainerStackFactory"/></property>
- <property name="registry"><inject bean="PortletApplicationRegistry"/></property>
+ <incallback method="addPortletContainer"/>
+ <uncallback method="removePortletContainer"/>
</bean>
<!-- The producer persistence manager -->
18 years, 2 months
JBoss Portal SVN: r10025 - branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/ui/portlet/role.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-02-19 05:58:39 -0500 (Tue, 19 Feb 2008)
New Revision: 10025
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/ui/portlet/role/RolePortlet.java
Log:
JBPORTAL-1902: Former role portlet missing a jsp on forbidden access
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/ui/portlet/role/RolePortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/ui/portlet/role/RolePortlet.java 2008-02-19 07:47:47 UTC (rev 10024)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/ui/portlet/role/RolePortlet.java 2008-02-19 10:58:39 UTC (rev 10025)
@@ -484,7 +484,7 @@
}
else
{
- forbidden(req, resp);
+ throw new PortletSecurityException("Access is forbidden");
}
}
@@ -497,21 +497,6 @@
resp.setWindowState(WindowState.MAXIMIZED);
}
- /**
- * Handles permissions errors on doView.
- *
- * @param rReq
- * @param rRes
- * @throws javax.portlet.PortletException
- * @throws IOException
- */
- private void forbidden(javax.portlet.RenderRequest rReq, javax.portlet.RenderResponse rRes) throws javax.portlet.PortletException, IOException
- {
- rRes.setContentType("text/html");
- javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/WEB-INF/jsp/permission/forbidden.jsp");
- prd.include(rReq, rRes);
- }
-
public void createRole(JBossActionRequest req, JBossActionResponse resp)
{
if (req.isUserInRole(ADMIN_ROLE))
18 years, 2 months
JBoss Portal SVN: r10024 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-02-19 02:47:47 -0500 (Tue, 19 Feb 2008)
New Revision: 10024
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml
Log:
minor additions
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml 2008-02-19 04:56:52 UTC (rev 10023)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml 2008-02-19 07:47:47 UTC (rev 10024)
@@ -316,7 +316,7 @@
</supports>]]></screen></term>
<listitem>
<para>
- The <computeroutput><supports></computeroutput> element allows you to declare all of the markup types your portlet supports in the <literal>render</literal> method. This is accomplished via the
+ The <computeroutput><supports></computeroutput> element allows you to declare all of the markup types that your portlet supports in the <literal>render</literal> method. This is accomplished via the
<computeroutput><mime-type></computeroutput> element, which is required for every portlet. The declared MIME types must match the capability of the portlet. As well, it allows you to pair which modes and window states are supported for each markup type. All portlets must support the VIEW portlet mode, so this does not have to be declared. Use the <computeroutput><mime-type></computeroutput> element to define which markup type your portlet supports, which in this example, is <computeroutput>text/html</computeroutput>. This section tells the portal that it will only output text and HTML, and that it only supports the <computeroutput>VIEW</computeroutput> mode.
</para>
</listitem>
@@ -1091,7 +1091,7 @@
</supports>]]></screen></term>
<listitem>
<para>
- The <computeroutput><supports></computeroutput> element allows you to declare all of the markup types your portlet supports in the <literal>render</literal> method. This is accomplished via the
+ The <computeroutput><supports></computeroutput> element allows you to declare all of the markup types that your portlet supports in the <literal>render</literal> method. This is accomplished via the
<computeroutput><mime-type></computeroutput> element, which is required for every portlet. The declared MIME types must match the capability of the portlet. As well, it allows you to pair which modes and window states are supported for each markup type. All portlets must support the VIEW portlet mode, so this does not have to be declared. Use the <computeroutput><mime-type></computeroutput> element to define which markup type your portlet supports, which in this example, is <computeroutput>text/html</computeroutput>. This section tells the portal that it will only output text and HTML, and that it only supports the <computeroutput>VIEW</computeroutput> mode.
</para>
</listitem>
@@ -1423,7 +1423,7 @@
</supports>]]></screen></term>
<listitem>
<para>
- The <computeroutput><supports></computeroutput> element allows you to declare all of the markup types your portlet supports in the <literal>render</literal> method. This is accomplished via the
+ The <computeroutput><supports></computeroutput> element allows you to declare all of the markup types that your portlet supports in the <literal>render</literal> method. This is accomplished via the
<computeroutput><mime-type></computeroutput> element, which is required for every portlet. The declared MIME types must match the capability of the portlet. As well, it allows you to pair which modes and window states are supported for each markup type. All portlets must support the VIEW portlet mode, so this does not have to be declared. Use the <computeroutput><mime-type></computeroutput> element to define which markup type your portlet supports, which in this example, is <computeroutput>text/html</computeroutput>. This section tells the portal that it will only output text and HTML, and that it only supports the <computeroutput>VIEW</computeroutput> mode.
</para>
</listitem>
@@ -1434,7 +1434,7 @@
<note>
<title>Adding Functionality to an Apache MyFaces JSF Portlet</title>
<para>
- To add functionality to an Apache MyFaces JSF Portlet, sub-class it and create your own class.
+ To add functionality to an Apache MyFaces JSF portlet, sub-class it and create your own class.
</para>
</note>
</para>
@@ -1479,7 +1479,7 @@
</screen>
</para>
<para>
- These extra parameters let the application server know that the portlet embeds its own libraries. This avoids collision with the Sun JSF RI libraries bundled with JBoss AS and JBoss EAP. For more information, refer to the <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossFaces">Apache MyFaces page on the JBoss Wiki</ulink>.
+ These extra parameters let the application server know that the portlet embeds its own libraries. This avoids collision with the Sun JSF RI libraries bundled with JBoss AS and JBoss EAP. For more information, refer to the <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossFaces">JBossFaces page on the JBoss Wiki</ulink>.
</para>
</sect3>
<sect3>
@@ -1555,7 +1555,7 @@
<para>
Performing this step on a running instance of JBoss AS or JBoss EAP, and JBoss Portal, will trigger a hot-deploy of the portlet.
</para><para>
- To see the HelloWorldJSFMyFaces42Portlet, navigate to <ulink url="http://localhost:8080/portal/"></ulink>, or, if the default JBoss Portal page is already open, refresh the page. HelloWorldJSFMyFaces42Portlet is added to the bottom of the default JBoss Portal page:
+ To see the HelloWorldJSFMyFaces42Portlet, navigate to <ulink url="http://localhost:8080/portal/"></ulink>, or, if the default JBoss Portal page is already open, refresh the page. The HelloWorldJSFMyFaces42Portlet is added to the bottom of the default JBoss Portal page:
</para>
<para>
<mediaobject>
18 years, 2 months