KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > deployment > backend > DeploymentEvent


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  * DeploymentEvent.java
26  *
27  * Created on April 8, 2003.
28  */

29
30 package com.sun.enterprise.deployment.backend;
31
32 import java.util.EventObject JavaDoc;
33
34 /**
35  * A <code>DeploymentEvent</code> event gets delivered whenever a
36  * <code>DeploymentEventListener</code> registers itself with the
37  * <code>DeploymentEventManager</code>.
38  *
39  * @author Marina Vatkina
40  */

41 public class DeploymentEvent
42     extends EventObject JavaDoc
43 {
44
45     public static final int UNKNOWN = 0;
46
47     public static final int PRE_DEPLOY = 1;
48
49     public static final int POST_DEPLOY = 2;
50
51     public static final int PRE_UNDEPLOY = 3;
52
53     public static final int POST_UNDEPLOY = 4;
54
55
56     /** Event type */
57     private int eventType = 0;
58
59     /**
60      * Constructs <code>DeploymentEvent</code> from an event type
61      * and a <code>DeploymentEventInfo</code> instance.
62      * @param eventType as one of the valid Event types.
63      * @param info the DeploymentEventInfo instance to be used for this event.
64      */

65     public DeploymentEvent(int eventType, DeploymentEventInfo info) {
66         super(info);
67         this.eventType = eventType;
68     }
69
70     /**
71      * Returns event type of this event.
72      * @return event type of this event.
73      */

74     public int getEventType() {
75         return eventType;
76     }
77
78     /**
79      * Returns event info of this event.
80      * @return event info of this event.
81      */

82     public DeploymentEventInfo getEventInfo() {
83         return (DeploymentEventInfo)getSource();
84     }
85
86 }
87
Popular Tags