KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > descriptor > componentassembly > ccm > deployer > installer > DestinationDeployerContext


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.installer;
27
28 import org.objectweb.openccm.descriptor.componentassembly.beans.DestinationBean;
29 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.base.*;
30 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.util.FindbyDeployer;
31 import org.objectweb.openccm.descriptor.softpkg.ccm.ImplementationDeployer;
32 import org.objectweb.openccm.descriptor.softpkg.ccm.SoftpkgDeployer;
33
34 /**
35  * The destination deployer context defines all the connection requires
36  * to install a home on a target host.
37  *
38  * @author <a HREF="mailto:briclet@lifl.fr">Briclet Frédéric</a>
39  *
40  * @version 0.1
41  */

42 public class DestinationDeployerContext
43        extends ChildDeployerContext
44     {
45     // ==================================================================
46
//
47
// Internal state.
48
//
49
// ==================================================================
50
private DestinationBean destination;
51     private FindbyDeployer findbyDeployer;
52     private NodeDeployer nodeDeployer;
53     private SoftpkgDeployer softpkgDeployer;
54     private ImplementationDeployer implementationDeployer;
55     // ==================================================================
56
//
57
// Constructors.
58
//
59
// ==================================================================
60
// ==================================================================
61
//
62
// Internal methods.
63
//
64
// ==================================================================
65
// ==================================================================
66
//
67
// Public accessors methods.
68
//
69
// ==================================================================
70
/**
71      * @return
72      */

73     public DestinationBean
74     getDestination()
75     {
76         return destination;
77     }
78
79     /**
80      * @param bean
81      */

82     public void
83     connectDestination(DestinationBean bean)
84     {
85         destination = bean;
86         connectDeployerDescription(bean);
87     }
88
89     /**
90      * @return
91      */

92     public FindbyDeployer
93     getFindbyDeployer()
94     {
95         return findbyDeployer;
96     }
97
98     /**
99      * @param deployer
100      */

101     public void
102     connectFindbyDeployer(FindbyDeployer deployer)
103     {
104         findbyDeployer = deployer;
105     }
106
107     /**
108      * @return
109      */

110     public NodeDeployer
111     getNodeDeployer()
112     {
113         return nodeDeployer;
114     }
115
116     /**
117      * @param deployer
118      */

119     public void
120     connectNodeDeployer(NodeDeployer deployer)
121     {
122         nodeDeployer = deployer;
123     }
124
125     /**
126      * @return
127      */

128     public ImplementationDeployer
129     getImplementationDeployer()
130     {
131         return implementationDeployer;
132     }
133
134     /**
135      * @return
136      */

137     public SoftpkgDeployer
138     getSoftpkgDeployer()
139     {
140         return softpkgDeployer;
141     }
142
143     /**
144      * @param deployer
145      */

146     public void
147     connectImplementationDeployer(ImplementationDeployer deployer)
148     {
149         implementationDeployer = deployer;
150     }
151
152     /**
153      * @param deployer
154      */

155     public void
156     connectSoftpkgDeployer(SoftpkgDeployer deployer)
157     {
158         softpkgDeployer = deployer;
159     }
160     
161     /**
162      * This initialization method is used to check that all the services and
163      * information required to deploy are presents. If all is OK the deployer
164      * is put in inactive deployer state waiting for the deployment processing.
165      *
166      * @exception InitializationError is thrown if a problem is detected
167      */

168     public void initialize()
169     throws InitializationError
170     {
171         if(getDestination()==null)
172                getErrorManager()
173               .submitException(new InitializationError(this,"Connection on destination bean is required"+
174                                                        "check the handler code it must specify this connection"));
175         //TODO: add detsination format verification
176
getLifeCycleManager().stepEndedSuccessFully();
177     }
178
179
180
181 }
182
Popular Tags