Author: julien(a)jboss.com
Date: 2007-08-21 08:43:14 -0400 (Tue, 21 Aug 2007)
New Revision: 8008
Added:
modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/InterceptorStackFactoryImpl.java
modules/portlet/trunk/test/src/resources/portlet-test-war/WEB-INF/classes/logging.properties
Modified:
modules/portlet/trunk/test/src/resources/portlet-test-war/WEB-INF/jboss-beans.xml
Log:
- wire more portlet container beans
- inject kernel beans into the servlet context attributes
- added tomcat logging based on jul
Added:
modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/InterceptorStackFactoryImpl.java
===================================================================
---
modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/InterceptorStackFactoryImpl.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/InterceptorStackFactoryImpl.java 2007-08-21
12:43:14 UTC (rev 8008)
@@ -0,0 +1,84 @@
+/******************************************************************************
+ * 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.test;
+
+import org.jboss.portal.common.invocation.InterceptorStack;
+import org.jboss.portal.common.invocation.Interceptor;
+import org.jboss.portal.common.invocation.InterceptorStackFactory;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class InterceptorStackFactoryImpl implements InterceptorStackFactory
+{
+
+ /** . */
+ private volatile Interceptor[] interceptors;
+
+ /** . */
+ private final InterceptorStackImpl stack = new InterceptorStackImpl();
+
+ public Interceptor[] getInterceptors()
+ {
+ return interceptors;
+ }
+
+ public void setInterceptors(Interceptor[] interceptors)
+ {
+ this.interceptors = interceptors;
+ }
+
+ public InterceptorStack getInterceptorStack()
+ {
+ return stack;
+ }
+
+ private class InterceptorStackImpl implements InterceptorStack
+ {
+
+ public int getLength()
+ {
+ // Avoid dirty reads
+ Interceptor[] interceptors = InterceptorStackFactoryImpl.this.interceptors;
+
+ //
+ return interceptors != null ? interceptors.length : 0;
+ }
+
+ public Interceptor getInterceptor(int i) throws ArrayIndexOutOfBoundsException
+ {
+ // Avoid dirty reads
+ Interceptor[] interceptors = InterceptorStackFactoryImpl.this.interceptors;
+
+ //
+ if (interceptors == null)
+ {
+ throw new ArrayIndexOutOfBoundsException("No interceptors");
+ }
+
+ //
+ return interceptors[i];
+ }
+ }
+}
Added:
modules/portlet/trunk/test/src/resources/portlet-test-war/WEB-INF/classes/logging.properties
===================================================================
---
modules/portlet/trunk/test/src/resources/portlet-test-war/WEB-INF/classes/logging.properties
(rev 0)
+++
modules/portlet/trunk/test/src/resources/portlet-test-war/WEB-INF/classes/logging.properties 2007-08-21
12:43:14 UTC (rev 8008)
@@ -0,0 +1,13 @@
+handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
+
+############################################################
+# Handler specific properties.
+# Describes specific configuration info for Handlers.
+############################################################
+
+org.apache.juli.FileHandler.level = FINE
+org.apache.juli.FileHandler.directory = ${catalina.base}/logs
+org.apache.juli.FileHandler.prefix = servlet-examples.
+
+java.util.logging.ConsoleHandler.level = FINE
+java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
Modified:
modules/portlet/trunk/test/src/resources/portlet-test-war/WEB-INF/jboss-beans.xml
===================================================================
---
modules/portlet/trunk/test/src/resources/portlet-test-war/WEB-INF/jboss-beans.xml 2007-08-20
22:51:27 UTC (rev 8007)
+++
modules/portlet/trunk/test/src/resources/portlet-test-war/WEB-INF/jboss-beans.xml 2007-08-21
12:43:14 UTC (rev 8008)
@@ -3,19 +3,92 @@
<deployment
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_2_0.xsd"
xmlns="urn:jboss:bean-deployer:2.0">
+
<bean name="PortletApplicationDeployer"
class="org.jboss.portal.portlet.test.PortletApplicationDeployer">
</bean>
+ <!-- An application registry mainly for listeners -->
<bean name="PortletApplicationRegistry"
class="org.jboss.portal.portlet.impl.container.PortletApplicationRegistryImpl">
-
</bean>
<bean name="PortletAPIFactory"
class="org.jboss.portal.portlet.impl.jsr168.PortletAPIFactoryImpl">
-
</bean>
<bean name="PortletInfoFactory"
class="org.jboss.portal.portlet.impl.jsr168.PortletInfoFactoryImpl">
+ </bean>
+ <!-- The servlet container context obtained from the ServletContainer registry
-->
+ <bean name="ServletContainerContext"
class="org.jboss.portal.web.spi.ServletContainerContext">
+ <constructor factoryClass="org.jboss.portal.web.ServletContainer"
factoryMethod="getContext"/>
</bean>
+ <!-- Consumer stack -->
+ <bean name="ConsumerCacheInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.ConsumerCacheInterceptor">
+ </bean>
+ <bean name="ConsumerStackFactory"
class="org.jboss.portal.portlet.test.InterceptorStackFactoryImpl">
+ <property name="interceptors">
+ <array>
+ <inject bean="ConsumerCacheInterceptor"/>
+ </array>
+ </property>
+ </bean>
+
+ <!-- The consumer portlet invoker -->
+ <bean name="ConsumerPortletInvoker"
class="org.jboss.portal.portlet.test.TestPortletInvoker">
+ <property name="producer"><inject
bean="ProducerPortletInvoker"/></property>
+ <property name="stackFactory"><inject
bean="ConsumerStackFactory"/></property>
+ </bean>
+
+ <!-- Container stack -->
+ <bean name="ValveInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.ValveInterceptor">
+ </bean>
+ <bean name="SecureTransportInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.SecureTransportInterceptor">
+ </bean>
+ <bean name="ContextDispatcherInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor">
+ <property name="servletContainerContext"><inject
bean="ServletContainerContext"/></property>
+ </bean>
+ <bean name="WindowStatesInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.WindowStatesInterceptor">
+ </bean>
+ <bean name="ModesInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.ModesInterceptor">
+ </bean>
+ <bean name="ProducerCacheInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.ProducerCacheInterceptor">
+ </bean>
+ <bean name="ContainerStackFactory"
class="org.jboss.portal.portlet.test.InterceptorStackFactoryImpl">
+ <property name="interceptors">
+ <array >
+ <inject bean="ValveInterceptor"/>
+ <inject bean="SecureTransportInterceptor"/>
+ <inject bean="ContextDispatcherInterceptor"/>
+ <inject bean="WindowStatesInterceptor"/>
+ <inject bean="ModesInterceptor"/>
+ <inject bean="ProducerCacheInterceptor"/>
+ </array>
+ </property>
+ </bean>
+
+ <!-- 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>
+ </bean>
+
+ <!-- The producer persistence manager -->
+ <bean name="ProducerPersistenceManager"
class="org.jboss.portal.portlet.impl.state.producer.PortletStatePersistenceManagerService"></bean>
+
+ <!-- The producer state management policy -->
+ <bean name="ProducerStateManagementPolicy"
class="org.jboss.portal.portlet.impl.state.StateManagementPolicyService">
+ <property
name="persistLocally"><value>true</value></property>
+ </bean>
+
+ <!-- The producer state converter -->
+ <bean name="ProducerStateConverter"
class="org.jboss.portal.portlet.impl.state.StateConverterV0"></bean>
+
+ <!-- The producer portlet invoker -->
+ <bean name="ProducerPortletInvoker"
class="org.jboss.portal.portlet.state.producer.ProducerPortletInvoker">
+ <property name="portletInvoker"><inject
bean="PortletContainerInvoker"/></property>
+ <property name="persistenceManager"><inject
bean="ProducerPersistenceManager"/></property>
+ <property name="stateManagementPolicy"><inject
bean="ProducerStateManagementPolicy"/></property>
+ <property name="stateConverter"><inject
bean="ProducerStateConverter"/></property>
+ </bean>
+
</deployment>