KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > descriptor > softpkg > ccm > DescriptorDeployerContext


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

42 public abstract class DescriptorDeployerContext
43        extends ChildDeployerContext
44     {
45     // ==================================================================
46
//
47
// Internal state.
48
//
49
// ==================================================================
50
private DescriptorBean descriptor;
51     private FileinarchiveDeployer fileinarchiveDeployer;
52     private CorbacomponentDeployer corbaComponentDeployer;
53     private CorbacomponentBean corbacomponent;
54     // ==================================================================
55
//
56
// Constructors.
57
//
58
// ==================================================================
59
// ==================================================================
60
//
61
// Internal methods.
62
//
63
// ==================================================================
64
// ==================================================================
65
//
66
// Public methods.
67
//
68
// ==================================================================
69
/**
70      * @return
71      */

72     public DescriptorBean
73     getDescriptor()
74     {
75         return descriptor;
76     }
77
78     /**
79      * @return
80      */

81     public FileinarchiveDeployer
82     getFileinarchiveDeployer()
83     {
84         return fileinarchiveDeployer;
85     }
86
87     /**
88      * @param bean
89      */

90     public void
91     connectDescriptor(DescriptorBean bean)
92     {
93         descriptor = bean;
94         connectDeployerDescription(bean);
95     }
96
97     /**
98      * @param deployer
99      */

100     public void
101     connectFileinarchiveDeployer(FileinarchiveDeployer deployer)
102     {
103         fileinarchiveDeployer = deployer;
104     }
105
106     /**
107      * @return
108      */

109     public CorbacomponentDeployer
110     getCorbaComponentDeployer()
111     {
112         return corbaComponentDeployer;
113     }
114
115     /**
116      * @param deployer
117      */

118     public void
119     connectCorbaComponentDeployer(CorbacomponentDeployer deployer)
120     {
121         corbaComponentDeployer = deployer;
122     }
123
124     /**
125      * @return
126      */

127     public CorbacomponentBean
128     getCorbacomponent()
129     {
130         return corbacomponent;
131     }
132
133     /**
134      * @param bean
135      */

136     public void
137     connectCorbacomponent(CorbacomponentBean bean)
138     {
139         corbacomponent = bean;
140     }
141     /**
142      * Initialization method to load the sub corbacomponent tree
143      *
144      * @throws CorbaComponentFileLoadingFailureException if the file
145      * cannot be load
146      */

147     public abstract void
148     initializeCorbaComponentTree()
149     throws CorbaComponentFileLoadingFailureException;
150     
151     /**
152      * This initialization method is used to check that all the services and
153      * information required to deploy are presents. If all is OK the deployer
154      * is put in inactive deployer state waiting for the deployment processing.
155      *
156      * @exception InitializationError is thrown if a problem is detected
157      */

158     public void initialize() throws InitializationError {
159         if(getDescriptor()==null)
160                  getErrorManager()
161                  .submitException(new InitializationError(this,"Connection on descriptor bean is required"+
162                                                           "check the handler code it must specify this connection"));
163        initializeCorbaComponentTree();
164        getLifeCycleManager().stepEndedSuccessFully();
165     }
166
167
168
169 }
170
Popular Tags