KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > descriptor > componentassembly > ccm > deployer > root > ComponentassemblyDeployer


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 Frederic
23 Contributor(s): Christophe Contreras.
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.root;
28
29 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.base.FatalDeploymentException;
30 import org.omg.Components.CCMObject;
31 import org.omg.Components.InvalidConfiguration;
32
33 /**
34  * The ComponnetassemblyDeployer is the root of all the deployer tree.
35  * @author briclet
36  *
37  *
38  */

39 public class ComponentassemblyDeployer
40     extends ComponentassemblyDeployerContext
41     {
42     // ==================================================================
43
//
44
// Internal state.
45
//
46
// ==================================================================
47
// ==================================================================
48
//
49
// Constructors.
50
//
51
// ==================================================================
52
// ==================================================================
53
//
54
// Internal methods.
55
//
56
// ==================================================================
57
// ==================================================================
58
//
59
// Public methods.
60
//
61
// ==================================================================
62
/**
63      * Deploy start the execution of the deployment process.
64      *
65      * @throws FatalDeploymentException if a fatal error occured
66      */

67     public void deploy()
68     throws FatalDeploymentException
69     {
70         getDeploymentLogger().log("<<STEP2>> Begin the information reading");
71         // Load the imbricated CSD and CAD, using the extension manager tool
72
//if (getComponentfilesDeployer() != null)
73
// getComponentfilesDeployer().deployPartial(deployTable);
74
getDeploymentLogger().log("<</STEP2>> Information reading ended");
75         // Home deployment and instantiation of components
76
getDeploymentLogger().log("<<STEP3>> Begin the component installation");
77         getPartitioningDeployer().deploy();
78         getDeploymentLogger().log("<</STEP3>>Component installation ended");
79         getDeploymentLogger().log("<<STEP4>> Establishing component connections");
80         if (getConnectionsDeployer() != null)
81             getConnectionsDeployer().deploy();
82            
83         getLifeCycleManager().stepEndedSuccessFully();
84         getDeploymentLogger().log("<</STEP4>> Component connections established" );
85     }
86     /**
87      * Configure complete all the deployed components.
88      *
89      * @throws FatalDeploymentException if a fatal error occured.
90      */

91     public void configueCompleteComponents()
92     throws FatalDeploymentException
93     {
94         CCMObject [] list=getComponents();
95         try{
96             for(int i=0;i<list.length;i++){
97                (new ComponentCompleter(list[i])).start();
98             }
99         }
100         catch(StartingError e){
101             throw new FatalDeploymentException(e.getException(),"A component cannot be started\n");
102         }
103
104     }
105     /**
106      * Tear down the built assembly.
107      *
108      * @throws FatalDeploymentException if a fatal error occured.
109      */

110     public void tearDown()
111     throws FatalDeploymentException
112     {
113         getDeploymentLogger().log("<</STEP5>> Teardowning the assembly" );
114         //Break connections
115
if (getConnectionsDeployer() != null)
116             getConnectionsDeployer().tearDown();
117         getPartitioningDeployer().tearDown();
118
119         getLifeCycleManager().stepEndedSuccessFully();
120         getDeploymentLogger().log("<</STEP5>> Assembly teardowned successfully" );
121     }
122     
123
124
125 }
126
Popular Tags