KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > Deployment > listener > ComponentServerListenerBase


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2000-2002 USTL - LIFL - GOAL
5 Contact: openccm-team@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): Romain Rouvoy.
23 Contributor(s): ______________________________________.
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.Deployment.listener;
28
29 import org.objectweb.openccm.Deployment.ComponentServerLocal;
30 import org.objectweb.openccm.Deployment.listener.ComponentServerListener;
31
32 /**
33  * Partial implementation for the
34  * ::plugins::deployment::ComponentServerListener interface
35  *
36  * @author <a HREF="mailto:Romain.Rouvoy@lifl.fr">Romain Rouvoy</a>
37  *
38  * @version 0.3
39  */

40 public abstract class ComponentServerListenerBase
41         extends org.omg.CORBA.LocalObject JavaDoc
42         implements ComponentServerListener
43 {
44     // ==================================================================
45
//
46
// Internal state.
47
//
48
// ==================================================================
49
/**
50      * The delegate listener
51      */

52     protected ComponentServerListener delegate_;
53     
54     /**
55      * The event source
56      */

57     protected ComponentServerLocal source_;
58     
59     // ==================================================================
60
//
61
// Constructor.
62
//
63
// ==================================================================
64
/**
65      * Constructor with parameter
66      *
67      * @param source the event source
68      */

69     protected
70         ComponentServerListenerBase(ComponentServerLocal source)
71     {
72                 delegate_ = null;
73                 source_ = source;
74     }
75
76     /**
77      * Default Constructor
78      *
79      */

80     protected
81     ComponentServerListenerBase()
82     {
83                 this(null) ;
84     }
85     
86     // ==================================================================
87
//
88
// Internal methods.
89
//
90
// ==================================================================
91
/**
92      * Provide a new instance of the class
93      *
94      * @return new instance
95          */

96         protected abstract ComponentServerListener
97         _new();
98
99     
100     // ==================================================================
101
//
102
// Public methods.
103
//
104
// ==================================================================
105

106     // ==================================================================
107
//
108
// Methods for the ::plugins::deployment::ComponentServerListener interface.
109
//
110
// ==================================================================
111
//
112
// IDL:omg.org/plugins/deployment/ComponentServerListener/set_delegate:1.0
113
//
114
/**
115      * Set the delegate listener
116      *
117      * @param listener the delegate listener
118      */

119     public void
120         set_delegate (ComponentServerListener listener)
121     {
122                 set_source(listener.get_source());
123                 if (delegate_ == null)
124                         {
125                                 delegate_ = listener;
126                         }
127                 else
128                         delegate_.set_delegate (listener);
129     }
130
131     //
132
// IDL:omg.org/plugins/deployment/ComponentServerListener/get_source:1.0
133
//
134
/**
135      * Provide the interface for interacting with the component server
136      *
137      * @return the interface of manipulation
138      */

139     public ComponentServerLocal
140     get_source()
141     {
142                 return source_;
143     }
144  
145     //
146
// IDL:omg.org/plugins/deployment/ComponentServerListener/set_source:1.0
147
//
148
/**
149      * Set the interface for interacting with the Container
150      *
151      * @param home the interface of manipulation
152      */

153     public void
154     set_source(ComponentServerLocal home)
155     {
156                 source_ = home;
157     }
158
159     //
160
// IDL:omg.org/plugins/deployment/ComponentServerListener/configure_component_server:1.0
161
//
162
/**
163      * Configure the specified component server with the current listener
164      *
165      * @param component_server the component server to configure
166      */

167     public void
168     configure_component_server(ComponentServerLocal component_server)
169     {
170                 component_server.add_listener(_new());
171     }
172
173     //
174
// IDL:omg.org/plugins/deployment/ComponentServerListener/get_sub_listener:1.0
175
//
176
/**
177      * Provide the equivalent Container listener for the current listener
178      *
179      * @return the equivalent Container listener
180      */

181     public abstract ContainerListener
182     get_sub_listener();
183
184   
185     // ==================================================================
186
//
187
// Methods for the ::plugins::deployment::ComponentServerEvents interface.
188
//
189
// ==================================================================
190
//
191
// IDL:omg.org/plugins/deployment/ComponentServerEvents/on_create:1.0
192
//
193
/**
194          * Event sent after the create function is called on ComponentServer object
195          *
196          * @param ref the object created
197          */

198         public abstract void
199     on_create (org.omg.Components.Deployment.Container cont_ref) ;
200         
201     //
202
// IDL:omg.org/plugins/deployment/ComponentServerEvents/on_add:1.0
203
//
204
/**
205          * Event sent after the add function is called on ComponentServer object
206          *
207          * @param ref the object added
208          */

209         public abstract void
210     on_add (org.omg.Components.Deployment.Container cont_ref) ;
211         
212     //
213
// IDL:omg.org/plugins/deployment/ComponentServerEvents/on_remove:1.0
214
//
215
/**
216          * Event sent before the remove function is called on ComponentServer object
217          *
218          * @param ref the object removed
219          */

220         public abstract void
221     on_remove (org.omg.Components.Deployment.Container cont_ref);
222         
223     //
224
// IDL:omg.org/plugins/deployment/ComponentServerEvents/on_destroy:1.0
225
//
226
/**
227          * Event sent before the destruction of the related ComponentServer object
228          *
229          */

230         public abstract void
231     on_destroy ();
232 }
233
234
235
236
237
238
239
240
Popular Tags