KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > deployment > MessageListener


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.deployment;
24
25 import java.util.*;
26 import java.util.jar.*;
27 import java.io.*;
28 import java.util.zip.*;
29 import com.sun.enterprise.deployment.EnvironmentProperty;
30
31 /**
32  * connector1.5
33  * <!ELEMENT messagelistener (messagelistener-type,
34  * activationspec)>
35  *
36  * @author Sheetal Vartak
37  */

38 public class MessageListener extends Descriptor {
39
40     
41     private boolean isDirty = false;
42
43     private String JavaDoc msgListenerType;
44     private String JavaDoc activationSpecClass;
45     private Set configProperties;
46
47     //default constructor
48
public MessageListener() {
49     this.configProperties = new OrderedSet();
50     }
51
52    
53
54     public String JavaDoc getMessageListenerType() {
55     return msgListenerType;
56     }
57
58     public void setMessageListenerType(String JavaDoc msgListenerType) {
59     this.msgListenerType = msgListenerType;
60     }
61
62     public String JavaDoc getActivationSpecClass() {
63     return activationSpecClass;
64     }
65
66     public void setActivationSpecClass(String JavaDoc activationSpecClass) {
67     this.activationSpecClass = activationSpecClass;
68     }
69
70      
71     /** add a configProperty to the set
72      */

73     public void addConfigProperty(EnvironmentProperty configProperty) {
74     this.configProperties.add(configProperty);
75         this.setDirty();
76         this.changed();
77     }
78     
79     /** remove a configProperty from the set
80      */

81     public void removeConfigProperty(EnvironmentProperty configProperty) {
82     this.configProperties.remove(configProperty);
83         this.setDirty();
84         this.changed();
85     }
86
87     /** Set of EnvironmentProperty
88      */

89     public Set getConfigProperties() {
90         return configProperties;
91     }
92
93     //return the msg listener name
94
//FIXME. No longer valid. Use messagelistener-type instead of name
95
public String JavaDoc getMessageListenerName() {
96         throw new UnsupportedOperationException JavaDoc();
97     }
98
99     //set the msg listener name
100
//FIXME. No longer valid. Use messagelistener-type instead of name
101
public void setMessageListenerName(String JavaDoc msgListenerName) {
102         throw new UnsupportedOperationException JavaDoc();
103     }
104   
105     //////////////////////////////////////////
106
//misc. methods for denoting change in data
107
/////////////////////////////////////////
108
public void changed() {
109     super.changed();
110     }
111         
112     /**
113      * A flag to indicate that my data has changed since the last save.
114      */

115     public boolean isDirty() {
116     return this.isDirty;
117     }
118
119     private void setDirty() {
120         this.isDirty = true;
121     }
122     
123     void doneOpening() {
124     this.isDirty = false;
125     this.changed();
126     }
127
128     void doneSaving() {
129     this.isDirty = false;
130     this.changed();
131     }
132
133     /** override 'setName' to set 'dirty' flag
134     */

135     public void setName(String JavaDoc name) {
136     if (!this.getName().equals(name)) {
137         this.setDirty();
138         super.setName(name);
139     }
140     }
141     
142   }
143
Popular Tags