KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > appserv > server > LifecycleEvent


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
35 /**
36  * This class defines the types of events that get fired by the application server.
37  * It also contains a LifecycleEventContext that can be used by the
38  * lifecycle modules.
39  */

40 public class LifecycleEvent extends java.util.EventObject JavaDoc {
41     
42     private int eventType;
43     private Object JavaDoc eventData;
44     private LifecycleEventContext ctx = null;
45     
46     // Lifecycle event types
47

48     /** Server is initializing subsystems and setting up the runtime environment.
49     */

50     public final static int INIT_EVENT = 0;
51
52     /** Server is starting up applications
53      */

54     public final static int STARTUP_EVENT = 1;
55
56     /** Server is ready to service requests
57      */

58     public final static int READY_EVENT = 2;
59
60     /** Server is shutting down applications
61      */

62     public final static int SHUTDOWN_EVENT = 3;
63
64     /** Server is terminating the subsystems and the runtime environment.
65      */

66     public final static int TERMINATION_EVENT = 4;
67
68     
69     /**
70      * Construct new lifecycle event
71      * @param source The object on which the event initially occurred
72      * @param eventType type of the event
73      * @param ctx the underlying context for the lifecycle event
74      */

75     public LifecycleEvent(Object JavaDoc source, int eventType, Object JavaDoc eventData, LifecycleEventContext ctx) {
76         super(source);
77
78         this.eventType = eventType;
79         this.eventData = eventData;
80         this.ctx = ctx;
81     }
82     
83     /** Get the type of event associated with this
84      */

85     public int getEventType() {
86         return eventType;
87     }
88
89     /** Get the data associated with the event.
90      */

91     public Object JavaDoc getData() {
92         return eventData;
93     }
94
95     /** Get the ServerContext generating this lifecycle event
96      */

97     public LifecycleEventContext getLifecycleEventContext() {
98         return ctx;
99     }
100 }
101
Popular Tags