KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > ddloaders > client > DDChangeEvent


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.j2ee.ddloaders.client;
21
22 //import org.netbeans.modules.j2ee.ddloaders.ejb.EjbJarDataObject;
23

24 /** DDChangeEvent describes the change that affects deployment of web application.
25  * Deployment descriptor object can listen to these changes
26  * and update its configuration according to change.
27  *
28  * @author Ludovic Champenois
29  */

30 public class DDChangeEvent extends java.util.EventObject JavaDoc {
31     
32     /** Event fired when new ejb is added or copied from another location */
33     public static final int EJB_ADDED = 1;
34     
35     /** Event fired when ejb is renamed or moved within one web module */
36     public static final int EJB_CHANGED = 2;
37     
38     /** Event fired when ejb is deleted */
39     public static final int EJB_DELETED = 3; // delete
40

41     /** Event fired when ejb is moved */
42     public static final int EJB_MOVED = 4;
43     
44     /** Event fired when ejb is moved from one web module to another one */
45     public static final int EJB_HOME_CHANGED = 5;
46     
47     public static final int EJB_REMOTE_CHANGED = 6;
48     
49     public static final int EJB_LOCAL_HOME_CHANGED = 7;
50     
51     public static final int EJB_LOCAL_CHANGED = 8;
52     
53     public static final int EJB_HOME_DELETED = 9;
54     
55     public static final int EJB_REMOTE_DELETED = 10;
56     
57     public static final int EJB_LOCAL_HOME_DELETED = 11;
58     
59     public static final int EJB_LOCAL_DELETED = 12;
60     
61     public static final int EJB_CLASS_CHANGED = 13;
62
63     public static final int EJB_CLASS_DELETED = 14;
64
65     /** Newly set value. Usually current classname of ejb if it makes sense. */
66     private String JavaDoc newValue;
67     
68     /** Old value. Usually old classname of ejb if it makes sense. */
69     private String JavaDoc oldValue;
70     
71     /** Event type */
72     private int type;
73     
74     /** placeholder for old depl. descriptor (only for ejb moves) */
75     private ClientDataObject oldDD;
76     
77     /** Creates new event.
78      *
79      * @param src class name of ejb
80      * @param type type of change
81      */

82     public DDChangeEvent (Object JavaDoc src, ClientDataObject oldDD, String JavaDoc oldVal, String JavaDoc newVal, int type) {
83         super (src);
84         newValue = newVal;
85         oldValue = oldVal;
86         this.type = type;
87         this.oldDD = oldDD;
88     }
89     
90     /** Creates new event.
91      *
92      * @param src class name of ejb
93      * @param type type of change
94      */

95     public DDChangeEvent (Object JavaDoc src, String JavaDoc oldVal, String JavaDoc newVal, int type) {
96         this (src, null, oldVal, newVal, type);
97     }
98     
99     public String JavaDoc getNewValue () {
100         return newValue;
101     }
102     
103     public String JavaDoc getOldValue () {
104         return oldValue;
105     }
106     
107     public ClientDataObject getOldDD () {
108         return oldDD;
109     }
110     
111     /** Getter for change type
112      *
113      * @return change type
114      */

115     public int getType () {
116         return type;
117     }
118     
119     public String JavaDoc toString () {
120         return "DDChangeEvent "+getSource ()+" of type "+type; // NOI18N
121
}
122     
123 }
124
Popular Tags