KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > server > event > ApplicationClientEvent


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 package com.sun.enterprise.server.event;
25
26 import com.sun.enterprise.deployment.Application;
27
28 /**
29  *
30  * ApplicationClientEvents are sent before/after an application client
31  * is loaded/unloaded.
32  *
33  * Listeners that are interested in getting ApplicationClientLaoderEvents
34  * can register with the ApplicationClientLoaderEventNotifier as follows:
35  *
36  * ApplicationClientLoaderEventNotifier notifier =
37  * ApplicationClientLoaderEventNotifier.getInstance();
38  * notifier.addListener(listener);
39  *
40  * Application client events are sent even when app client modules are
41  * deployed / undeployed.
42  *
43  * Generally, APPLICATION events are sent in the following order
44  * a) BEFORE_APPLICATION_CLIENT_LOAD
45  * b) AFTER_APPLICATION_CLIENT_LOAD
46  * c) BEFORE_APPLICATION_CLIENT_UNLOAD
47  * d) AFTER_APPLICATION_CLIENT_UNLOAD
48  *
49  *Note that this class is basically a copy of the ApplicationEvent class, with
50  *the key difference being the prefix assinged for the toString method.
51  *
52  *Also, this class defines a parallel set of constants named for application client
53  *load and unload events for clarity in logic elsewhere that uses them.
54  */

55 public class ApplicationClientEvent extends ApplicationEvent {
56
57     /**
58      *The following constants allow listeners for this type of event to
59      *use names that reflect the client-related event types, even though they
60      *convey essentially the same meaning as the application-related event types.
61      */

62     public static final int BEFORE_APPLICATION_CLIENT_LOAD = BEFORE_APPLICATION_LOAD;
63     public static final int AFTER_APPLICATION_CLIENT_LOAD = AFTER_APPLICATION_LOAD;
64     public static final int BEFORE_APPLICATION_CLIENT_UNLOAD = BEFORE_APPLICATION_UNLOAD;
65     public static final int AFTER_APPLICATION_CLIENT_UNLOAD = AFTER_APPLICATION_UNLOAD;
66
67     public ApplicationClientEvent(int eventType, Application application,
68         ClassLoader JavaDoc loader)
69     {
70     super(eventType, application, loader);
71     }
72     
73     public String JavaDoc toString() {
74         return toString(new StringBuffer JavaDoc("AppClientEvent: "));
75     }
76
77 }
78
Popular Tags