001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package com.sun.rave.web.ui.appbase;
043:
044: /**
045: * <p><strong>AbstractFragmentBean</strong> is the abstract base class for every
046: * page bean associated with a JSP page fragment containing JavaServer Faces
047: * components. It extends {@link FacesBean}, so it inherits all of the
048: * default integration behavior found there.</p>
049: *
050: * <p>In addition to event handler methods that you create while building
051: * your application, the runtime environment will also call the following
052: * <em>lifecycle</em> related methods at appropriate points during the execution
053: * of your application:</p>
054: * <ul>
055: * <li><strong>init()</strong> - Called whenever you navigate to a page
056: * containing this page fragment, either directly (via a URL) or indirectly
057: * via page navigation from a different page. You can override this
058: * method to acquire any resources that will always be needed by this
059: * page fragment.</li>
060: * <li><strong>destroy()</strong> - Called unconditionally if
061: * <code>init()</code> was called, after completion of rendering by
062: * whichever page was actually rendered. Override this method to release
063: * any resources allocated in the <code>init()</code> method,
064: * or in an event handler.</li>
065: * </ul>
066: */
067: public abstract class AbstractFragmentBean extends FacesBean {
068:
069: // ------------------------------------------------------------- Constructor
070:
071: /**
072: * <p>Construct a new instance of this bean.</p>
073: */
074: public AbstractFragmentBean() {
075: }
076:
077: // ------------------------------------------------------- Lifecycle Methods
078:
079: /**
080: * <p>Callback method that is called whenever a page containing
081: * this page fragment is navigated to, either directly via a URL,
082: * or indirectly via page navigation. Override this method to acquire
083: * resources that will be needed for event handlers and lifecycle methods.
084: * </p>
085: *
086: * <p>The default implementation does nothing.</p>
087: */
088: public void init() {
089: ;
090: }
091:
092: /**
093: * <p>Callback method that is called after rendering is completed for
094: * this request, if <code>init()</code> was called. Override this
095: * method to release resources acquired in the <code>init()</code>
096: * method (or acquired during execution of an event handler).</p>
097: *
098: * <p>The default implementation does nothing.</p>
099: */
100: public void destroy() {
101: ;
102: }
103:
104: }
|