You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by gp...@apache.org on 2010/11/29 20:09:29 UTC
svn commit: r1040231 [1/2] - in /myfaces/extensions/cdi/trunk: ./
component-support-modules/ component-support-modules/trinidad-support/
component-support-modules/trinidad-support/src/
component-support-modules/trinidad-support/src/main/ component-supp...
Author: gpetracek
Date: Mon Nov 29 19:09:28 2010
New Revision: 1040231
URL: http://svn.apache.org/viewvc?rev=1040231&view=rev
Log:
EXTCDI-88 first draft
Added:
myfaces/extensions/cdi/trunk/component-support-modules/
myfaces/extensions/cdi/trunk/component-support-modules/pom.xml
myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/
myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/pom.xml
myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/
myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/
myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/java/
myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/java/org/
myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/java/org/apache/
myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/java/org/apache/myfaces/
myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/java/org/apache/myfaces/extensions/
myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/java/org/apache/myfaces/extensions/cdi/
myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/java/org/apache/myfaces/extensions/cdi/trinidad/
myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/java/org/apache/myfaces/extensions/cdi/trinidad/impl/
myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/java/org/apache/myfaces/extensions/cdi/trinidad/impl/InitTrinidad.java
- copied, changed from r1039808, myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_trinidad12/src/main/java/org/apache/myfaces/examples/codi/trinidad12/InitTrinidad.java
myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/java/org/apache/myfaces/extensions/cdi/trinidad/impl/TrinidadRenderKitWrapper.java
myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/java/org/apache/myfaces/extensions/cdi/trinidad/impl/TrinidadRenderKitWrapperFactory.java
myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/resources/
myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/resources/META-INF/
myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/resources/META-INF/LICENSE.txt
myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/resources/META-INF/NOTICE.txt
myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/resources/META-INF/beans.xml
myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/scope/conversation/spi/RenderKitWrapperFactory.java
Removed:
myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_trinidad12/src/main/java/org/apache/myfaces/examples/codi/trinidad12/InitTrinidad.java
Modified:
myfaces/extensions/cdi/trunk/core/impl/src/main/java/org/apache/myfaces/extensions/cdi/core/impl/util/ClassDeactivation.java
myfaces/extensions/cdi/trunk/core/impl/src/main/java/org/apache/myfaces/extensions/cdi/core/impl/util/CodiUtils.java
myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_trinidad12/pom.xml
myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/scope/conversation/CodiRenderKitFactory.java
myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/scope/conversation/InterceptedResponseWriter.java
myfaces/extensions/cdi/trunk/jee-modules/jsf20-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf2/impl/scope/conversation/CodiRenderKitFactory.java
myfaces/extensions/cdi/trunk/jee-modules/jsf20-module/impl/src/main/resources/META-INF/beans.xml
myfaces/extensions/cdi/trunk/pom.xml
Added: myfaces/extensions/cdi/trunk/component-support-modules/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/component-support-modules/pom.xml?rev=1040231&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/component-support-modules/pom.xml (added)
+++ myfaces/extensions/cdi/trunk/component-support-modules/pom.xml Mon Nov 29 19:09:28 2010
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <packaging>pom</packaging>
+
+ <groupId>org.apache.myfaces.extensions.cdi.modules.component-support</groupId>
+ <artifactId>component-support-modules-project</artifactId>
+
+ <name>MyFaces Extensions-CDI Component-Support-Modules</name>
+ <version>0.9.1-SNAPSHOT</version>
+
+ <parent>
+ <groupId>org.apache.myfaces.extensions.cdi</groupId>
+ <artifactId>myfaces-extcdi-parent</artifactId>
+ <version>0.9.1-SNAPSHOT</version>
+ </parent>
+
+ <modules>
+ <module>trinidad-support</module>
+ </modules>
+
+</project>
Added: myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/pom.xml?rev=1040231&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/pom.xml (added)
+++ myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/pom.xml Mon Nov 29 19:09:28 2010
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <packaging>jar</packaging>
+
+ <groupId>org.apache.myfaces.extensions.cdi.modules.component-support</groupId>
+ <artifactId>myfaces-extcdi-trinidad12-support</artifactId>
+
+ <name>MyFaces Extensions-CDI Trinidad Support Module</name>
+ <version>0.9.1-SNAPSHOT</version>
+
+ <parent>
+ <groupId>org.apache.myfaces.extensions.cdi.modules.component-support</groupId>
+ <artifactId>component-support-modules-project</artifactId>
+ <version>0.9.1-SNAPSHOT</version>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-api</artifactId>
+ <version>${myfaces1.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
+ <artifactId>myfaces-extcdi-jsf12-module-impl</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.trinidad</groupId>
+ <artifactId>trinidad-api</artifactId>
+ </dependency>
+ </dependencies>
+
+</project>
Copied: myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/java/org/apache/myfaces/extensions/cdi/trinidad/impl/InitTrinidad.java (from r1039808, myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_trinidad12/src/main/java/org/apache/myfaces/examples/codi/trinidad12/InitTrinidad.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/java/org/apache/myfaces/extensions/cdi/trinidad/impl/InitTrinidad.java?p2=myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/java/org/apache/myfaces/extensions/cdi/trinidad/impl/InitTrinidad.java&p1=myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_trinidad12/src/main/java/org/apache/myfaces/examples/codi/trinidad12/InitTrinidad.java&r1=1039808&r2=1040231&rev=1040231&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_trinidad12/src/main/java/org/apache/myfaces/examples/codi/trinidad12/InitTrinidad.java (original)
+++ myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/java/org/apache/myfaces/extensions/cdi/trinidad/impl/InitTrinidad.java Mon Nov 29 19:09:28 2010
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.myfaces.examples.codi.trinidad12;
+package org.apache.myfaces.extensions.cdi.trinidad.impl;
import static org.apache.myfaces.extensions.cdi.core.api.util.ClassUtils.tryToInstantiateClassForName;
import org.apache.myfaces.extensions.cdi.jsf.api.listener.phase.JsfPhaseId;
Added: myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/java/org/apache/myfaces/extensions/cdi/trinidad/impl/TrinidadRenderKitWrapper.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/java/org/apache/myfaces/extensions/cdi/trinidad/impl/TrinidadRenderKitWrapper.java?rev=1040231&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/java/org/apache/myfaces/extensions/cdi/trinidad/impl/TrinidadRenderKitWrapper.java (added)
+++ myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/java/org/apache/myfaces/extensions/cdi/trinidad/impl/TrinidadRenderKitWrapper.java Mon Nov 29 19:09:28 2010
@@ -0,0 +1,197 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.extensions.cdi.trinidad.impl;
+
+import org.apache.myfaces.trinidad.util.Service;
+import org.apache.myfaces.trinidad.render.DialogRenderKitService;
+import org.apache.myfaces.trinidad.render.ExtendedRenderKitService;
+import org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.InterceptedResponseWriter;
+
+import javax.faces.render.RenderKit;
+import javax.faces.render.Renderer;
+import javax.faces.render.ResponseStateManager;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.context.ResponseStream;
+import javax.faces.component.UIViewRoot;
+import javax.faces.component.UIComponent;
+import java.util.Map;
+import java.io.IOException;
+import java.io.Writer;
+import java.io.OutputStream;
+
+/**
+ * @author Gerhard Petracek
+ */
+class TrinidadRenderKitWrapper extends RenderKit
+ implements Service.Provider, DialogRenderKitService, ExtendedRenderKitService
+{
+ private RenderKit wrapped;
+
+ public TrinidadRenderKitWrapper(RenderKit wrapped)
+ {
+ this.wrapped = wrapped;
+ }
+
+ public ResponseWriter createResponseWriter(Writer writer, String s, String s1)
+ {
+ ResponseWriter responseWriter = wrapped.createResponseWriter(writer, s, s1);
+
+ if (responseWriter == null)
+ {
+ return null;
+ }
+
+ return new InterceptedResponseWriter(responseWriter);
+ }
+
+ public <T> T getService(Class<T> tClass)
+ {
+ if(this.wrapped instanceof Service.Provider)
+ {
+ return ((Service.Provider)this.wrapped).getService(tClass);
+ }
+ return null;
+ }
+
+ public boolean launchDialog(FacesContext facesContext,
+ UIViewRoot uiViewRoot,
+ UIComponent uiComponent,
+ Map<String, Object> processParameters,
+ boolean useWindow,
+ Map<String, Object> windowProperties)
+ {
+ if(this.wrapped instanceof DialogRenderKitService)
+ {
+ return ((DialogRenderKitService)this.wrapped).launchDialog(facesContext,
+ uiViewRoot,
+ uiComponent,
+ processParameters,
+ useWindow,
+ windowProperties);
+ }
+
+ //TODO logging
+ return false;
+ }
+
+ public boolean returnFromDialog(FacesContext facesContext, Object returnValue)
+ {
+ if(this.wrapped instanceof DialogRenderKitService)
+ {
+ return ((DialogRenderKitService)this.wrapped).returnFromDialog(facesContext, returnValue);
+ }
+
+ //TODO logging
+ return false;
+ }
+
+ public boolean isReturning(FacesContext facesContext, UIComponent source)
+ {
+ if(this.wrapped instanceof DialogRenderKitService)
+ {
+ return ((DialogRenderKitService)this.wrapped).returnFromDialog(facesContext, source);
+ }
+
+ //TODO logging
+ return false;
+ }
+
+ public void addScript(FacesContext facesContext, String s)
+ {
+ if(this.wrapped instanceof ExtendedRenderKitService)
+ {
+ ((ExtendedRenderKitService)this.wrapped).addScript(facesContext, s);
+ }
+ }
+
+ public void encodeScripts(FacesContext facesContext) throws IOException
+ {
+ if(this.wrapped instanceof ExtendedRenderKitService)
+ {
+ ((ExtendedRenderKitService)this.wrapped).encodeScripts(facesContext);
+ }
+ }
+
+ public boolean shortCircuitRenderView(FacesContext facesContext) throws IOException
+ {
+ if(this.wrapped instanceof ExtendedRenderKitService)
+ {
+ ((ExtendedRenderKitService)this.wrapped).shortCircuitRenderView(facesContext);
+ }
+
+ //TODO logging
+ return false;
+ }
+
+ public boolean isStateless(FacesContext facesContext)
+ {
+ if(this.wrapped instanceof ExtendedRenderKitService)
+ {
+ ((ExtendedRenderKitService)this.wrapped).isStateless(facesContext);
+ }
+
+ //TODO logging
+ return false;
+ }
+
+ public void encodeBegin(FacesContext facesContext) throws IOException
+ {
+ if(this.wrapped instanceof ExtendedRenderKitService)
+ {
+ ((ExtendedRenderKitService)this.wrapped).encodeBegin(facesContext);
+ }
+ }
+
+ public void encodeEnd(FacesContext facesContext) throws IOException
+ {
+ if(this.wrapped instanceof ExtendedRenderKitService)
+ {
+ ((ExtendedRenderKitService)this.wrapped).encodeEnd(facesContext);
+ }
+ }
+
+ public void encodeFinally(FacesContext facesContext)
+ {
+ if(this.wrapped instanceof ExtendedRenderKitService)
+ {
+ ((ExtendedRenderKitService)this.wrapped).encodeFinally(facesContext);
+ }
+ }
+
+ public void addRenderer(String s, String s1, Renderer renderer)
+ {
+ this.wrapped.addRenderer(s, s1, renderer);
+ }
+
+ public Renderer getRenderer(String s, String s1)
+ {
+ return this.wrapped.getRenderer(s, s1);
+ }
+
+ public ResponseStateManager getResponseStateManager()
+ {
+ return this.wrapped.getResponseStateManager();
+ }
+
+ public ResponseStream createResponseStream(OutputStream outputStream)
+ {
+ return this.wrapped.createResponseStream(outputStream);
+ }
+}
Added: myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/java/org/apache/myfaces/extensions/cdi/trinidad/impl/TrinidadRenderKitWrapperFactory.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/java/org/apache/myfaces/extensions/cdi/trinidad/impl/TrinidadRenderKitWrapperFactory.java?rev=1040231&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/java/org/apache/myfaces/extensions/cdi/trinidad/impl/TrinidadRenderKitWrapperFactory.java (added)
+++ myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/java/org/apache/myfaces/extensions/cdi/trinidad/impl/TrinidadRenderKitWrapperFactory.java Mon Nov 29 19:09:28 2010
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.extensions.cdi.trinidad.impl;
+
+import org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.spi.RenderKitWrapperFactory;
+
+import javax.inject.Singleton;
+import javax.faces.render.RenderKit;
+
+/**
+ * @author Gerhard Petracek
+ */
+@Singleton
+public class TrinidadRenderKitWrapperFactory implements RenderKitWrapperFactory
+{
+ public RenderKit create(RenderKit renderKit)
+ {
+ return new TrinidadRenderKitWrapper(renderKit);
+ }
+}
Added: myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/resources/META-INF/LICENSE.txt
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/resources/META-INF/LICENSE.txt?rev=1040231&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/resources/META-INF/LICENSE.txt (added)
+++ myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/resources/META-INF/LICENSE.txt Mon Nov 29 19:09:28 2010
@@ -0,0 +1,174 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
Added: myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/resources/META-INF/NOTICE.txt
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/resources/META-INF/NOTICE.txt?rev=1040231&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/resources/META-INF/NOTICE.txt (added)
+++ myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/resources/META-INF/NOTICE.txt Mon Nov 29 19:09:28 2010
@@ -0,0 +1,9 @@
+Apache MyFaces Extensions CDI (aka MyFaces CODI)
+Copyright 2010 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
+------------------------------------------------------------------------
+See the file LICENSE.txt
+------------------------------------------------------------------------
\ No newline at end of file
Added: myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/resources/META-INF/beans.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/resources/META-INF/beans.xml?rev=1040231&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/resources/META-INF/beans.xml (added)
+++ myfaces/extensions/cdi/trunk/component-support-modules/trinidad-support/src/main/resources/META-INF/beans.xml Mon Nov 29 19:09:28 2010
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+
+</beans>
Modified: myfaces/extensions/cdi/trunk/core/impl/src/main/java/org/apache/myfaces/extensions/cdi/core/impl/util/ClassDeactivation.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/core/impl/src/main/java/org/apache/myfaces/extensions/cdi/core/impl/util/ClassDeactivation.java?rev=1040231&r1=1040230&r2=1040231&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/core/impl/src/main/java/org/apache/myfaces/extensions/cdi/core/impl/util/ClassDeactivation.java (original)
+++ myfaces/extensions/cdi/trunk/core/impl/src/main/java/org/apache/myfaces/extensions/cdi/core/impl/util/ClassDeactivation.java Mon Nov 29 19:09:28 2010
@@ -23,8 +23,6 @@ import org.apache.myfaces.extensions.cdi
import java.util.logging.Logger;
-import static org.apache.myfaces.extensions.cdi.core.api.util.ClassUtils.tryToInstantiateClassForName;
-
/**
* @author Gerhard Petracek
*/
@@ -57,16 +55,10 @@ public class ClassDeactivation
private static ClassDeactivator getClassDeactivator()
{
- ClassDeactivator classDeactivator;
-
- // check system property
- classDeactivator = getClassDeactivatorFromEnvironment();
-
- // check JNDI param
- if (classDeactivator == null)
- {
- classDeactivator = getClassDeactivatorFromJNDI();
- }
+ ClassDeactivator classDeactivator = CodiUtils
+ .lookupFromEnvironment(CLASS_DEACTIVATOR_PROPERTY_NAME,
+ CLASS_DEACTIVATOR_JNDI_NAME,
+ ClassDeactivator.class);
// use default deactivator
if (classDeactivator == null)
@@ -89,38 +81,6 @@ public class ClassDeactivation
return classDeactivator;
}
- private static ClassDeactivator getClassDeactivatorFromEnvironment()
- {
- String classDeactivatorName = System.getProperty(CLASS_DEACTIVATOR_PROPERTY_NAME);
- if (classDeactivatorName != null)
- {
- return tryToInstantiateClassForName(classDeactivatorName, ClassDeactivator.class);
- }
-
- return null;
- }
-
- private static ClassDeactivator getClassDeactivatorFromJNDI()
- {
- String classDeactivatorName = null;
-
- try
- {
- classDeactivatorName = JndiUtils.lookup(CLASS_DEACTIVATOR_JNDI_NAME, String.class);
- }
- catch (RuntimeException jndiException)
- {
- // noop - lookup did not work
- }
-
- if (classDeactivatorName != null)
- {
- return tryToInstantiateClassForName(classDeactivatorName, ClassDeactivator.class);
- }
-
- return null;
- }
-
private static AbstractClassDeactivator createClassDeactivatorPlaceholder()
{
return new AbstractClassDeactivator()
Modified: myfaces/extensions/cdi/trunk/core/impl/src/main/java/org/apache/myfaces/extensions/cdi/core/impl/util/CodiUtils.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/core/impl/src/main/java/org/apache/myfaces/extensions/cdi/core/impl/util/CodiUtils.java?rev=1040231&r1=1040230&r2=1040231&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/core/impl/src/main/java/org/apache/myfaces/extensions/cdi/core/impl/util/CodiUtils.java (original)
+++ myfaces/extensions/cdi/trunk/core/impl/src/main/java/org/apache/myfaces/extensions/cdi/core/impl/util/CodiUtils.java Mon Nov 29 19:09:28 2010
@@ -22,6 +22,7 @@ import org.apache.myfaces.extensions.cdi
import org.apache.myfaces.extensions.cdi.core.api.projectstage.ProjectStage;
import org.apache.myfaces.extensions.cdi.core.api.provider.BeanManagerProvider;
import org.apache.myfaces.extensions.cdi.core.api.util.ClassUtils;
+import static org.apache.myfaces.extensions.cdi.core.api.util.ClassUtils.tryToInstantiateClassForName;
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.AnnotatedType;
@@ -443,4 +444,36 @@ public class CodiUtils
// annotation has no methods
return Collections.emptyList();
}
+
+ public static <T> T lookupFromEnvironment(String systemPropertyName, String jndiName , Class<T> targetType)
+ {
+ String className = System.getProperty(systemPropertyName);
+ if (className != null)
+ {
+ return tryToInstantiateClassForName(className, targetType);
+ }
+
+ String classDeactivatorName = null;
+
+ try
+ {
+ classDeactivatorName = JndiUtils.lookup(jndiName, String.class);
+ }
+ catch (RuntimeException jndiException)
+ {
+ // noop - lookup did not work
+ }
+
+ if (classDeactivatorName != null)
+ {
+ return tryToInstantiateClassForName(classDeactivatorName, targetType);
+ }
+
+ return null;
+ }
+
+ public static boolean isCdiInitialized()
+ {
+ return BeanManagerProvider.getInstance() != null;
+ }
}
Modified: myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_trinidad12/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_trinidad12/pom.xml?rev=1040231&r1=1040230&r2=1040231&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_trinidad12/pom.xml (original)
+++ myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_trinidad12/pom.xml Mon Nov 29 19:09:28 2010
@@ -85,6 +85,12 @@
<scope>compile</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.extensions.cdi.modules.component-support</groupId>
+ <artifactId>myfaces-extcdi-trinidad-support</artifactId>
+ <scope>compile</scope>
+ </dependency>
+
<!-- TODO -->
<dependency>
<groupId>org.apache.openwebbeans</groupId>
Modified: myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/scope/conversation/CodiRenderKitFactory.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/scope/conversation/CodiRenderKitFactory.java?rev=1040231&r1=1040230&r2=1040231&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/scope/conversation/CodiRenderKitFactory.java (original)
+++ myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/scope/conversation/CodiRenderKitFactory.java Mon Nov 29 19:09:28 2010
@@ -20,6 +20,8 @@ package org.apache.myfaces.extensions.cd
import org.apache.myfaces.extensions.cdi.core.api.Deactivatable;
import org.apache.myfaces.extensions.cdi.core.impl.util.ClassDeactivation;
+import org.apache.myfaces.extensions.cdi.core.impl.util.CodiUtils;
+import org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.spi.RenderKitWrapperFactory;
import javax.faces.context.FacesContext;
import javax.faces.render.RenderKit;
@@ -27,17 +29,34 @@ import javax.faces.render.RenderKitFacto
import java.util.Iterator;
/**
+ * !!!keep in sync with org.apache.myfaces.extensions.cdi.jsf2.impl.scope.conversation.CodiRenderKitFactory!!!
+ *
* @author Gerhard Petracek
*/
public class CodiRenderKitFactory extends RenderKitFactory implements Deactivatable
{
+ public static final String RENDER_KIT_WRAPPER_FACTORY_PROPERTY_NAME =
+ "org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.spi.RenderKitWrapperFactory";
+ public static final String RENDER_KIT_WRAPPER_FACTORY_JNDI_NAME =
+ "java:comp/env/myfaces-codi/RenderKitWrapperFactory";
+
private RenderKitFactory wrapped;
+ private RenderKitWrapperFactory renderKitWrapperFactory;
+
+ private Boolean initialized;
private final boolean deactivated;
public CodiRenderKitFactory(RenderKitFactory wrapped)
{
this.wrapped = wrapped;
this.deactivated = !isActivated();
+
+ if(!this.deactivated)
+ {
+ this.renderKitWrapperFactory = CodiUtils.lookupFromEnvironment(RENDER_KIT_WRAPPER_FACTORY_PROPERTY_NAME,
+ RENDER_KIT_WRAPPER_FACTORY_JNDI_NAME,
+ RenderKitWrapperFactory.class);
+ }
}
public void addRenderKit(String s, RenderKit renderKit)
@@ -58,9 +77,36 @@ public class CodiRenderKitFactory extend
{
return renderKit;
}
+
+ //workaround for mojarra
+
+ if(this.initialized == null)
+ {
+ lazyInit();
+ }
+
+ if(this.renderKitWrapperFactory != null)
+ {
+ return this.renderKitWrapperFactory.create(renderKit);
+ }
+
return new InterceptedRenderKit(renderKit);
}
+ private void lazyInit()
+ {
+ if(this.renderKitWrapperFactory == null && CodiUtils.isCdiInitialized())
+ {
+ this.renderKitWrapperFactory = CodiUtils
+ .getOrCreateScopedInstanceOfBeanByClass(RenderKitWrapperFactory.class, true);
+ }
+
+ if(CodiUtils.isCdiInitialized())
+ {
+ this.initialized = true;
+ }
+ }
+
public Iterator<String> getRenderKitIds()
{
return wrapped.getRenderKitIds();
Modified: myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/scope/conversation/InterceptedResponseWriter.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/scope/conversation/InterceptedResponseWriter.java?rev=1040231&r1=1040230&r2=1040231&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/scope/conversation/InterceptedResponseWriter.java (original)
+++ myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/scope/conversation/InterceptedResponseWriter.java Mon Nov 29 19:09:28 2010
@@ -32,11 +32,11 @@ import java.io.IOException;
*
* @author Gerhard Petracek
*/
-class InterceptedResponseWriter extends ResponseWriterWrapper
+public class InterceptedResponseWriter extends ResponseWriterWrapper
{
private ResponseWriter wrapped;
- InterceptedResponseWriter(ResponseWriter wrapped)
+ public InterceptedResponseWriter(ResponseWriter wrapped)
{
this.wrapped = wrapped;
}
Added: myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/scope/conversation/spi/RenderKitWrapperFactory.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/scope/conversation/spi/RenderKitWrapperFactory.java?rev=1040231&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/scope/conversation/spi/RenderKitWrapperFactory.java (added)
+++ myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/scope/conversation/spi/RenderKitWrapperFactory.java Mon Nov 29 19:09:28 2010
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.spi;
+
+import javax.faces.render.RenderKit;
+
+/**
+ * Component libs like Trinidad use very special renderkits.
+ * This factory allows support modules to customize the default behavior of CODI.
+ *
+ * @author Gerhard Petracek
+ */
+public interface RenderKitWrapperFactory
+{
+ /**
+ * Creates a {@link RenderKit} based on the currently active {@link RenderKit}
+ *
+ * @param renderKit active {@link RenderKit}
+ * @return wrapped {@link RenderKit}
+ */
+ RenderKit create(RenderKit renderKit);
+}
Modified: myfaces/extensions/cdi/trunk/jee-modules/jsf20-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf2/impl/scope/conversation/CodiRenderKitFactory.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jee-modules/jsf20-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf2/impl/scope/conversation/CodiRenderKitFactory.java?rev=1040231&r1=1040230&r2=1040231&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jee-modules/jsf20-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf2/impl/scope/conversation/CodiRenderKitFactory.java (original)
+++ myfaces/extensions/cdi/trunk/jee-modules/jsf20-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf2/impl/scope/conversation/CodiRenderKitFactory.java Mon Nov 29 19:09:28 2010
@@ -20,6 +20,8 @@ package org.apache.myfaces.extensions.cd
import org.apache.myfaces.extensions.cdi.core.api.Deactivatable;
import org.apache.myfaces.extensions.cdi.core.impl.util.ClassDeactivation;
+import org.apache.myfaces.extensions.cdi.core.impl.util.CodiUtils;
+import org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.spi.RenderKitWrapperFactory;
import javax.faces.context.FacesContext;
import javax.faces.render.RenderKit;
@@ -27,17 +29,35 @@ import javax.faces.render.RenderKitFacto
import java.util.Iterator;
/**
+ * We can't extend the CodiRenderKitFactory of the JSF 1.2 module because this class indirectly implements the new
+ * {@link javax.faces.FacesWrapper} interface.
+ *
+ * !!!keep both implementations in sync!!!
+ *
* @author Gerhard Petracek
*/
public class CodiRenderKitFactory extends RenderKitFactory implements Deactivatable
{
private final RenderKitFactory wrapped;
+ private RenderKitWrapperFactory renderKitWrapperFactory;
+
+ private Boolean initialized;
private final boolean deactivated;
public CodiRenderKitFactory(RenderKitFactory wrapped)
{
this.wrapped = wrapped;
this.deactivated = !isActivated();
+
+ if(!this.deactivated)
+ {
+ this.renderKitWrapperFactory = CodiUtils.lookupFromEnvironment(
+ org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.CodiRenderKitFactory
+ .RENDER_KIT_WRAPPER_FACTORY_PROPERTY_NAME,
+ org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.CodiRenderKitFactory
+ .RENDER_KIT_WRAPPER_FACTORY_JNDI_NAME,
+ RenderKitWrapperFactory.class);
+ }
}
public void addRenderKit(String s, RenderKit renderKit)
@@ -58,9 +78,36 @@ public class CodiRenderKitFactory extend
{
return renderKit;
}
+
+ //workaround for mojarra
+
+ if(this.initialized == null)
+ {
+ lazyInit();
+ }
+
+ if(this.renderKitWrapperFactory != null)
+ {
+ return this.renderKitWrapperFactory.create(renderKit);
+ }
+
return new InterceptedRenderKit(renderKit);
}
+ private void lazyInit()
+ {
+ if(this.renderKitWrapperFactory == null && CodiUtils.isCdiInitialized())
+ {
+ this.renderKitWrapperFactory = CodiUtils
+ .getOrCreateScopedInstanceOfBeanByClass(RenderKitWrapperFactory.class, true);
+ }
+
+ if(CodiUtils.isCdiInitialized())
+ {
+ this.initialized = true;
+ }
+ }
+
public Iterator<String> getRenderKitIds()
{
return wrapped.getRenderKitIds();
Modified: myfaces/extensions/cdi/trunk/jee-modules/jsf20-module/impl/src/main/resources/META-INF/beans.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jee-modules/jsf20-module/impl/src/main/resources/META-INF/beans.xml?rev=1040231&r1=1040230&r2=1040231&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jee-modules/jsf20-module/impl/src/main/resources/META-INF/beans.xml (original)
+++ myfaces/extensions/cdi/trunk/jee-modules/jsf20-module/impl/src/main/resources/META-INF/beans.xml Mon Nov 29 19:09:28 2010
@@ -24,5 +24,6 @@
<interceptors>
<class>org.apache.myfaces.extensions.cdi.jsf.impl.security.SecurityInterceptor</class>
<class>org.apache.myfaces.extensions.cdi.jsf.impl.listener.phase.ViewControllerInterceptor</class>
+ <class>org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.CloseConversationGroupInterceptor</class>
</interceptors>
</beans>