KickJava   Java API By Example, From Geeks To Geeks.

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


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

41 public class ConnectinterfaceDeployerContext
42        extends ChildDeployerContext
43     {
44     // ==================================================================
45
//
46
// Internal state.
47
//
48
// ==================================================================
49
private ComponentsupportedinterfaceDeployer componentsupportedinterfaceDeployer;
50     private ExistinginterfaceDeployer existinginterfaceDeployer;
51     private HomeinterfaceDeployer homeinterfaceDeployer;
52     private ProvidesportDeployer providesportDeployer;
53     private UsesportDeployer usesportDeployer;
54     private ConnectinterfaceBean connectinterface;
55     
56     // ==================================================================
57
//
58
// Constructors.
59
//
60
// ==================================================================
61
// ==================================================================
62
//
63
// Internal methods.
64
//
65
// ==================================================================
66
// ==================================================================
67
//
68
// Public accessor methods.
69
//
70
// ==================================================================
71

72     /**
73      * @return
74      */

75     public ComponentsupportedinterfaceDeployer
76     getComponentsupportedinterfaceDeployer()
77     {
78         return componentsupportedinterfaceDeployer;
79     }
80
81     /**
82      * @return
83      */

84     public ExistinginterfaceDeployer
85     getExistinginterfaceDeployer()
86     {
87         return existinginterfaceDeployer;
88     }
89
90     /**
91      * @return
92      */

93     public HomeinterfaceDeployer
94     getHomeinterfaceDeployer()
95     {
96         return homeinterfaceDeployer;
97     }
98
99     /**
100      * @return
101      */

102     public ProvidesportDeployer
103      getProvidesportDeployer()
104      {
105         return providesportDeployer;
106     }
107
108     /**
109      * @return
110      */

111     public UsesportDeployer
112     getUsesportDeployer()
113     {
114         return usesportDeployer;
115     }
116
117     /**
118      * @param deployer
119      */

120     public void
121     connectComponentsupportedinterfaceDeployer
122     (ComponentsupportedinterfaceDeployer deployer)
123     {
124         componentsupportedinterfaceDeployer = deployer;
125     }
126
127     /**
128      * @param deployer
129      */

130     public void
131     connectExistinginterfaceDeployer(ExistinginterfaceDeployer deployer)
132     {
133         existinginterfaceDeployer = deployer;
134     }
135
136     /**
137      * @param deployer
138      */

139     public void
140     connectHomeinterfaceDeployer(HomeinterfaceDeployer deployer)
141     {
142         homeinterfaceDeployer = deployer;
143     }
144
145     /**
146      * @param deployer
147      */

148     public void
149     connectProvidesportDeployer(ProvidesportDeployer deployer)
150     {
151         providesportDeployer = deployer;
152     }
153
154     /**
155      * @param deployer
156      */

157     public void
158     connectUsesportDeployer(UsesportDeployer deployer)
159      {
160         usesportDeployer = deployer;
161     }
162     /**
163      * @return
164      */

165     protected Connectinterface getConnectinterface() {
166         return connectinterface;
167     }
168
169     /**
170      * @param connectinterface
171      */

172     public void connectConnectinterface(ConnectinterfaceBean connectinterface) {
173         this.connectinterface = connectinterface;
174         connectDeployerDescription(connectinterface);
175     }
176         
177     /**
178      * This initialization method is used to check that all the services and
179      * information required to deploy are presents. If all is OK the deployer
180      * is put in inactive deployer state waiting for the deployment processing.
181      *
182      * @exception InitializationError is thrown if a problem is detected
183      */

184     public void
185     initialize()
186     throws InitializationError
187     {
188         if(getConnectinterface()==null)
189             getErrorManager()
190           .submitException(new InitializationError(this,"Connection on connectinterface bean is required"+
191                                                "check the handler code it must specify this connection"));
192         if(getUsesportDeployer()==null)
193             getErrorManager()
194            .submitException(new InitializationError(this,"The useport child must be specified in"+
195                                                "connectinterface element check you connectinterface element"+
196                                                "description.\n"+getStringifiedDeployerDescription()));
197                                                
198         if(getProvidesportDeployer()==null&&
199            getComponentsupportedinterfaceDeployer()==null&&
200            getExistinginterfaceDeployer()==null&&
201            getHomeinterfaceDeployer()==null)
202             getErrorManager()
203            .submitException(new InitializationError(this,"One of The providesport/componentsupportedinterface"+
204                                               "existinginterface/homeinterface child must be specified in"+
205                                               "connectinterface element check you connectinterface element"+
206                                               "description.\n"+getStringifiedDeployerDescription()));
207         getLifeCycleManager().stepEndedSuccessFully();
208     }
209     
210 }
211
Popular Tags