KickJava   Java API By Example, From Geeks To Geeks.

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


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 // Local Interface Import Statements
29
import org.objectweb.apollon.framework.ExtensionManager;
30 import org.objectweb.openccm.descriptor.componentassembly.beans.ComponentplacementBean;
31 import org.objectweb.openccm.descriptor.componentassembly.beans.HomeplacementBean;
32 import org.objectweb.openccm.descriptor.componentassembly.beans.HostcollocationBean;
33 import org.objectweb.openccm.descriptor.componentassembly.beans.PartitioningBeanImpl;
34 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.base.HandlerBase;
35 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.base.InitializationError;
36
37 /**
38  * This handler is used to produce partitioningployer from an
39  * partitioning bean .
40  *
41  * @author <a HREF="mailto:briclet@lifl.fr">Briclet Frédéric</a>
42  *
43  * @version 0.1
44  */

45 public class PartitioningDeployerHandler
46        extends HandlerBase
47     {
48     // ==================================================================
49
//
50
// Internal state.
51
//
52
// ==================================================================
53
private ExtensionManager _extManager;
54     private PartitioningDeployer _deploy;
55     // ==================================================================
56
//
57
// Constructors.
58
//
59
// ==================================================================
60
// ==================================================================
61
//
62
// Internal methods.
63
//
64
// ==================================================================
65
// ==================================================================
66
//
67
// Public methods.
68
//
69
// ==================================================================
70
/**
71      * Produce the partitioning deployer binded
72      * to the givean @param parti.
73      *
74      * @param parti The partitioning bean
75      * @return the deployer produced in initialize state
76      * @throws InitializationError thrown if a problem is detected
77      */

78     public Object JavaDoc
79     getInstance(PartitioningBeanImpl parti)
80     throws InitializationError
81     {
82         if(_deploy==null){
83             _deploy=new PartitioningDeployer();
84             applyCommonConfig(_deploy);
85             
86             _deploy.connectPartitioning(parti);
87             for(java.util.Iterator JavaDoc i=parti.getHomeplacementList().iterator();i.hasNext(); ){
88                   HomeplacementDeployer current=(HomeplacementDeployer)
89                                       getDeployer((HomeplacementBean)i.next());
90                   current.initialize();
91                   _deploy.connectHomeplacementDeployer(current);
92               }
93     
94             for(java.util.Iterator JavaDoc i=parti.getComponentplacementList().iterator();i.hasNext(); ){
95                  ComponentplacementDeployer current=(ComponentplacementDeployer)
96                                      getDeployer((ComponentplacementBean)i.next());
97                  _deploy.connectComponentplacementDeployer(current);
98              }
99  
100             for(java.util.Iterator JavaDoc i=parti.getHostcollocationList().iterator();i.hasNext(); ){
101                HostcollocationDeployer current=(HostcollocationDeployer)
102                                    getDeployer((HostcollocationBean)i.next());
103
104                _deploy.connectHostcollocationDeployer(current);
105            }/*
106            System.err.println("Step4");
107            for(java.util.Iterator i=parti.getProcesscollocationList().iterator();i.hasNext(); ){
108               ProcesscollocationDeployer current=(ProcesscollocationDeployer)
109                                   getDeployer((ProcesscollocationBean)i.next());
110               //current.connectRootDeployerContext(_deploy.getRootDeployerContext());
111               _deploy.connectProcesscollocationDeployer(current);
112           } */

113           _deploy.initialize();
114         }
115       
116         return (_deploy);
117     }
118
119 }
120
Popular Tags