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>AbstractApplicationBean</strong> is the abstract base class for
22   * data bean(s) that are stored in application 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 an
28   *     application 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   *     application attributes (typically as a result of the application
32   *     being shut down by the servlet container).</li>
33   * </ul>
34   *
35   * $Id: AbstractApplicationBean.java 464373 2006-10-16 04:21:54Z rahul $
36   */
37  public abstract class AbstractApplicationBean extends AbstractFacesBean {
38  
39  
40      // ------------------------------------------------------------- Constructor
41  
42  
43      /***
44       * <p>Create a new application scope bean.</p>
45       */
46      public AbstractApplicationBean() {
47      }
48  
49  
50      // ------------------------------------------------------- Lifecycle Methods
51  
52  
53      /***
54       * <p>This method is called when this bean is initially added to
55       * application 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       * application scope.</p>
59       *
60       * <p>You may customize this method to initialize and cache application wide
61       * data values (such as the lists of valid options for dropdown list
62       * components), or to allocate resources that are required for the
63       * lifetime of the application.</p>
64       */
65      public void init() {
66  
67          // The default implementation does nothing
68  
69      }
70  
71  
72      /***
73       * <p>This method is called when this bean is removed from
74       * application scope.  Typically, this occurs as a result of
75       * the application being shut down by its owning container.</p>
76       *
77       * <p>You may customize this method to clean up resources allocated
78       * during the execution of the <code>init()</code> method, or
79       * at any later time during the lifetime of the application.</p>
80       */
81      public void destroy() {
82  
83          // The default implementation does nothing
84  
85      }
86  
87  
88  }