You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2008/10/07 23:02:04 UTC
svn commit: r702637 [1/2] - in /myfaces/commons/trunk: ./
myfaces-async-lifecycle/ myfaces-async-lifecycle/src/
myfaces-async-lifecycle/src/main/ myfaces-async-lifecycle/src/main/java/
myfaces-async-lifecycle/src/main/java/org/ myfaces-async-lifecycle/...
Author: bommel
Date: Tue Oct 7 14:02:03 2008
New Revision: 702637
URL: http://svn.apache.org/viewvc?rev=702637&view=rev
Log:
create an async lifecycle module based on Greg Wilkins suggestion
http://wiki.glassfish.java.net/Wiki.jsp?page=AlternateAsyncProposalRebuttal
moved the common lifecycle and facesContext stuff to commons-utils
Added:
myfaces/commons/trunk/myfaces-async-lifecycle/ (with props)
myfaces/commons/trunk/myfaces-async-lifecycle/pom.xml (with props)
myfaces/commons/trunk/myfaces-async-lifecycle/src/
myfaces/commons/trunk/myfaces-async-lifecycle/src/main/
myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/
myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/
myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/
myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/
myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/
myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/
myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncFacesContext.java (with props)
myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncFacesContextFactory.java (with props)
myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncLifecycle.java (with props)
myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncLifecycleFactory.java (with props)
myfaces/commons/trunk/myfaces-async-lifecycle/src/main/resources/
myfaces/commons/trunk/myfaces-async-lifecycle/src/main/resources/META-INF/
myfaces/commons/trunk/myfaces-async-lifecycle/src/main/resources/META-INF/faces-config.xml (with props)
myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/context/
myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/context/FacesContextFactoryWrapper.java (with props)
myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/context/FacesContextWrapper.java
- copied, changed from r702220, myfaces/core/trunk_1.2.x/impl/src/main/java/org/apache/myfaces/context/FacesContextWrapper.java
myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/
myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/ApplyRequestValuesExecutor.java (contents, props changed)
- copied, changed from r702214, myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/ApplyRequestValuesExecutor.java
myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/DefaultLifecycle.java (contents, props changed)
- copied, changed from r702215, myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/PartialLifecycle.java
myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/InvokeApplicationExecutor.java (contents, props changed)
- copied, changed from r702214, myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/InvokeApplicationExecutor.java
myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/LifecycleFactoryWrapper.java (with props)
myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/PhaseExecutor.java (contents, props changed)
- copied, changed from r702211, myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/PhaseExecutor.java
myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/PhaseListenerManager.java (contents, props changed)
- copied, changed from r702211, myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/PhaseListenerManager.java
myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/ProcessValidationsExecutor.java (contents, props changed)
- copied, changed from r702214, myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/ProcessValidationsExecutor.java
myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/RenderResponseExecutor.java (contents, props changed)
- copied, changed from r702214, myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/RenderResponseExecutor.java
myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/RestoreViewExecutor.java (contents, props changed)
- copied, changed from r702216, myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/RestoreViewExecutor.java
myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/UpdateModelValuesExecutor.java (contents, props changed)
- copied, changed from r702214, myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/UpdateModelValuesExecutor.java
Modified:
myfaces/commons/trunk/myfaces-commons-assembly/pom.xml
myfaces/commons/trunk/pom.xml
Propchange: myfaces/commons/trunk/myfaces-async-lifecycle/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Oct 7 14:02:03 2008
@@ -0,0 +1,10 @@
+target
+.classpath
+.project
+.wtpmodules
+*.ipr
+*.iml
+*.iws
+.settings
+maven-eclipse.xml
+.externalToolsBuilder
Added: myfaces/commons/trunk/myfaces-async-lifecycle/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-async-lifecycle/pom.xml?rev=702637&view=auto
==============================================================================
--- myfaces/commons/trunk/myfaces-async-lifecycle/pom.xml (added)
+++ myfaces/commons/trunk/myfaces-async-lifecycle/pom.xml Tue Oct 7 14:02:03 2008
@@ -0,0 +1,116 @@
+<?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>
+ <parent>
+ <groupId>org.apache.myfaces.commons</groupId>
+ <artifactId>commons12</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ </parent>
+ <artifactId>myfaces-async-lifecycle</artifactId>
+ <packaging>jar</packaging>
+ <name>Apache MyFaces Common Async Lifecycle</name>
+
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>servlet-api-3.0</artifactId>
+ <version>7.0.0pre2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.commons</groupId>
+ <artifactId>myfaces-commons-utils12</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jxr-plugin</artifactId>
+ <version>2.1</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <version>2.4.3</version>
+ </plugin>
+ </plugins>
+ </reporting>
+ <profiles>
+ <profile>
+ <!--
+ - Build and install into the repository some additional artifacts that we don't
+ - want to build during normal development because they take too long.
+ -->
+ <id>generate-assembly</id>
+ <activation>
+ <property>
+ <name>performRelease</name>
+ <value>true</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <!-- Install in the repository a "-javadoc.jar" file -->
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.4</version>
+ <executions>
+ <execution>
+ <id>attach-javadoc</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <!-- Install in the repository a "-sources.jar" file -->
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-source</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
Propchange: myfaces/commons/trunk/myfaces-async-lifecycle/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/commons/trunk/myfaces-async-lifecycle/pom.xml
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncFacesContext.java
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncFacesContext.java?rev=702637&view=auto
==============================================================================
--- myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncFacesContext.java (added)
+++ myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncFacesContext.java Tue Oct 7 14:02:03 2008
@@ -0,0 +1,50 @@
+/*
+ * 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.commons.async;
+
+import org.apache.myfaces.commons.context.FacesContextWrapper;
+
+import javax.faces.context.FacesContext;
+import javax.servlet.ServletRequest;
+
+public class AsyncFacesContext extends FacesContextWrapper {
+
+ public AsyncFacesContext(FacesContext facesContext) {
+ super(facesContext);
+ FacesContext.setCurrentInstance(this);
+ }
+
+ public void register() {
+ FacesContext.setCurrentInstance(this);
+ }
+
+ public void release() {
+ if (getExternalContext().getRequest() instanceof ServletRequest
+ && ((ServletRequest) getExternalContext().getRequest()).isSuspended()) {
+ ((ServletRequest) getExternalContext().getRequest()).setAttribute(AsyncFacesContext.class.getName(), this);
+ } else {
+ super.release();
+ }
+ }
+
+ public boolean getResponseComplete() {
+ return (getExternalContext().getRequest() instanceof ServletRequest
+ && ((ServletRequest) getExternalContext().getRequest()).isSuspended()) || super.getResponseComplete();
+ }
+}
Propchange: myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncFacesContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncFacesContext.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncFacesContextFactory.java
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncFacesContextFactory.java?rev=702637&view=auto
==============================================================================
--- myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncFacesContextFactory.java (added)
+++ myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncFacesContextFactory.java Tue Oct 7 14:02:03 2008
@@ -0,0 +1,47 @@
+/*
+ * 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.commons.async;
+
+import org.apache.myfaces.commons.context.FacesContextFactoryWrapper;
+
+import javax.faces.context.FacesContextFactory;
+import javax.faces.context.FacesContext;
+import javax.faces.lifecycle.Lifecycle;
+import javax.faces.FacesException;
+import javax.servlet.ServletRequest;
+
+public class AsyncFacesContextFactory extends FacesContextFactoryWrapper {
+
+ public AsyncFacesContextFactory(FacesContextFactory factory) {
+ super(factory);
+ }
+
+ public FacesContext getFacesContext(final Object context, final Object request, final Object response,
+ final Lifecycle lifecycle) throws FacesException {
+ if (request instanceof ServletRequest) {
+ AsyncFacesContext facesContext = (AsyncFacesContext)
+ ((ServletRequest) request).getAttribute(AsyncFacesContext.class.getName());
+ if (facesContext != null) {
+ facesContext.register();
+ return facesContext;
+ }
+ }
+ return new AsyncFacesContext(super.getFacesContext(context, request, response, lifecycle));
+ }
+}
Propchange: myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncFacesContextFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncFacesContextFactory.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncLifecycle.java
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncLifecycle.java?rev=702637&view=auto
==============================================================================
--- myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncLifecycle.java (added)
+++ myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncLifecycle.java Tue Oct 7 14:02:03 2008
@@ -0,0 +1,70 @@
+/*
+ * 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.commons.async;
+
+import org.apache.myfaces.commons.lifecycle.DefaultLifecycle;
+import org.apache.myfaces.commons.lifecycle.PhaseListenerManager;
+import org.apache.myfaces.commons.lifecycle.PhaseExecutor;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.faces.context.FacesContext;
+import javax.faces.FacesException;
+import javax.faces.event.PhaseId;
+import javax.servlet.ServletRequest;
+
+public class AsyncLifecycle extends DefaultLifecycle {
+
+ private static final Log LOG = LogFactory.getLog(AsyncLifecycle.class);
+
+ public void execute(FacesContext facesContext) throws FacesException
+ {
+ if (facesContext.getExternalContext().getRequest() instanceof ServletRequest) {
+ PhaseListenerManager phaseListenerMgr = new PhaseListenerManager(this, facesContext, getPhaseListeners());
+ ServletRequest request = (ServletRequest) facesContext.getExternalContext().getRequest();
+
+ Integer start = (Integer) request.getAttribute(AsyncLifecycle.class.getName());
+
+ int i = start == null ? 0 : start;
+
+ PhaseExecutor[] executors = getLifecycleExecutors();
+ for (int len = executors.length; i < len; i++)
+ {
+ LOG.info("Execute Phase " + executors[i].getPhase());
+ if (executePhase(facesContext, executors[i], phaseListenerMgr))
+ {
+ break;
+ }
+ }
+ LOG.info("Request suspended " + request.isSuspended());
+ request.setAttribute(AsyncLifecycle.class.getName(), i+1);
+ } else {
+ super.execute(facesContext);
+ }
+ }
+
+ public void render(FacesContext facesContext) throws FacesException {
+ if (facesContext.getExternalContext().getRequest() instanceof ServletRequest) {
+ ServletRequest request = (ServletRequest) facesContext.getExternalContext().getRequest();
+ LOG.info("Execute Phase " + PhaseId.RENDER_RESPONSE);
+ LOG.info("Request suspended " + request.isSuspended());
+ }
+ super.render(facesContext);
+ }
+}
Propchange: myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncLifecycle.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncLifecycle.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncLifecycleFactory.java
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncLifecycleFactory.java?rev=702637&view=auto
==============================================================================
--- myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncLifecycleFactory.java (added)
+++ myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncLifecycleFactory.java Tue Oct 7 14:02:03 2008
@@ -0,0 +1,41 @@
+/*
+ * 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.commons.async;
+
+import org.apache.myfaces.commons.lifecycle.LifecycleFactoryWrapper;
+
+import javax.faces.lifecycle.LifecycleFactory;
+import javax.faces.lifecycle.Lifecycle;
+
+
+public class AsyncLifecycleFactory extends LifecycleFactoryWrapper {
+
+ private AsyncLifecycle lifecycle = new AsyncLifecycle();
+
+ public AsyncLifecycleFactory(LifecycleFactory factory) {
+ super(factory);
+ }
+
+ public Lifecycle getLifecycle(String lifecycleId) {
+ if (LifecycleFactory.DEFAULT_LIFECYCLE.equals(lifecycleId)) {
+ return lifecycle;
+ }
+ return super.getLifecycle(lifecycleId);
+ }
+}
Propchange: myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncLifecycleFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/commons/trunk/myfaces-async-lifecycle/src/main/java/org/apache/myfaces/commons/async/AsyncLifecycleFactory.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/commons/trunk/myfaces-async-lifecycle/src/main/resources/META-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-async-lifecycle/src/main/resources/META-INF/faces-config.xml?rev=702637&view=auto
==============================================================================
--- myfaces/commons/trunk/myfaces-async-lifecycle/src/main/resources/META-INF/faces-config.xml (added)
+++ myfaces/commons/trunk/myfaces-async-lifecycle/src/main/resources/META-INF/faces-config.xml Tue Oct 7 14:02:03 2008
@@ -0,0 +1,30 @@
+<?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.
+-->
+
+<faces-config 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/web-facesconfig_1_2.xsd"
+ version="1.2">
+
+ <factory>
+ <faces-context-factory>org.apache.myfaces.commons.async.AsyncFacesContextFactory</faces-context-factory>
+ <lifecycle-factory>org.apache.myfaces.commons.async.AsyncLifecycleFactory</lifecycle-factory>
+ </factory>
+
+</faces-config>
\ No newline at end of file
Propchange: myfaces/commons/trunk/myfaces-async-lifecycle/src/main/resources/META-INF/faces-config.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/commons/trunk/myfaces-async-lifecycle/src/main/resources/META-INF/faces-config.xml
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Modified: myfaces/commons/trunk/myfaces-commons-assembly/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-assembly/pom.xml?rev=702637&r1=702636&r2=702637&view=diff
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-assembly/pom.xml (original)
+++ myfaces/commons/trunk/myfaces-commons-assembly/pom.xml Tue Oct 7 14:02:03 2008
@@ -10,7 +10,7 @@
<parent>
<groupId>org.apache.myfaces.commons</groupId>
<artifactId>commons12</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.1-SNAPSHOT</version>
</parent>
<build>
Added: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/context/FacesContextFactoryWrapper.java
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/context/FacesContextFactoryWrapper.java?rev=702637&view=auto
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/context/FacesContextFactoryWrapper.java (added)
+++ myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/context/FacesContextFactoryWrapper.java Tue Oct 7 14:02:03 2008
@@ -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.commons.context;
+
+import javax.faces.context.FacesContextFactory;
+import javax.faces.context.FacesContext;
+import javax.faces.lifecycle.Lifecycle;
+import javax.faces.FacesException;
+
+public class FacesContextFactoryWrapper extends FacesContextFactory
+{
+ private final FacesContextFactory factory;
+
+ public FacesContextFactoryWrapper(final FacesContextFactory factory) {
+ this.factory = factory;
+ }
+
+ public FacesContext getFacesContext(final Object context, final Object request, final Object response,
+ final Lifecycle lifecycle) throws FacesException {
+ return factory.getFacesContext(context, request, response, lifecycle);
+ }
+}
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/context/FacesContextFactoryWrapper.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/context/FacesContextFactoryWrapper.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Copied: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/context/FacesContextWrapper.java (from r702220, myfaces/core/trunk_1.2.x/impl/src/main/java/org/apache/myfaces/context/FacesContextWrapper.java)
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/context/FacesContextWrapper.java?p2=myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/context/FacesContextWrapper.java&p1=myfaces/core/trunk_1.2.x/impl/src/main/java/org/apache/myfaces/context/FacesContextWrapper.java&r1=702220&r2=702637&rev=702637&view=diff
==============================================================================
--- myfaces/core/trunk_1.2.x/impl/src/main/java/org/apache/myfaces/context/FacesContextWrapper.java (original)
+++ myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/context/FacesContextWrapper.java Tue Oct 7 14:02:03 2008
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.myfaces.context;
+package org.apache.myfaces.commons.context;
import javax.el.ELContext;
import javax.faces.application.Application;
Copied: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/ApplyRequestValuesExecutor.java (from r702214, myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/ApplyRequestValuesExecutor.java)
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/ApplyRequestValuesExecutor.java?p2=myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/ApplyRequestValuesExecutor.java&p1=myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/ApplyRequestValuesExecutor.java&r1=702214&r2=702637&rev=702637&view=diff
==============================================================================
--- myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/ApplyRequestValuesExecutor.java (original)
+++ myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/ApplyRequestValuesExecutor.java Tue Oct 7 14:02:03 2008
@@ -1,90 +1,37 @@
-package org.apache.myfaces.trinidadinternal.lifecycle;
-
/*
- * 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
+ * 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
+ * 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.
+ * 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.commons.lifecycle;
-
-import org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager;
-import org.apache.myfaces.trinidad.logging.TrinidadLogger;
-
-import javax.faces.component.ContextCallback;
-import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
import javax.faces.event.PhaseId;
-import java.util.Arrays;
-import java.util.Map;
/**
* Implements the lifecycle as described in Spec. 1.0 PFD Chapter 2
* <p/>
* Apply request values phase (JSF Spec 2.2.2)
*/
-class ApplyRequestValuesExecutor implements PhaseExecutor
+public class ApplyRequestValuesExecutor implements PhaseExecutor
{
- private static final TrinidadLogger LOG = TrinidadLogger.createTrinidadLogger(ApplyRequestValuesExecutor.class);
- private ContextCallback processDecodesCallback = new ApplyRequestValuesCallback();
- private ContextCallback decodeCallback = new DecodeCallback();
public boolean execute(FacesContext facesContext)
{
- String[] partialTargets = PartialLivecycleUtils.getPartialTargets(facesContext);
- if (partialTargets != null)
- {
- Map<String, String> parameterMap = facesContext.getExternalContext().getRequestParameterMap();
- UIViewRoot viewRoot = facesContext.getViewRoot();
- // TODO partialRequest from inside Tree or Table
-
- // TODO navigationTree
-
- for (String partialTarget : partialTargets)
- {
- viewRoot.invokeOnComponent(facesContext, partialTarget, processDecodesCallback);
- }
-
- // TODO how to check that source and form already included in a partialTarget
- String sourceName = parameterMap.get("source");
- if (sourceName != null && !Arrays.asList(partialTargets).contains(sourceName))
- {
- // TODO source inside a partialTarget
- boolean found = viewRoot.invokeOnComponent(facesContext, sourceName, decodeCallback);
- if (!found) {
- LOG.warning("No source UIComponent found for '" + sourceName + "'");
- }
- }
-
- String formName = parameterMap.get(CoreResponseStateManager.FORM_FIELD_NAME);
- if (formName != null && !Arrays.asList(partialTargets).contains(formName))
- {
- // TODO form inside partialTarget
- // SubForm set submitted by queueEvent
- boolean found = viewRoot.invokeOnComponent(facesContext, formName, decodeCallback);
- if (!found) {
- LOG.warning("No form UIComponent found for '" + formName + "'");
- }
- }
-
- // TODO broadcast Events UIViewRoot has no public method
- //viewRoot.broadcastEventsForPhase(facesContext, PhaseId.APPLY_REQUEST_VALUES);
-
- }
- else
- {
- facesContext.getViewRoot().processDecodes(facesContext);
- }
+ facesContext.getViewRoot().processDecodes(facesContext);
return false;
}
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/ApplyRequestValuesExecutor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/ApplyRequestValuesExecutor.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/ApplyRequestValuesExecutor.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue Oct 7 14:02:03 2008
@@ -0,0 +1 @@
+/myfaces/trinidad/branches/1.2.9.1-branch/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/ApplyRequestValuesExecutor.java:697924,699406,699496
Copied: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/DefaultLifecycle.java (from r702215, myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/PartialLifecycle.java)
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/DefaultLifecycle.java?p2=myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/DefaultLifecycle.java&p1=myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/PartialLifecycle.java&r1=702215&r2=702637&rev=702637&view=diff
==============================================================================
--- myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/PartialLifecycle.java (original)
+++ myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/DefaultLifecycle.java Tue Oct 7 14:02:03 2008
@@ -1,23 +1,25 @@
-package org.apache.myfaces.trinidadinternal.lifecycle;
-
/*
- * 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
+ * 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
+ * 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.
+ * 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.commons.lifecycle;
-import org.apache.myfaces.trinidad.logging.TrinidadLogger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import javax.faces.FacesException;
import javax.faces.context.FacesContext;
@@ -28,10 +30,10 @@
import java.util.List;
-public class PartialLifecycle extends Lifecycle
+public class DefaultLifecycle extends Lifecycle
{
- private static final TrinidadLogger LOG = TrinidadLogger.createTrinidadLogger(PartialLifecycle.class);
+ private static final Log LOG = LogFactory.getLog(DefaultLifecycle.class);
private PhaseExecutor[] lifecycleExecutors;
private PhaseExecutor renderExecutor;
@@ -43,18 +45,34 @@
*/
private PhaseListener[] phaseListenerArray = null;
- public PartialLifecycle()
+ public DefaultLifecycle()
{
// hide from public access
- lifecycleExecutors = new PhaseExecutor[]{
+ setLifecycleExecutors(new PhaseExecutor[]{
new RestoreViewExecutor(),
new ApplyRequestValuesExecutor(),
new ProcessValidationsExecutor(),
new UpdateModelValuesExecutor(),
- new InvokeApplicationExecutor()
- };
+ new InvokeApplicationExecutor()}
+ );
+
+ setRenderExecutor(new RenderResponseExecutor());
+ }
+
+ protected void setLifecycleExecutors(PhaseExecutor[] lifecycleExecutors) {
+ this.lifecycleExecutors = lifecycleExecutors;
+ }
+
+ protected void setRenderExecutor(PhaseExecutor renderExecutor) {
+ this.renderExecutor = renderExecutor;
+ }
+
+ protected PhaseExecutor[] getLifecycleExecutors() {
+ return lifecycleExecutors;
+ }
- renderExecutor = new RenderResponseExecutor();
+ protected PhaseExecutor getRenderExecutor() {
+ return renderExecutor;
}
public void execute(FacesContext facesContext) throws FacesException
@@ -62,7 +80,7 @@
PhaseListenerManager phaseListenerMgr = new PhaseListenerManager(this, facesContext, getPhaseListeners());
- for (PhaseExecutor executor : lifecycleExecutors)
+ for (PhaseExecutor executor : getLifecycleExecutors())
{
LOG.info("Execute Phase " + executor.getPhase());
if (executePhase(facesContext, executor, phaseListenerMgr))
@@ -72,14 +90,14 @@
}
}
- private boolean executePhase(FacesContext facesContext, PhaseExecutor executor, PhaseListenerManager phaseListenerMgr)
+ protected boolean executePhase(FacesContext facesContext, PhaseExecutor executor, PhaseListenerManager phaseListenerMgr)
throws FacesException
{
boolean skipFurtherProcessing = false;
- if (LOG.isFinest())
+ if (LOG.isTraceEnabled())
{
- LOG.finest("entering " + executor.getPhase() + " in " + this.getClass().getName());
+ LOG.trace("entering " + executor.getPhase() + " in " + this.getClass().getName());
}
@@ -114,9 +132,9 @@
skipFurtherProcessing = true;
}
- if (!skipFurtherProcessing && LOG.isFinest())
+ if (!skipFurtherProcessing && LOG.isTraceEnabled())
{
- LOG.finest("exiting " + executor.getPhase() + " in " + this.getClass().getName());
+ LOG.trace("exiting " + executor.getPhase() + " in " + this.getClass().getName());
}
return skipFurtherProcessing;
@@ -130,9 +148,9 @@
{
return;
}
- if (LOG.isFinest())
+ if (LOG.isTraceEnabled())
{
- LOG.finest("entering " + renderExecutor.getPhase() + " in " + this.getClass().getName());
+ LOG.trace("entering " + renderExecutor.getPhase() + " in " + this.getClass().getName());
}
PhaseListenerManager phaseListenerMgr = new PhaseListenerManager(this, facesContext, getPhaseListeners());
@@ -151,9 +169,9 @@
phaseListenerMgr.informPhaseListenersAfter(renderExecutor.getPhase());
}
- if (LOG.isFinest())
+ if (LOG.isTraceEnabled())
{
- LOG.finest("exiting " + renderExecutor.getPhase() + " in " + this.getClass().getName());
+ LOG.trace("exiting " + renderExecutor.getPhase() + " in " + this.getClass().getName());
}
}
@@ -162,9 +180,9 @@
boolean flag = false;
if (facesContext.getResponseComplete())
{
- if (LOG.isFine())
+ if (LOG.isTraceEnabled())
{
- LOG.fine("exiting from lifecycle.execute in " + phase
+ LOG.trace("exiting from lifecycle.execute in " + phase
+ " because getResponseComplete is true from one of the "
+ (before ? "before" : "after") + " listeners");
}
@@ -178,9 +196,9 @@
boolean flag = false;
if (facesContext.getRenderResponse())
{
- if (LOG.isFinest())
+ if (LOG.isTraceEnabled())
{
- LOG.finest("exiting from lifecycle.execute in " + phase
+ LOG.trace("exiting from lifecycle.execute in " + phase
+ " because getRenderResponse is true from one of the "
+ (before ? "before" : "after") + " listeners");
}
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/DefaultLifecycle.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/DefaultLifecycle.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/DefaultLifecycle.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue Oct 7 14:02:03 2008
@@ -0,0 +1 @@
+/myfaces/trinidad/branches/1.2.9.1-branch/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/PartialLifecycle.java:697924,699406,699496
Copied: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/InvokeApplicationExecutor.java (from r702214, myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/InvokeApplicationExecutor.java)
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/InvokeApplicationExecutor.java?p2=myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/InvokeApplicationExecutor.java&p1=myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/InvokeApplicationExecutor.java&r1=702214&r2=702637&rev=702637&view=diff
==============================================================================
--- myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/InvokeApplicationExecutor.java (original)
+++ myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/InvokeApplicationExecutor.java Tue Oct 7 14:02:03 2008
@@ -1,21 +1,22 @@
-package org.apache.myfaces.trinidadinternal.lifecycle;
-
/*
- * 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
+ * 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
+ * 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.
+ * 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.commons.lifecycle;
import javax.faces.context.FacesContext;
import javax.faces.event.PhaseId;
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/InvokeApplicationExecutor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/InvokeApplicationExecutor.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/InvokeApplicationExecutor.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue Oct 7 14:02:03 2008
@@ -0,0 +1 @@
+/myfaces/trinidad/branches/1.2.9.1-branch/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/InvokeApplicationExecutor.java:697924,699406,699496
Added: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/LifecycleFactoryWrapper.java
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/LifecycleFactoryWrapper.java?rev=702637&view=auto
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/LifecycleFactoryWrapper.java (added)
+++ myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/LifecycleFactoryWrapper.java Tue Oct 7 14:02:03 2008
@@ -0,0 +1,47 @@
+/*
+ * 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.commons.lifecycle;
+
+import javax.faces.lifecycle.LifecycleFactory;
+import javax.faces.lifecycle.Lifecycle;
+import java.util.Iterator;
+
+
+public class LifecycleFactoryWrapper extends LifecycleFactory
+{
+ LifecycleFactory factory;
+
+ public LifecycleFactoryWrapper(LifecycleFactory factory) {
+ this.factory = factory;
+ }
+
+ public void addLifecycle(String lifecycleId, Lifecycle lifecycle) {
+ factory.addLifecycle(lifecycleId, lifecycle);
+ }
+
+ public Lifecycle getLifecycle(String lifecycleId) {
+ return factory.getLifecycle(lifecycleId);
+
+ }
+
+ public Iterator<String> getLifecycleIds() {
+ return factory.getLifecycleIds();
+ }
+
+}
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/LifecycleFactoryWrapper.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/LifecycleFactoryWrapper.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Copied: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/PhaseExecutor.java (from r702211, myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/PhaseExecutor.java)
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/PhaseExecutor.java?p2=myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/PhaseExecutor.java&p1=myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/PhaseExecutor.java&r1=702211&r2=702637&rev=702637&view=diff
==============================================================================
--- myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/PhaseExecutor.java (original)
+++ myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/PhaseExecutor.java Tue Oct 7 14:02:03 2008
@@ -1,21 +1,22 @@
-package org.apache.myfaces.trinidadinternal.lifecycle;
-
/*
- * 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
+ * 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
+ * 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.
+ * 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.commons.lifecycle;
import javax.faces.context.FacesContext;
import javax.faces.event.PhaseId;
@@ -23,7 +24,7 @@
/**
* Implements the PhaseExecutor for a lifecycle
*/
-interface PhaseExecutor
+public interface PhaseExecutor
{
/**
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/PhaseExecutor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/PhaseExecutor.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/PhaseExecutor.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue Oct 7 14:02:03 2008
@@ -0,0 +1 @@
+/myfaces/trinidad/branches/1.2.9.1-branch/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/PhaseExecutor.java:697924,699406,699496
Copied: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/PhaseListenerManager.java (from r702211, myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/PhaseListenerManager.java)
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/PhaseListenerManager.java?p2=myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/PhaseListenerManager.java&p1=myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/PhaseListenerManager.java&r1=702211&r2=702637&rev=702637&view=diff
==============================================================================
--- myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/PhaseListenerManager.java (original)
+++ myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/PhaseListenerManager.java Tue Oct 7 14:02:03 2008
@@ -1,23 +1,25 @@
-package org.apache.myfaces.trinidadinternal.lifecycle;
-
/*
- * 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
+ * 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
+ * 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.
+ * 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.commons.lifecycle;
-import org.apache.myfaces.trinidad.logging.TrinidadLogger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import javax.faces.context.FacesContext;
import javax.faces.event.PhaseEvent;
@@ -32,10 +34,10 @@
* needed because of issue 9 of the JSF 1.2 spec. See section 11.3 for more
* details.
*/
-class PhaseListenerManager
+public class PhaseListenerManager
{
- private static final TrinidadLogger LOG = TrinidadLogger.createTrinidadLogger(PhaseListenerManager.class);
+ private static final Log LOG = LogFactory.getLog(PhaseListenerManager.class);
private Lifecycle lifecycle;
private FacesContext facesContext;
@@ -52,7 +54,7 @@
* @param facesContext
* @param phaseListeners
*/
- PhaseListenerManager(Lifecycle lifecycle, FacesContext facesContext, PhaseListener[] phaseListeners)
+ public PhaseListenerManager(Lifecycle lifecycle, FacesContext facesContext, PhaseListener[] phaseListeners)
{
this.lifecycle = lifecycle;
this.facesContext = facesContext;
@@ -83,7 +85,7 @@
} catch (Exception e)
{
beforePhaseSuccess[i] = false; // redundant - for clarity
- LOG.severe("Exception in PhaseListener " + phaseId.toString() + " beforePhase.", e);
+ LOG.error("Exception in PhaseListener " + phaseId.toString() + " beforePhase.", e);
return;
}
}
@@ -105,7 +107,7 @@
phaseListener.afterPhase(new PhaseEvent(facesContext, phaseId, lifecycle));
} catch (Exception e)
{
- LOG.severe("Exception in PhaseListener " + phaseId.toString() + " afterPhase", e);
+ LOG.error("Exception in PhaseListener " + phaseId.toString() + " afterPhase", e);
}
}
}
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/PhaseListenerManager.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/PhaseListenerManager.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/PhaseListenerManager.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue Oct 7 14:02:03 2008
@@ -0,0 +1 @@
+/myfaces/trinidad/branches/1.2.9.1-branch/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/PhaseListenerManager.java:697924,699406,699496
Copied: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/ProcessValidationsExecutor.java (from r702214, myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/ProcessValidationsExecutor.java)
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/ProcessValidationsExecutor.java?p2=myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/ProcessValidationsExecutor.java&p1=myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/ProcessValidationsExecutor.java&r1=702214&r2=702637&rev=702637&view=diff
==============================================================================
--- myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/ProcessValidationsExecutor.java (original)
+++ myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/ProcessValidationsExecutor.java Tue Oct 7 14:02:03 2008
@@ -1,23 +1,23 @@
-package org.apache.myfaces.trinidadinternal.lifecycle;
-
/*
- * 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
+ * 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
+ * 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.
+ * 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.commons.lifecycle;
-import javax.faces.component.ContextCallback;
import javax.faces.context.FacesContext;
import javax.faces.event.PhaseId;
@@ -25,24 +25,9 @@
public class ProcessValidationsExecutor implements PhaseExecutor
{
- private ContextCallback contextCallback = new ProcessValidationsCallback();
-
public boolean execute(FacesContext facesContext)
{
- String[] partialTargets = PartialLivecycleUtils.getPartialTargets(facesContext);
- if (partialTargets != null)
- {
- for (String clientId : partialTargets)
- {
- facesContext.getViewRoot().invokeOnComponent(facesContext, clientId, contextCallback);
- }
- //UIViewRoot viewRoot = facesContext.getViewRoot();
- // TODO broadcast Events UIViewRoot has no public method
- //viewRoot.broadcastEventsForPhase(facesContext, PROCESS_VALIDATIONS);
- } else
- {
- facesContext.getViewRoot().processValidators(facesContext);
- }
+ facesContext.getViewRoot().processValidators(facesContext);
return false;
}
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/ProcessValidationsExecutor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/ProcessValidationsExecutor.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/ProcessValidationsExecutor.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue Oct 7 14:02:03 2008
@@ -0,0 +1 @@
+/myfaces/trinidad/branches/1.2.9.1-branch/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/ProcessValidationsExecutor.java:697924,699406,699496
Copied: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/RenderResponseExecutor.java (from r702214, myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/RenderResponseExecutor.java)
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/RenderResponseExecutor.java?p2=myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/RenderResponseExecutor.java&p1=myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/RenderResponseExecutor.java&r1=702214&r2=702637&rev=702637&view=diff
==============================================================================
--- myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/RenderResponseExecutor.java (original)
+++ myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/RenderResponseExecutor.java Tue Oct 7 14:02:03 2008
@@ -1,165 +1,43 @@
-package org.apache.myfaces.trinidadinternal.lifecycle;
-
/*
- * 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
+ * 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
+ * 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.
+ * 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.
*/
-
-import org.apache.myfaces.trinidad.context.RenderingContext;
-import org.apache.myfaces.trinidad.context.FormData;
-import org.apache.myfaces.trinidad.render.ExtendedRenderKitService;
-import org.apache.myfaces.trinidad.util.Service;
-import org.apache.myfaces.trinidad.logging.TrinidadLogger;
-import org.apache.myfaces.trinidadinternal.renderkit.core.CoreRenderingContext;
-import org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager;
-import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlConstants;
-import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PartialPageUtils;
+package org.apache.myfaces.commons.lifecycle;
import javax.faces.FacesException;
import javax.faces.application.Application;
import javax.faces.application.ViewHandler;
-import javax.faces.component.ContextCallback;
-import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
import javax.faces.event.PhaseId;
-import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
-import java.util.Map;
public class RenderResponseExecutor implements PhaseExecutor
{
- private static final TrinidadLogger LOG = TrinidadLogger.createTrinidadLogger(RenderResponseExecutor.class);
- private ContextCallback contextCallback = new RenderResponseCallback();
public boolean execute(FacesContext facesContext)
{
- String[] partialTargets = PartialLivecycleUtils.getPartialTargets(facesContext);
try
{
- if (partialTargets != null)
- {
- // Most of this is a copy from ViewHandlerImpl
- // See if there is a possiblity of short-circuiting the current
- // Render Response
- ExtendedRenderKitService service = Service.getService(facesContext.getRenderKit(), ExtendedRenderKitService.class);
- if ((service != null) && service.shortCircuitRenderView(facesContext))
- {
- // Yup, we don't need to do anything
- return false;
- } else
- {
- try
- {
- if (service != null)
- {
- service.encodeBegin(facesContext);
- }
- HttpServletResponse response =
- (HttpServletResponse) facesContext.getExternalContext().getResponse();
- String contentType = "text/html";
- String encoding = "UTF-8";
-
- // TODO JspUtils.getEncoding(facesContext, "UTF-8");
-
- response.setContentType(contentType +
- "; charset=" + encoding);
-
- ResponseWriter responseWriter =
- facesContext.getRenderKit().createResponseWriter(response.getWriter(), contentType, encoding);
- LOG.info("ResponseWriter class: " + responseWriter.getClass().getName());
- facesContext.setResponseWriter(responseWriter);
-
- ResponseWriter rw = facesContext.getResponseWriter();
-
- // TODO Messages
- if (facesContext.getMessages().hasNext()) {
- // add messages to partialTargets
- }
-
- RenderingContext renderingContext = RenderingContext.getCurrentInstance();
- // ensure mark PPR active
- if (PartialPageUtils.isPartialRenderingPass(renderingContext)) {
- PartialPageUtils.markPPRActive(facesContext);
- }
- rw.startDocument();
+ Application application = facesContext.getApplication();
+ ViewHandler viewHandler = application.getViewHandler();
+ viewHandler.renderView(facesContext, facesContext.getViewRoot());
- Map<String, String> parameterMap = facesContext.getExternalContext().getRequestParameterMap();
- String formName = parameterMap.get(CoreResponseStateManager.FORM_FIELD_NAME);
- UIComponent form = facesContext.getViewRoot().findComponent(formName);
-
- // TODO form inside partial Target
- if (form != null)
- {
-
- // TODO find a better way or should form.encodeBegin called?
- //CoreFormData formData = new CoreFormData(formName);
- // FIXME
- //formData.addNeededValue(XhtmlConstants.PARTIAL_PARAM);
- //formData.addNeededValue(XhtmlConstants.STATE_PARAM);
- //formData.addNeededValue(XhtmlConstants.VALUE_PARAM);
-
- //renderingContext.setFormData(formData);
- form.encodeBegin(facesContext);
- FormData formData = renderingContext.getFormData();
- formData.addNeededValue(XhtmlConstants.PARTIAL_PARAM);
- formData.addNeededValue(XhtmlConstants.STATE_PARAM);
- formData.addNeededValue(XhtmlConstants.VALUE_PARAM);
-
- // FIXME
- if (renderingContext instanceof CoreRenderingContext)
- {
- Map<String, String> shortStyles = renderingContext.getSkin().getStyleClassMap(renderingContext);
- ((CoreRenderingContext) renderingContext).setStyleMap(shortStyles);
- }
- }
-
- for (String clientId : partialTargets)
- {
- LOG.info("Rendering partialTarget " + clientId);
- facesContext.getViewRoot().invokeOnComponent(facesContext, clientId, contextCallback);
- }
-
- // TODO writeState is performed by patched FormRenderer
- // find a better way
- if (form != null)
- {
- form.encodeEnd(facesContext);
- }
- rw.endDocument();
-
- if (service != null)
- {
- service.encodeEnd(facesContext);
- }
- }
- finally
- {
- if (service != null)
- {
- service.encodeFinally(facesContext);
- }
- }
- }
- } else
- {
- Application application = facesContext.getApplication();
- ViewHandler viewHandler = application.getViewHandler();
- viewHandler.renderView(facesContext, facesContext.getViewRoot());
- }
- } catch (IOException e)
+ }
+ catch (IOException e)
{
throw new FacesException(e.getMessage(), e);
}
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/RenderResponseExecutor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/RenderResponseExecutor.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/RenderResponseExecutor.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue Oct 7 14:02:03 2008
@@ -0,0 +1 @@
+/myfaces/trinidad/branches/1.2.9.1-branch/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/RenderResponseExecutor.java:697924,699406,699496
Copied: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/RestoreViewExecutor.java (from r702216, myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/RestoreViewExecutor.java)
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/RestoreViewExecutor.java?p2=myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/RestoreViewExecutor.java&p1=myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/RestoreViewExecutor.java&r1=702216&r2=702637&rev=702637&view=diff
==============================================================================
--- myfaces/trinidad/trunk_1.2.x/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/RestoreViewExecutor.java (original)
+++ myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/RestoreViewExecutor.java Tue Oct 7 14:02:03 2008
@@ -1,23 +1,25 @@
-package org.apache.myfaces.trinidadinternal.lifecycle;
-
/*
- * 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
+ * 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
+ * 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.
+ * 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.commons.lifecycle;
-import org.apache.myfaces.trinidad.logging.TrinidadLogger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import javax.el.ValueExpression;
import javax.faces.FacesException;
@@ -41,10 +43,11 @@
* <p/>
* Restore view phase (JSF Spec 2.2.1)
*/
-class RestoreViewExecutor implements PhaseExecutor
+public class RestoreViewExecutor implements PhaseExecutor
{
- private static final TrinidadLogger LOG = TrinidadLogger.createTrinidadLogger(RestoreViewExecutor.class);
+ private static final Log LOG = LogFactory.getLog(RestoreViewExecutor.class);
+
private static final String JAVAX_SERVLET_INCLUDE_SERVLET_PATH = "javax.servlet.include.servlet_path";
private static final String JAVAX_SERVLET_INCLUDE_PATH_INFO = "javax.servlet.include.path_info";
@@ -66,9 +69,9 @@
if (viewRoot != null)
{
- if (LOG.isFine())
+ if (LOG.isTraceEnabled())
{
- LOG.fine("View already exists in the FacesContext");
+ LOG.trace("View already exists in the FacesContext");
}
viewRoot.setLocale(facesContext.getExternalContext().getRequestLocale());
processComponentBinding(facesContext, viewRoot);
@@ -79,9 +82,9 @@
// Determine if this request is a postback or initial request
if (isPostback(facesContext))
{
- if (LOG.isFine())
+ if (LOG.isTraceEnabled())
{
- LOG.fine("Request is a postback");
+ LOG.trace("Request is a postback");
}
viewRoot = viewHandler.restoreView(facesContext, viewId);
@@ -94,9 +97,9 @@
processComponentBinding(facesContext, viewRoot);
} else
{
- if (LOG.isFine())
+ if (LOG.isTraceEnabled())
{
- LOG.fine("Request is not a postback. New UIViewRoot will be created");
+ LOG.trace("Request is not a postback. New UIViewRoot will be created");
}
viewRoot = viewHandler.createView(facesContext, viewId);
facesContext.renderResponse();
@@ -146,7 +149,7 @@
}
catch (Throwable th)
{
- LOG.severe("Exception while invoking handleBindings on component with client-id:"
+ LOG.error("Exception while invoking handleBindings on component with client-id:"
+ parent.getClientId(facesContext), th);
}
} else
@@ -220,19 +223,19 @@
Map requestMap = externalContext.getRequestMap();
String viewId = (String) requestMap.get(JAVAX_SERVLET_INCLUDE_PATH_INFO);
- boolean traceEnabled = LOG.isFine();
+ boolean traceEnabled = LOG.isTraceEnabled();
if (viewId != null)
{
if (traceEnabled)
{
- LOG.fine("Calculated viewId '" + viewId + "' from request param '" + JAVAX_SERVLET_INCLUDE_PATH_INFO + "'");
+ LOG.trace("Calculated viewId '" + viewId + "' from request param '" + JAVAX_SERVLET_INCLUDE_PATH_INFO + "'");
}
} else
{
viewId = externalContext.getRequestPathInfo();
if (viewId != null && traceEnabled)
{
- LOG.fine("Calculated viewId '" + viewId + "' from request path info");
+ LOG.trace("Calculated viewId '" + viewId + "' from request path info");
}
}
@@ -241,7 +244,7 @@
viewId = (String) requestMap.get(JAVAX_SERVLET_INCLUDE_SERVLET_PATH);
if (viewId != null && traceEnabled)
{
- LOG.fine("Calculated viewId '" + viewId + "' from request param '" + JAVAX_SERVLET_INCLUDE_SERVLET_PATH + "'");
+ LOG.trace("Calculated viewId '" + viewId + "' from request param '" + JAVAX_SERVLET_INCLUDE_SERVLET_PATH + "'");
}
}
@@ -250,7 +253,7 @@
viewId = externalContext.getRequestServletPath();
if (viewId != null && traceEnabled)
{
- LOG.fine("Calculated viewId '" + viewId + "' from request servlet path");
+ LOG.trace("Calculated viewId '" + viewId + "' from request servlet path");
}
}
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/RestoreViewExecutor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/RestoreViewExecutor.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: myfaces/commons/trunk/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/lifecycle/RestoreViewExecutor.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue Oct 7 14:02:03 2008
@@ -0,0 +1 @@
+/myfaces/trinidad/branches/1.2.9.1-branch/trinidad-partial-lifecycle/src/main/java/org/apache/myfaces/trinidadinternal/lifecycle/RestoreViewExecutor.java:697924,699406,699496