KickJava   Java API By Example, From Geeks To Geeks.

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


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.deployment;
25
26 import java.util.Set JavaDoc;
27
28 /**
29  * This class argueably could be rolled up to the
30  * ConnectorDescriptor class. However, it is easier
31  * to keep track of the changes in inbound ra element
32  * as well as encapsulate the concept of inbound ra.
33  *
34  * <!ELEMENT inbound-resourceadapter (messageadapter?)>
35  * <!ELEMENT messageadapter (messagelistener+)>
36  *
37  * @author Qingqing Ouyang
38  */

39 public class InboundResourceAdapter extends Descriptor
40 {
41     private Set JavaDoc messageListeners;
42     private boolean isDirty = false;
43     
44     public InboundResourceAdapter ()
45     {
46         messageListeners = new OrderedSet();
47     }
48     
49     public Set JavaDoc
50     getMessageListeners()
51     {
52         return this.messageListeners;
53     }
54     
55     public void
56     addMessageListener (MessageListener listener)
57     {
58         this.messageListeners.add(listener);
59         this.setDirty();
60         this.changed();
61     }
62
63     public void
64     removeMessageListener (MessageListener listener)
65     {
66     this.messageListeners.remove(listener);
67     this.setDirty();
68     this.changed();
69     }
70
71     public boolean
72     isDirty()
73     {
74     return this.isDirty;
75     }
76     
77     public void
78     changed()
79     {
80     super.changed();
81     }
82
83     private void setDirty() {
84         this.isDirty = true;
85     }
86 }
87
Popular Tags