geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r996014 - in /geronimo/server/trunk/plugins/myfaces: geronimo-myfaces-builder/ geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/ geronimo-myfaces/src/main/java/org/apache/geronimo/myfaces/ geronimo-myfaces/src/t...
Date Fri, 10 Sep 2010 22:59:35 GMT
Author: djencks
Date: Fri Sep 10 22:59:34 2010
New Revision: 996014

URL: http://svn.apache.org/viewvc?rev=996014&view=rev
Log:
GERONIMO-5567 adapt myfaces to new way to add listeners

Modified:
    geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/pom.xml
    geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java
    geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/main/java/org/apache/geronimo/myfaces/LifecycleProviderFactoryGBean.java
    geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/test/java/org/apache/geronimo/myfaces/BasicTest.java

Modified: geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/pom.xml?rev=996014&r1=996013&r2=996014&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/pom.xml (original)
+++ geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/pom.xml Fri Sep 10 22:59:34
2010
@@ -39,6 +39,11 @@
             <artifactId>geronimo-j2ee-builder</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-web</artifactId>
+            <version>${project.version}</version>
+        </dependency>
         
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>

Modified: geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java?rev=996014&r1=996013&r2=996014&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java
(original)
+++ geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java
Fri Sep 10 22:59:34 2010
@@ -60,6 +60,7 @@ import org.apache.geronimo.kernel.config
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.util.IOUtils;
 import org.apache.geronimo.myfaces.LifecycleProviderGBean;
+import org.apache.geronimo.web.info.WebAppInfo;
 import org.apache.myfaces.webapp.StartupServletContextListener;
 import org.apache.openejb.jee.FacesConfig;
 import org.apache.openejb.jee.FacesManagedBean;
@@ -102,8 +103,8 @@ public class MyFacesModuleBuilderExtensi
     private static final String JAVAX_FACES_CONFIG_FILES_SEPARATOR = ",";
 
     public MyFacesModuleBuilderExtension(@ParamAttribute(name = "defaultEnvironment") Environment
defaultEnvironment,
-            @ParamAttribute(name = "providerFactoryNameQuery") AbstractNameQuery providerFactoryNameQuery,
-            @ParamReference(name = "NamingBuilders", namingType = NameFactory.MODULE_BUILDER)
NamingBuilder namingBuilders) {
+                                         @ParamAttribute(name = "providerFactoryNameQuery")
AbstractNameQuery providerFactoryNameQuery,
+                                         @ParamReference(name = "NamingBuilders", namingType
= NameFactory.MODULE_BUILDER) NamingBuilder namingBuilders) {
         this.defaultEnvironment = defaultEnvironment;
         this.providerFactoryNameQuery = providerFactoryNameQuery;
         this.namingBuilders = namingBuilders;
@@ -114,7 +115,7 @@ public class MyFacesModuleBuilderExtensi
     }
 
     public void createModule(Module module, Object plan, JarFile moduleFile, String targetPath,
URL specDDUrl, Environment environment, Object moduleContextInfo, AbstractName earName, Naming
naming,
-            ModuleIDBuilder idBuilder) throws DeploymentException {
+                             ModuleIDBuilder idBuilder) throws DeploymentException {
         mergeEnvironment(module);
     }
 
@@ -148,7 +149,7 @@ public class MyFacesModuleBuilderExtensi
                 break;
             }
         }
