KickJava   Java API By Example, From Geeks To Geeks.

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


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

41 public class SoftpkgDeployerContext
42        extends ChildDeployerContext
43 {
44     // ==================================================================
45
//
46
// Internal state.
47
//
48
// ==================================================================
49
private SoftpkgBean softpkg;
50     private LinkedList JavaDoc implementationDeployers;
51     private LinkedList JavaDoc dependencyDeployers;
52     private LinkedList JavaDoc descriptorDeployers;
53     // ==================================================================
54
//
55
// Constructors.
56
//
57
// ==================================================================
58
public SoftpkgDeployerContext(){
59         implementationDeployers=new LinkedList JavaDoc();
60         dependencyDeployers=new LinkedList JavaDoc();
61         descriptorDeployers=new LinkedList JavaDoc();
62     }
63     // ==================================================================
64
//
65
// Internal methods.
66
//
67
// ==================================================================
68
// ==================================================================
69
//
70
// Public methods.
71
//
72
// ==================================================================
73
/**
74      * @return
75      */

76     public SoftpkgBean
77     getSoftpkg()
78     {
79         return softpkg;
80     }
81
82     /**
83      * @param bean
84      */

85     public void
86     connectSoftpkg(SoftpkgBean bean)
87     {
88         softpkg = bean;
89         connectDeployerDescription(bean);
90     }
91
92     public void
93     connectDependencyDeployer(DependencyDeployer deployer)
94     {
95         dependencyDeployers.addLast(deployer);
96     }
97
98     public DependencyDeployer[]
99     getDependencyDeployers()
100     {
101         return (DependencyDeployer[])
102                 dependencyDeployers
103                 .toArray(new DependencyDeployer[dependencyDeployers.size()]);
104     }
105
106     public void
107     connectDescriptorDeployer(DescriptorDeployer deployer)
108     {
109         descriptorDeployers.addLast(deployer);
110     }
111
112     public DescriptorDeployer[]
113     getDescriptorDeployers()
114     {
115         return (DescriptorDeployer[])
116                 descriptorDeployers
117                 .toArray(new DescriptorDeployer[descriptorDeployers.size()]);
118     }
119
120     public void
121     connectImplementationDeployer(ImplementationDeployer deployer)
122     {
123         implementationDeployers.addLast(deployer);
124     }
125
126     public ImplementationDeployer[]
127     getImplementationDeployers()
128     {
129         return (ImplementationDeployer[])
130                     implementationDeployers
131                     .toArray(new ImplementationDeployer[implementationDeployers.size()]);
132     }
133     
134     /**
135      * This initialization method is used to check that all the services and
136      * information required to deploy are presents. If all is OK the deployer
137      * is put in inactive deployer state waiting for the deployment processing.
138      *
139      * @exception InitializationError is thrown if a problem is detected
140      */

141     public void
142     initialize()
143     throws InitializationError
144     {
145         if(getSoftpkg()==null)
146               getErrorManager()
147               .submitException(new InitializationError(this,"Connection on softpkg bean is required"+
148                                                        "check the handler code it must specify this connection"));
149         getLifeCycleManager().stepEndedSuccessFully();
150     }
151    
152
153 }
154
Popular Tags