View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.myfaces.trinidad.context;
20  
21  import javax.faces.context.FacesContext;
22  
23  /**
24   * Class that represents a change that is tied to a component in the component tree.
25   * This class is used by {@link ComponentContextManager} to be able to suspend and resume
26   * the context of a component during an invoke on component or visit tree call.
27   * <p>Note that implementing classes are encouraged to override the to string function
28   * to describe the change. This enhances the ability to debug should the stack ever become
29   * out of sync.</p>
30   */
31  public abstract class ComponentContextChange
32  {
33    /**
34     * Suspends any changes that the component has made so that an invoke on component or
35     * visit tree call may be made without the context of the component interfering.
36     *
37     * @param facesContext The faces context
38     */
39    public abstract void suspend(FacesContext facesContext);
40  
41    /**
42     * Resumes the suspended context of a component.
43     *
44     * @param facesContext The faces context
45     */
46    public abstract void resume(FacesContext facesContext);
47  }