-        StringBuilder configFiles = new StringBuilder(configFilesPV != null && configFilesPV.getParamValue()
!=null  ? configFilesPV.getParamValue() : "");
+        StringBuilder configFiles = new StringBuilder(configFilesPV != null && configFilesPV.getParamValue()
!= null ? configFilesPV.getParamValue() : "");
         File libDirectory = new File(earContext.getBaseDir() + File.separator + "WEB-INF"
+ File.separator + "lib");
         if (!libDirectory.exists()) {
             return;
@@ -225,9 +226,14 @@ public class MyFacesModuleBuilderExtensi
         //add the ServletContextListener to the web app context
         GBeanData webAppData = (GBeanData) sharedContext.get(WebModule.WEB_APP_DATA);
         // add myfaces listener
-        Object value = webAppData.getAttribute("listenerClassNames");
-        if (value instanceof Collection && !((Collection) value).contains(CONTEXT_LISTENER_NAME))
{
-            ((Collection<String>) value).add(CONTEXT_LISTENER_NAME);
+        WebAppInfo webAppInfo = (WebAppInfo) webAppData.getAttribute("webAppInfo");
+        if (webAppInfo != null && !webAppInfo.listeners.contains(CONTEXT_LISTENER_NAME))
{
+            webAppInfo.listeners.add(CONTEXT_LISTENER_NAME);
+        } else {
+            Object value = webAppData.getAttribute("listenerClassNames");
+            if (value instanceof Collection && !((Collection) value).contains(CONTEXT_LISTENER_NAME))
{
+                ((Collection<String>) value).add(CONTEXT_LISTENER_NAME);
+            }
         }
         AbstractName moduleName = moduleContext.getModuleName();
         Map<EARContext.Key, Object> buildingContext = new HashMap<EARContext.Key,
Object>();

Modified: geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/main/java/org/apache/geronimo/myfaces/LifecycleProviderFactoryGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/main/java/org/apache/geronimo/myfaces/LifecycleProviderFactoryGBean.java?rev=996014&r1=996013&r2=996014&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/main/java/org/apache/geronimo/myfaces/LifecycleProviderFactoryGBean.java
(original)
+++ geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/main/java/org/apache/geronimo/myfaces/LifecycleProviderFactoryGBean.java
Fri Sep 10 22:59:34 2010
@@ -19,13 +19,13 @@
 
 package org.apache.geronimo.myfaces;
 
+import org.apache.geronimo.gbean.annotation.GBean;
 import org.apache.myfaces.config.annotation.LifecycleProviderFactory;
-import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.GBeanInfoBuilder;
 
 /**
  * @version $Rev$ $Date$
  */
+@GBean
 public class LifecycleProviderFactoryGBean implements LifecycleProviderFactorySource {
 
     private final ApplicationIndexedLifecycleProviderFactory factory;
@@ -39,16 +39,5 @@ public class LifecycleProviderFactoryGBe
     public ApplicationIndexedLifecycleProviderFactory getLifecycleProviderFactory() {
         return factory;
     }
-    public static final GBeanInfo GBEAN_INFO;
-
-    static {
-        GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(LifecycleProviderFactoryGBean.class,
GBeanInfoBuilder.DEFAULT_J2EE_TYPE);
-
-        GBEAN_INFO = infoBuilder.getBeanInfo();
-    }
-
-    public static GBeanInfo getGBeanInfo() {
-        return GBEAN_INFO;
-    }
 
 }

Modified: geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/test/java/org/apache/geronimo/myfaces/BasicTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/test/java/org/apache/geronimo/myfaces/BasicTest.java?rev=996014&r1=996013&r2=996014&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/test/java/org/apache/geronimo/myfaces/BasicTest.java
(original)
+++ geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/test/java/org/apache/geronimo/myfaces/BasicTest.java
Fri Sep 10 22:59:34 2010
@@ -23,6 +23,7 @@ package org.apache.geronimo.myfaces;
 import junit.framework.TestCase;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.annotation.AnnotationGBeanInfoFactory;
 
 /**
  * @version $Rev$ $Date$
@@ -30,7 +31,7 @@ import org.apache.geronimo.gbean.GBeanIn
 public class BasicTest extends TestCase {
 
     public void testLifecycleProviderFactory() throws Exception {
-        GBeanInfo gbeanInfo = LifecycleProviderFactoryGBean.getGBeanInfo();
+        GBeanInfo gbeanInfo = new AnnotationGBeanInfoFactory().getGBeanInfo(LifecycleProviderFactoryGBean.class);
         LifecycleProviderFactoryGBean factory = new LifecycleProviderFactoryGBean();
         ApplicationIndexedLifecycleProviderFactory providerFactory = factory.getLifecycleProviderFactory();
         assertNotNull(providerFactory);



Mime
View raw message