KickJava   Java API By Example, From Geeks To Geeks.

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


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.installer;
28
29
30 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.base.*;
31
32 /**
33  * Process the partitionning deployment.
34  *
35  * @author <a HREF="mailto:frederic.briclet@lifl.fr">Briclet Frederic</a>
36  *
37  * @version 0.1
38  */

39 public class PartitioningDeployer extends PartitioningDeployerContext
40 {
41     
42     
43     // ==================================================================
44
//
45
// Internal state.
46
//
47
// ==================================================================
48

49     // ==================================================================
50
//
51
// Constructor.
52
//
53
// ==================================================================
54

55     // ==================================================================
56
//
57
// Internal methods.
58
//
59
// ==================================================================
60

61     // ==================================================================
62
//
63
// Public methods.
64
//
65
// ==================================================================
66

67     /**
68      * The partition deploy method is in charge to deploy all the collocation
69      * ,processcollocation and homeplacement.
70      *
71      * @throws FatalDeploymentException if a fatal problem occured
72      */

73     public void
74     deploy()
75     throws FatalDeploymentException
76     {
77        
78         //deploy homeplacement
79
traverse(this,getHomeplacementDeployers());
80         //deploy componentplacement
81
traverse(this,getComponentplacementDeployers());
82         //deploy hostcollocation
83
traverse(this,getHostcollocationDeployers());
84         // deployment of the processlocation list
85
traverse(this,getProcesscollocationDeployers());
86
87         getLifeCycleManager().stepEndedSuccessFully();
88     }
89     
90     /**
91      * Remove all the installed home and component precised by the partioning
92      * element.
93      *
94      * @throws FatalDeploymentException if a fatal problem occured
95      */

96     public void
97     tearDown()
98     throws FatalDeploymentException
99     {
100         traverse(this,getComponentplacementDeployers());
101         traverse(this,getHomeplacementDeployers());
102         traverse(this,getHostcollocationDeployers());
103         traverse(this,getProcesscollocationDeployers());
104         getLifeCycleManager().stepEndedSuccessFully();
105     }
106     
107     /**
108      * HomeplacementDeployer visitor method to install a homeplacement.
109      * @param homeplacementDeployer the homeplacementDeployer to execute
110      * @param status the partitioning current status
111      * @throws FatalDeploymentException if a fatal problem occured
112      */

113     public void
114     visit(HomeplacementDeployer homeplacementDeployer, DeployerInactiveState status)
115     throws FatalDeploymentException{
116         homeplacementDeployer.deploy();
117     }
118     /**
119      * HomeplacementDeployer visitor method to uninstall a homeplacement.
120      * @param homeplacementDeployer the homeplacementDeployer to uninstall
121      * @param status the partitioning current status
122      * @throws FatalDeploymentException if a fatal problem occured
123      */

124     public void
125     visit(HomeplacementDeployer homeplacementDeployer, DeployerActiveState status)
126     throws FatalDeploymentException{
127         homeplacementDeployer.tearDown();
128     }
129     /**
130      * componentplacementDeployer visitor method to execute a componentplacement.
131      * @param componentplacementDeployer the homeplacementDeployer to execute
132      * @param status the partitioning current status
133      * @throws FatalDeploymentException if a fatal problem occured
134      */

135     public void
136     visit(ComponentplacementDeployer componentplacementDeployer, DeployerInactiveState status)
137     throws FatalDeploymentException{
138         componentplacementDeployer.deploy();
139     }
140     /**
141      * componentplacementDeployer visitor method to uninstall a componentplacement.
142      * @param componentplacementDeployer the homeplacementDeployer to uninstall
143      * @param status the partitioning current status
144      * @throws FatalDeploymentException if a fatal problem occured
145      */

146     public void
147     visit(ComponentplacementDeployer componentplacementDeployer, DeployerActiveState status)
148     throws Exception JavaDoc{
149         componentplacementDeployer.tearDown();
150     }
151     /**
152      * hostcollocationDeployer visitor method to execute a hostcollocation.
153      * @param hostcollocationDeployer the hostcollocationDeployer to execute
154      * @param status the partitioning current status
155      * @throws FatalDeploymentException if a fatal problem occured
156      */

157     public void
158     visit(HostcollocationDeployer hostcollocationDeployer, DeployerInactiveState status)
159     throws Exception JavaDoc{
160        hostcollocationDeployer.deploy();
161     }
162     /**
163      * hostcollocationDeployer visitor method to uninstall a hostcollocation.
164      * @param hostcollocationDeployer the hostcollocationDeployer to uninstall
165      * @param status the partitioning current status
166      * @throws FatalDeploymentException if a fatal problem occured
167      */

168     public void
169     visit(HostcollocationDeployer hostcollocationDeployer, DeployerActiveState status)
170     throws Exception JavaDoc{
171         hostcollocationDeployer.tearDown();
172     }
173     
174     
175 }
176
177
Popular Tags