KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > descriptor > componentassembly > ccm > deployer > binder > ConnecteventDeployerContext


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2000-2004 INRIA - USTL - LIFL - GOAL
5 Contact: openccm@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): Briclet Frédéric.
23 Contributor(s): ______________________________________.
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.binder;
28
29 import org.objectweb.openccm.descriptor.componentassembly.beans.ConnecteventBean;
30 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.base.ChildDeployerContext;
31 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.base.InitializationError;
32 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.util.FindbyDeployer;
33
34 /**
35  * The connectevent deployer context defines all the connection requires for
36  * connectevent establishment.
37  *
38  * @author <a HREF="mailto:briclet@lifl.fr">Briclet Frédéric</a>
39  *
40  * @version 0.1
41  */

42
43 public class ConnecteventDeployerContext
44        extends ChildDeployerContext
45     {
46     // ==================================================================
47
//
48
// Internal state.
49
//
50
// ==================================================================
51
private ConnecteventBean connectevent;
52     private FindbyDeployer findbyDeployer;
53     private ConsumesportDeployer consumesportDeployer;
54     private EmitsportDeployer emitsportDeployer;
55     private PublishesportDeployer publishesportDeployer;
56     private ExistinginterfaceDeployer existinginterfaceDeployer;
57     
58     // ==================================================================
59
//
60
// Constructors.
61
//
62
// ==================================================================
63
// ==================================================================
64
//
65
// Internal methods.
66
//
67
// ==================================================================
68
// ==================================================================
69
//
70
// Public Accessor methods.
71
//
72
// ==================================================================
73

74     /**
75      * @return
76      */

77     public ConnecteventBean
78     getConnectevent()
79     {
80         return connectevent;
81     }
82
83     /**
84      * @return
85      */

86     public ConsumesportDeployer
87     getConsumesportDeployer()
88     {
89         return consumesportDeployer;
90     }
91
92     /**
93      * @return
94      */

95     public EmitsportDeployer
96     getEmitsportDeployer()
97     {
98         return emitsportDeployer;
99     }
100
101     /**
102      * @return
103      */

104     public ExistinginterfaceDeployer
105     getExistinginterfaceDeployer()
106     {
107         return existinginterfaceDeployer;
108     }
109
110     /**
111      * @return
112      */

113     public FindbyDeployer
114     getFindbyDeployer()
115     {
116         return findbyDeployer;
117     }
118
119     /**
120      * @return
121      */

122     public PublishesportDeployer
123     getPublishesportDeployer()
124     {
125         return publishesportDeployer;
126     }
127
128     /**
129      * @param connectevent
130      */

131     public void
132     connectConnectevent(ConnecteventBean connectevent)
133     {
134         this.connectevent = connectevent;
135         connectDeployerDescription(connectevent);
136     }
137
138     /**
139      * @param deployer
140      */

141     public void
142     connectConsumesportDeployer(ConsumesportDeployer deployer)
143     {
144         consumesportDeployer = deployer;
145     }
146
147     /**
148      * @param deployer
149      */

150     public void
151     connectEmitsportDeployer(EmitsportDeployer deployer)
152     {
153         emitsportDeployer = deployer;
154     }
155
156     /**
157      * @param deployer
158      */

159     public void
160     connectExistinginterfaceDeployer(ExistinginterfaceDeployer deployer)
161     {
162         existinginterfaceDeployer = deployer;
163     }
164
165     /**
166      * @param deployer
167      */

168     public void
169     connectFindbyDeployer(FindbyDeployer deployer)
170     {
171         findbyDeployer = deployer;
172     }
173
174     /**
175      * @param deployer
176      */

177     public void
178     connectPublishesportDeployer(PublishesportDeployer deployer)
179     {
180         publishesportDeployer = deployer;
181     }
182     
183     /**
184      * This initialization method is used to check that all the services and
185      * information required to deploy are presents. If all is OK the deployer
186      * is put in inactive deployer state waiting for the deployment processing.
187      *
188      * @exception InitializationError is thrown if a problem is detected
189      */

190     public void
191     initialize()
192     throws InitializationError
193     {
194         if(getConnectevent()==null)
195             getErrorManager()
196            .submitException(new InitializationError(this,"Connection on connectevent bean is required "+
197                                           "check the handler code it must specify this connection"));
198         
199
200         if(getPublishesportDeployer()==null&&getEmitsportDeployer()==null){
201             getErrorManager()
202            .submitException(new InitializationError(this,"One of publishesport/emitsport child must be specified in "+
203                                                        "connectevent element check you connectevent element "+
204                                                        "description.\n"+getStringifiedDeployerDescription()));
205         }
206              
207         if(getConsumesportDeployer()==null&&getExistinginterfaceDeployer()==null){
208             getErrorManager()
209            .submitException(new InitializationError(this,"One of consumesport/existinginterface child must be specified in "+
210                                                      "connectevent element check you connectevent element "+
211                                                      "description.\n"+getStringifiedDeployerDescription()));
212         }
213            
214         getLifeCycleManager().stepEndedSuccessFully();
215     }
216 }
217
Popular Tags