KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > config > serverbeans > AlertSubscription


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  * This generated bean class AlertSubscription matches the DTD element alert-subscription
26  *
27  */

28
29 package com.sun.enterprise.config.serverbeans;
30
31 import org.w3c.dom.*;
32 import org.netbeans.modules.schema2beans.*;
33 import java.beans.*;
34 import java.util.*;
35 import java.io.Serializable JavaDoc;
36 import com.sun.enterprise.config.ConfigBean;
37 import com.sun.enterprise.config.ConfigException;
38 import com.sun.enterprise.config.StaleWriteConfigException;
39 import com.sun.enterprise.util.i18n.StringManager;
40
41 // BEGIN_NOI18N
42

43 public class AlertSubscription extends ConfigBean implements Serializable JavaDoc
44 {
45
46     static Vector comparators = new Vector();
47     private static final org.netbeans.modules.schema2beans.Version runtimeVersion = new org.netbeans.modules.schema2beans.Version(4, 2, 0);
48
49     static public final String JavaDoc LISTENER_CONFIG = "ListenerConfig";
50     static public final String JavaDoc FILTER_CONFIG = "FilterConfig";
51
52     public AlertSubscription() {
53         this(Common.USE_DEFAULT_VALUES);
54     }
55
56     public AlertSubscription(int options)
57     {
58         super(comparators, runtimeVersion);
59         // Properties (see root bean comments for the bean graph)
60
initPropertyTables(2);
61         this.createProperty("listener-config", LISTENER_CONFIG,
62             Common.TYPE_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
63             ListenerConfig.class);
64         this.createAttribute(LISTENER_CONFIG, "listener-class-name", "ListenerClassName",
65                         AttrProp.CDATA | AttrProp.REQUIRED,
66                         null, null);
67         this.createAttribute(LISTENER_CONFIG, "subscribe-listener-with", "SubscribeListenerWith",
68                         AttrProp.CDATA | AttrProp.REQUIRED,
69                         null, null);
70         this.createProperty("filter-config", FILTER_CONFIG,
71             Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
72             FilterConfig.class);
73         this.createAttribute(FILTER_CONFIG, "filter-class-name", "FilterClassName",
74                         AttrProp.CDATA | AttrProp.REQUIRED,
75                         null, null);
76         this.initialize(options);
77     }
78
79     // Setting the default values of the properties
80
void initialize(int options) {
81
82     }
83
84     // This attribute is mandatory
85
public void setListenerConfig(ListenerConfig value) {
86         this.setValue(LISTENER_CONFIG, value);
87     }
88
89     // Get Method
90
public ListenerConfig getListenerConfig() {
91         return (ListenerConfig)this.getValue(LISTENER_CONFIG);
92     }
93
94     // This attribute is optional
95
public void setFilterConfig(FilterConfig value) {
96         this.setValue(FILTER_CONFIG, value);
97     }
98
99     // Get Method
100
public FilterConfig getFilterConfig() {
101         return (FilterConfig)this.getValue(FILTER_CONFIG);
102     }
103
104     /**
105     * Getter for Name of the Element alert-subscription
106     * @return the Name of the Element alert-subscription
107     */

108     public String JavaDoc getName() {
109         return getAttributeValue(ServerTags.NAME);
110     }
111     /**
112     * Modify the Name of the Element alert-subscription
113     * @param v the new value
114     * @throws StaleWriteConfigException if overwrite is false and file changed on disk
115     */

116     public void setName(String JavaDoc v, boolean overwrite) throws StaleWriteConfigException {
117         setAttributeValue(ServerTags.NAME, v, overwrite);
118     }
119     /**
120     * Modify the Name of the Element alert-subscription
121     * @param v the new value
122     */

123     public void setName(String JavaDoc v) {
124         setAttributeValue(ServerTags.NAME, v);
125     }
126     /**
127      * Create a new bean using it's default constructor.
128      * This does not add it to any bean graph.
129      */

130     public ListenerConfig newListenerConfig() {
131         return new ListenerConfig();
132     }
133
134     /**
135      * Create a new bean using it's default constructor.
136      * This does not add it to any bean graph.
137      */

138     public FilterConfig newFilterConfig() {
139         return new FilterConfig();
140     }
141
142     /**
143     * get the xpath representation for this element
144     * returns something like abc[@name='value'] or abc
145     * depending on the type of the bean
146     */

147     protected String JavaDoc getRelativeXPath() {
148         String JavaDoc ret = null;
149         ret = "alert-subscription" + (canHaveSiblings() ? "[@name='" + getAttributeValue("name") +"']" : "") ;
150         return (null != ret ? ret.trim() : null);
151     }
152
153     /*
154     * generic method to get default value from dtd
155     */

156     public static String JavaDoc getDefaultAttributeValue(String JavaDoc attr) {
157         if(attr == null) return null;
158         attr = attr.trim();
159     return null;
160     }
161     //
162
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
163         comparators.add(c);
164     }
165
166     //
167
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
168         comparators.remove(c);
169     }
170     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
171     }
172
173     // Dump the content of this bean returning it as a String
174
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
175         String JavaDoc s;
176         Object JavaDoc o;
177         org.netbeans.modules.schema2beans.BaseBean n;
178         str.append(indent);
179         str.append("ListenerConfig"); // NOI18N
180
n = (org.netbeans.modules.schema2beans.BaseBean) this.getListenerConfig();
181         if (n != null)
182             n.dump(str, indent + "\t"); // NOI18N
183
else
184             str.append(indent+"\tnull"); // NOI18N
185
this.dumpAttributes(LISTENER_CONFIG, 0, str, indent);
186
187         str.append(indent);
188         str.append("FilterConfig"); // NOI18N
189
n = (org.netbeans.modules.schema2beans.BaseBean) this.getFilterConfig();
190         if (n != null)
191             n.dump(str, indent + "\t"); // NOI18N
192
else
193             str.append(indent+"\tnull"); // NOI18N
194
this.dumpAttributes(FILTER_CONFIG, 0, str, indent);
195
196     }
197     public String JavaDoc dumpBeanNode(){
198         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
199         str.append("AlertSubscription\n"); // NOI18N
200
this.dump(str, "\n "); // NOI18N
201
return str.toString();
202     }}
203
204 // END_NOI18N
205

206
Popular Tags