KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > admin > event > EventStack


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 package com.sun.enterprise.admin.event;
24
25 import java.util.List JavaDoc;
26 import java.util.ArrayList JavaDoc;
27 import com.sun.enterprise.config.ConfigContext;
28
29 /**
30  * This object encapsulates event related information in the thread local.
31  *
32  * @author Nazrul Islam
33  * @since JDK1.4
34  */

35 public class EventStack {
36
37     /**
38      * Returns the config changes associated with this event.
39      * @return list of config changes
40      */

41     public List JavaDoc getConfigChangeList() {
42         return _configChangeList;
43     }
44
45     /**
46      * Sets the config changes for this event.
47      * @param list list of config changes
48      */

49     public void setConfigChangeList(List JavaDoc list) {
50         _configChangeList = list;
51     }
52
53     /**
54      * Returns the target for this event.
55      * @return the target for this event
56      */

57     public String JavaDoc getTarget() {
58         return _target;
59     }
60
61     /**
62      * Sets the target destination for this event.
63      * @param target target destination of the event
64      */

65     public void setTarget(String JavaDoc target) {
66         _target = target;
67     }
68
69     public String JavaDoc getXPath() {
70         return _xPath;
71     }
72
73     public void setXPath(String JavaDoc xPath) {
74         _xPath = xPath;
75     }
76
77     /**
78      * Returns all events from the stack.
79      * @return list of events from the stack
80      */

81     public List JavaDoc getEvents() {
82         return _events;
83     }
84
85     /**
86      * Adds an event to the event stack.
87      * @param event newly created event
88      */

89     public void addEvent(AdminEvent event) {
90         _events.add(event);
91     }
92
93     /**
94      * Returns the admin config context associated with this event.
95      * @return admin config context
96      */

97     public ConfigContext getConfigContext() {
98         return _ctx;
99     }
100
101     /**
102      * Sets the admin config context to the event stack.
103      * @param ctx admin config context
104      */

105     public void setConfigContext(ConfigContext ctx) {
106         _ctx = ctx;
107     }
108
109     /**
110      * resets the events in the event stack.
111      */

112     public void resetEvents() {
113         _events.clear();
114     }
115     
116     // ---- VARIABLES - PRIVATE ---------------------------
117
private List JavaDoc _configChangeList = new ArrayList JavaDoc();
118     private String JavaDoc _target = null;
119     private String JavaDoc _xPath = null;
120     private List JavaDoc _events = new ArrayList JavaDoc();
121     private ConfigContext _ctx = null;
122 }
123
Popular Tags