1 /* 2 * The contents of this file are subject to the terms 3 * of the Common Development and Distribution License 4 * (the License). You may not use this file except in 5 * compliance with the License. 6 * 7 * You can obtain a copy of the license at 8 * https://glassfish.dev.java.net/public/CDDLv1.0.html or 9 * glassfish/bootstrap/legal/CDDLv1.0.txt. 10 * See the License for the specific language governing 11 * permissions and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL 14 * Header Notice in each file and include the License file 15 * at glassfish/bootstrap/legal/CDDLv1.0.txt. 16 * If applicable, add the following below the CDDL Header, 17 * with the fields enclosed by brackets [] replaced by 18 * you own identifying information: 19 * "Portions Copyrighted [year] [name of copyright owner]" 20 * 21 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 22 */ 23 24 /** 25 * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms. 26 * 27 * Copyright 2000-2001 by iPlanet/Sun Microsystems, Inc., 28 * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. 29 * All rights reserved. 30 */ 31 32 package com.sun.appserv.server; 33 34 import java.util.Properties; 35 36 /** 37 * lifecycle modules implement <code>com.sun.appserv.server.LifecycleListener</code> interface. 38 * There is just one method in this interface: <code>handleEvent()</code> which posts server 39 * lifecycle events to the lifecycle modules. 40 * <p> 41 * Upon start up, before initializing its subsystems application server posts lifcycle modules the 42 * <code>INIT_EVENT</code>. This is followed by server posting the <code>STARTUP_EVENT</code> to the 43 * lifecycle modules upon which server starts loading and initializaing the applications. Once this 44 * phase is completed, the <code>READY_EVENT</code> is posted to the lifecycle modules. 45 * <p> 46 * When the server is shutdown, server posts the <code>SHUTDOWN_EVENT</code> to the lifecycle modules and 47 * then shuts down the applications and subsystems. Once this phase is completed the 48 * <code>TERMINATION_EVENT</code> is posted. 49 * <p> 50 * Note that lifecycle modules may obtain the event specific data by calling <code>getData()</code> 51 * on the event parameter in the <code>handleEvent()</code>. For the INIT_EVENT event, 52 * <code>getData()</code> returns the lifecycle module's properties configured in server.xml. 53 * <p> 54 * When <code>is-failure-fatal</code> in server.xml is set to <code>true</code>, all exceptions from the 55 * lifecycle modules are treated as fatal conditions. 56 */ 57 public interface LifecycleListener { 58 59 /** receive a server lifecycle event 60 * @param event associated event 61 * @throws <code> ServerLifecycleException </code> for exception condition. 62 * 63 */ 64 public void handleEvent(LifecycleEvent event) throws ServerLifecycleException; 65 } 66