2009/05/20 - Apache Shale has been retired.

For more information, please explore the Attic.

View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to you under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  package org.apache.shale.view;
19  
20  /***
21   * <p><strong>AbstractRequestBean</strong> is the abstract base class for
22   * data bean(s) that are stored in request scope attributes.  It extends
23   * {@link AbstractFacesBean}, so it inherits all of the default behavior
24   * found there.  In addition, the following lifecycle methods are called
25   * automatically when the corresponding events occur:</p>
26   * <ul>
27   * <li><code>init()</code> - Called when this bean is initially added as a
28   *     request scope attribute (typically as the result of
29   *     evaluating a value binding or method binding expression).</li>
30   * <li><code>destroy()</code> - Called when the bean is removed from the
31   *     request attributes (typically as a result of the application
32   *     being shut down by the servlet container).</li>
33   * </ul>
34   *
35   * $Id: AbstractRequestBean.java 464373 2006-10-16 04:21:54Z rahul $
36   */
37  public abstract class AbstractRequestBean extends AbstractFacesBean {
38  
39  
40      // ------------------------------------------------------------- Constructor
41  
42  
43      /***
44       * <p>Create a new request scope bean.</p>
45       */
46      public AbstractRequestBean() {
47      }
48  
49  
50      // ------------------------------------------------------- Lifecycle Methods
51  
52  
53      /***
54       * <p>This method is called when this bean is initially added to
55       * request scope.  Typically, this occurs as a result of evaluating
56       * a value binding or method binding expression, which utilizes the
57       * managed bean facility to instantiate this bean and store it into
58       * request scope.</p>
59       *
60       * <p>You may customize this method to allocate resources that are required
61       * for the lifetime of the current request.</p>
62       */
63      public void init() {
64  
65          // The default implementation does nothing
66  
67      }
68  
69  
70      /***
71       * <p>This method is called when this bean is removed from
72       * request scope.  This occurs automatically when the corresponding
73       * HTTP response has been completed and sent to the client.</p>
74       *
75       * <p>You may customize this method to clean up resources allocated
76       * during the execution of the <code>init()</code> method, or
77       * at any later time during the lifetime of the request.</p>
78       */
79      public void destroy() {
80  
81          // The default implementation does nothing
82  
83      }
84  
85  
86  }